-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account for RPITITs in opt_suggest_box_span
- Loading branch information
1 parent
65c53c3
commit 7df33a0
Showing
3 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/test/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// check-pass | ||
|
||
#![feature(return_position_impl_trait_in_trait)] | ||
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete | ||
|
||
struct TestA {} | ||
struct TestB {} | ||
|
||
impl TestTrait for TestA { | ||
type Output = (); | ||
} | ||
impl TestTrait for TestB { | ||
type Output = (); | ||
} | ||
|
||
trait TestTrait { | ||
type Output; | ||
} | ||
|
||
impl<A, B> TestTrait for GreeterOutput<A, B> | ||
where | ||
A: TestTrait<Output = ()>, | ||
B: TestTrait<Output = ()>, | ||
{ | ||
type Output = (); | ||
} | ||
|
||
enum GreeterOutput<A, B> | ||
where | ||
A: TestTrait<Output = ()>, | ||
B: TestTrait<Output = ()>, | ||
{ | ||
SayHello(A), | ||
SayGoodbye(B), | ||
} | ||
|
||
trait Greeter { | ||
fn test_func(&self, func: &str) -> impl TestTrait<Output = ()> { | ||
match func { | ||
"SayHello" => GreeterOutput::SayHello(TestA {}), | ||
"SayGoodbye" => GreeterOutput::SayGoodbye(TestB {}), | ||
_ => GreeterOutput::SayHello(TestA {}), | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/impl-trait/in-trait/box-coerce-span-in-default.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/box-coerce-span-in-default.rs:3:12 | ||
| | ||
LL | #![feature(return_position_impl_trait_in_trait)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|