Skip to content

Commit 9e26413

Browse files
committed
Be sure that we do not allow too much
1 parent 132409f commit 9e26413

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![feature(rustc_attrs)]
2+
#![feature(trait_alias)]
3+
4+
trait A {}
5+
trait B {}
6+
trait AB = A + B;
7+
8+
impl A for u32 {}
9+
impl B for u32 {}
10+
11+
trait C {}
12+
#[rustc_strict_coherence]
13+
impl<T: AB> C for T {}
14+
#[rustc_strict_coherence]
15+
impl C for u32 {}
16+
//~^ ERROR
17+
// FIXME it's giving an ungreat error but unsure if we care given that it's using an internal rustc
18+
// attribute and an artificial code path for testing purposes
19+
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0283]: type annotations needed
2+
--> $DIR/coherence-overlap-trait-alias.rs:15:6
3+
|
4+
LL | impl C for u32 {}
5+
| ^ cannot infer type for type `u32`
6+
|
7+
= note: cannot satisfy `u32: C`
8+
note: required by a bound in `C`
9+
--> $DIR/coherence-overlap-trait-alias.rs:11:1
10+
|
11+
LL | trait C {}
12+
| ^^^^^^^ required by this bound in `C`
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0283`.

0 commit comments

Comments
 (0)