-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
normalize in
trait_ref_is_knowable
in new solver
- Loading branch information
Showing
10 changed files
with
214 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
|
||
// Coherence should handle overflow while normalizing for | ||
// `trait_ref_is_knowable` correctly. | ||
|
||
trait Overflow { | ||
type Assoc; | ||
} | ||
impl<T> Overflow for T { | ||
type Assoc = <T as Overflow>::Assoc; | ||
} | ||
|
||
|
||
trait Trait {} | ||
impl<T: Copy> Trait for T {} | ||
struct LocalTy; | ||
impl Trait for <LocalTy as Overflow>::Assoc {} | ||
//~^ ERROR conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc` | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc` | ||
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1 | ||
| | ||
LL | impl<T: Copy> Trait for T {} | ||
| ------------------------- first implementation here | ||
LL | struct LocalTy; | ||
LL | impl Trait for <LocalTy as Overflow>::Assoc {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
Oops, something went wrong.