File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
src/test/ui/type-alias-impl-trait Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( type_alias_impl_trait) ]
2+ #![ allow( dead_code) ]
3+
4+ // FIXME This should compile, but it currently doesn't
5+
6+ mod m {
7+ type Foo = impl std:: fmt:: Debug ;
8+ //~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391]
9+
10+ pub fn foo ( ) -> Foo {
11+ 22_u32
12+ }
13+
14+ pub fn bar ( ) {
15+ is_send ( foo ( ) ) ;
16+ }
17+
18+ fn is_send < T : Send > ( _: T ) { }
19+ }
20+
21+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
2+ --> $DIR/auto-trait-leakage3.rs:7:16
3+ |
4+ LL | type Foo = impl std::fmt::Debug;
5+ | ^^^^^^^^^^^^^^^^^^^^
6+ |
7+ note: ...which requires type-checking `m::bar`...
8+ --> $DIR/auto-trait-leakage3.rs:14:5
9+ |
10+ LL | pub fn bar() {
11+ | ^^^^^^^^^^^^
12+ = note: ...which requires evaluating trait selection obligation `impl std::fmt::Debug: std::marker::Send`...
13+ = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
14+ note: cycle used when checking item types in module `m`
15+ --> $DIR/auto-trait-leakage3.rs:6:1
16+ |
17+ LL | mod m {
18+ | ^^^^^
19+
20+ error: aborting due to previous error
21+
22+ For more information about this error, try `rustc --explain E0391`.
You can’t perform that action at this time.
0 commit comments