2024-05-30 14:00:44 -05:00
|
|
|
#![feature(const_trait_impl)]
|
2023-11-26 06:57:31 -06:00
|
|
|
#![feature(c_variadic)]
|
2024-05-30 14:00:44 -05:00
|
|
|
#![feature(effects)]
|
2023-11-26 06:57:31 -06:00
|
|
|
#![feature(fn_delegation)]
|
2024-03-26 10:59:03 -05:00
|
|
|
#![allow(incomplete_features)]
|
2023-11-26 06:57:31 -06:00
|
|
|
|
|
|
|
mod opaque {
|
|
|
|
trait Trait {}
|
|
|
|
impl Trait for () {}
|
|
|
|
|
|
|
|
mod to_reuse {
|
|
|
|
use super::Trait;
|
|
|
|
|
|
|
|
pub fn opaque_ret() -> impl Trait { unimplemented!() }
|
2024-05-19 21:24:23 -05:00
|
|
|
//~^ warn: this function depends on never type fallback being `()`
|
|
|
|
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2023-11-26 06:57:31 -06:00
|
|
|
}
|
|
|
|
|
2024-03-14 07:42:14 -05:00
|
|
|
trait ToReuse {
|
|
|
|
fn opaque_ret() -> impl Trait { unimplemented!() }
|
2024-05-19 21:24:23 -05:00
|
|
|
//~^ warn: this function depends on never type fallback being `()`
|
|
|
|
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2023-11-26 06:57:31 -06:00
|
|
|
}
|
|
|
|
|
2024-03-14 07:42:14 -05:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
impl ToReuse for u16 {
|
|
|
|
reuse ToReuse::opaque_ret; //~ ERROR cycle detected when computing type
|
|
|
|
}
|
2023-11-26 06:57:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
mod recursive {
|
|
|
|
mod to_reuse1 {
|
|
|
|
pub mod to_reuse2 {
|
|
|
|
pub fn foo() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub reuse to_reuse2::foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
reuse to_reuse1::foo;
|
|
|
|
//~^ ERROR recursive delegation is not supported yet
|
|
|
|
}
|
|
|
|
|
2024-05-30 14:00:44 -05:00
|
|
|
mod effects {
|
|
|
|
#[const_trait]
|
|
|
|
trait Trait {
|
|
|
|
fn foo();
|
|
|
|
}
|
|
|
|
|
|
|
|
reuse Trait::foo;
|
|
|
|
//~^ ERROR delegation to a function with effect parameter is not supported yet
|
|
|
|
}
|
|
|
|
|
2023-11-26 06:57:31 -06:00
|
|
|
fn main() {}
|