error[E0599]: no method named `bar` found for struct `Bar` in the current scope --> $DIR/method-resolution.rs:23:11 | LL | struct Bar(T); | ------------- method `bar` not found for this struct ... LL | x.bar(); | ^^^ method not found in `Bar` | = note: the method was found for - `Bar` error[E0391]: cycle detected when computing type of opaque `foo::{opaque#0}` --> $DIR/method-resolution.rs:19:24 | LL | fn foo(x: bool) -> Bar { | ^^^^^^^^^^ | note: ...which requires type-checking `foo`... --> $DIR/method-resolution.rs:23:9 | LL | x.bar(); | ^ = note: ...which requires evaluating trait selection obligation `Bar: core::marker::Unpin`... = note: ...which again requires computing type of opaque `foo::{opaque#0}`, completing the cycle note: cycle used when computing type of `foo::{opaque#0}` --> $DIR/method-resolution.rs:19:24 | LL | fn foo(x: bool) -> Bar { | ^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error: aborting due to 2 previous errors Some errors have detailed explanations: E0391, E0599. For more information about an error, try `rustc --explain E0391`.