rust/tests/ui/impl-trait/issues/issue-78722-2.rs
Oli Scherer 40d5609548 Make DefiningAnchor::Bind only store the opaque types that may be constrained, instead of the current infcx root item.
This makes `Bind` almost always be empty, so we can start forwarding it to queries, allowing us to remove `Bubble` entirely
2024-03-11 17:19:37 +00:00

23 lines
576 B
Rust

//! test that we cannot register hidden types for opaque types
//! declared outside an anonymous constant.
//@ edition:2018
#![feature(type_alias_impl_trait)]
type F = impl core::future::Future<Output = u8>;
struct Bug {
V1: [(); {
fn concrete_use() -> F {
//~^ ERROR future that resolves to `u8`, but it resolves to `()`
async {}
}
// FIXME(type_alias_impl_trait): inform the user about why `F` is not available here.
let f: F = async { 1 };
//~^ ERROR mismatched types
1
}],
}
fn main() {}