Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be sure that we do not allow too much
- Loading branch information
1 parent
132409f
commit 9e26413
Showing
2 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![feature(rustc_attrs)] | ||
#![feature(trait_alias)] | ||
|
||
trait A {} | ||
trait B {} | ||
trait AB = A + B; | ||
|
||
impl A for u32 {} | ||
impl B for u32 {} | ||
|
||
trait C {} | ||
#[rustc_strict_coherence] | ||
impl<T: AB> C for T {} | ||
#[rustc_strict_coherence] | ||
impl C for u32 {} | ||
//~^ ERROR | ||
// FIXME it's giving an ungreat error but unsure if we care given that it's using an internal rustc | ||
// attribute and an artificial code path for testing purposes | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/coherence/coherence-overlap-trait-alias.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,16 @@ | ||
error[E0283]: type annotations needed | ||
--> $DIR/coherence-overlap-trait-alias.rs:15:6 | ||
| | ||
LL | impl C for u32 {} | ||
| ^ cannot infer type for type `u32` | ||
| | ||
= note: cannot satisfy `u32: C` | ||
note: required by a bound in `C` | ||
--> $DIR/coherence-overlap-trait-alias.rs:11:1 | ||
| | ||
LL | trait C {} | ||
| ^^^^^^^ required by this bound in `C` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0283`. |