-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle RPITITs properly in register_hidden_type
- Loading branch information
1 parent
0940040
commit 419fde7
Showing
7 changed files
with
63 additions
and
14 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
13 changes: 13 additions & 0 deletions
13
src/test/ui/impl-trait/in-trait/default-body-type-err-2.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,13 @@ | ||
// edition:2021 | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(async_fn_in_trait)] | ||
|
||
pub trait Foo { | ||
async fn woopsie_async(&self) -> String { | ||
42 | ||
//~^ ERROR mismatched types | ||
} | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/impl-trait/in-trait/default-body-type-err-2.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 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/default-body-type-err-2.rs:8:9 | ||
| | ||
LL | 42 | ||
| ^^- help: try using a conversion method: `.to_string()` | ||
| | | ||
| expected struct `String`, found integer | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,13 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
use std::ops::Deref; | ||
|
||
pub trait Foo { | ||
fn lol(&self) -> impl Deref<Target = String> { | ||
//~^ type mismatch resolving `<&i32 as Deref>::Target == String` | ||
&1i32 | ||
} | ||
} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/impl-trait/in-trait/default-body-type-err.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,12 @@ | ||
error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String` | ||
--> $DIR/default-body-type-err.rs:7:22 | ||
| | ||
LL | fn lol(&self) -> impl Deref<Target = String> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String` | ||
LL | | ||
LL | &1i32 | ||
| ----- return type was inferred to be `&i32` here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0271`. |
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
12 changes: 0 additions & 12 deletions
12
src/test/ui/impl-trait/in-trait/default-body-with-rpit.stderr
This file was deleted.
Oops, something went wrong.