-
Notifications
You must be signed in to change notification settings - Fork 0
Open
rust-lang/rust
#147251Description
#![feature(fn_delegation)]
#![allow(incomplete_features)]
mod opaque {
trait Trait {}
impl Trait for () {}
mod to_reuse {
use super::Trait;
pub fn opaque_ret() -> impl Trait { () }
}
trait ToReuse {
fn opaque_ret() -> impl Trait { () }
}
// FIXME: Inherited `impl Trait`s create query cycles when used inside trait impls.
impl ToReuse for u8 {
reuse to_reuse::opaque_ret; //~ ERROR cycle detected when computing type
}
}
error[E0391]: cycle detected when computing type of `opaque::<impl at src/main.rs:18:5: 18:24>::opaque_ret::{anon_assoc#0}`
--> src/main.rs:19:25
|
19 | reuse to_reuse::opaque_ret; //~ ERROR cycle detected when computing type
| ^^^^^^^^^^
|
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
--> src/main.rs:19:25
|
19 | reuse to_reuse::opaque_ret; //~ ERROR cycle detected when computing type
| ^^^^^^^^^^
= note: ...which again requires computing type of `opaque::<impl at src/main.rs:18:5: 18:24>::opaque_ret::{anon_assoc#0}`, completing the cycle
= note: cycle used when computing implied outlives bounds for `<u8 as opaque::ToReuse>::opaque_ret::{anon_assoc#0}` (hack disabled = false)
= 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
thread 'rustc' panicked at /home/lcnr/rust/compiler/rustc_type_ir/src/search_graph/global_cache.rs:65:17:
assertion failed: cx.evaluation_is_concurrent()
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
in progress