2023-06-15 09:41:14 +00:00
|
|
|
//! 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 {}
|
|
|
|
}
|
2024-02-29 12:21:20 +00:00
|
|
|
// FIXME(type_alias_impl_trait): inform the user about why `F` is not available here.
|
2023-06-15 09:41:14 +00:00
|
|
|
let f: F = async { 1 };
|
2024-02-29 12:21:20 +00:00
|
|
|
//~^ ERROR mismatched types
|
2023-06-15 09:41:14 +00:00
|
|
|
1
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|