Skip to content

Commit 60c0972

Browse files
authored
Rollup merge of #108290 - compiler-errors:rpitit-trait-default-constraint, r=oli-obk
Add a test for default trait method with RPITITs This didn't work in #107013, but now that #108203 has landed, let's make sure we don't regress it. r? types
2 parents 270f45e + dfc4a58 commit 60c0972

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// check-pass
2+
3+
// This didn't work in the previous default RPITIT method hack attempt
4+
5+
#![feature(return_position_impl_trait_in_trait)]
6+
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
7+
8+
trait Foo {
9+
fn bar(x: bool) -> impl Sized {
10+
if x {
11+
let _: u32 = Self::bar(!x);
12+
}
13+
Default::default()
14+
}
15+
}
16+
17+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/default-method-constraint.rs:5:12
3+
|
4+
LL | #![feature(return_position_impl_trait_in_trait)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
warning: 1 warning emitted
11+

0 commit comments

Comments
 (0)