Add a test for default trait method with RPITITs
This commit is contained in:
parent
8f55d6025f
commit
dfc4a580f2
2 changed files with 28 additions and 0 deletions
17
tests/ui/impl-trait/in-trait/default-method-constraint.rs
Normal file
17
tests/ui/impl-trait/in-trait/default-method-constraint.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// check-pass
|
||||
|
||||
// This didn't work in the previous default RPITIT method hack attempt
|
||||
|
||||
#![feature(return_position_impl_trait_in_trait)]
|
||||
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
|
||||
|
||||
trait Foo {
|
||||
fn bar(x: bool) -> impl Sized {
|
||||
if x {
|
||||
let _: u32 = Self::bar(!x);
|
||||
}
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue