-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #101629 - compiler-errors:issue-101623, r=sanxiyn
Be careful about `expr_ty_adjusted` when noting block tail type Fixes #101623
- Loading branch information
Showing
4 changed files
with
44 additions
and
4 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
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
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,25 @@ | ||
pub struct Stuff { | ||
inner: *mut (), | ||
} | ||
|
||
pub struct Wrap<T>(T); | ||
|
||
fn fun<T>(t: T) -> Wrap<T> { | ||
todo!() | ||
} | ||
|
||
pub trait Trait<'de> { | ||
fn do_stuff(_: Wrap<&'de mut Self>); | ||
} | ||
|
||
impl<'a> Trait<'a> for () { | ||
fn do_stuff(_: Wrap<&'a mut Self>) {} | ||
} | ||
|
||
fn fun2(t: &mut Stuff) -> () { | ||
let Stuff { inner, .. } = t; | ||
Trait::do_stuff({ fun(&mut *inner) }); | ||
//~^ ERROR the trait bound `*mut (): Trait<'_>` is not satisfied | ||
} | ||
|
||
fn main() {} |
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,14 @@ | ||
error[E0277]: the trait bound `*mut (): Trait<'_>` is not satisfied | ||
--> $DIR/issue-101623.rs:21:21 | ||
| | ||
LL | Trait::do_stuff({ fun(&mut *inner) }); | ||
| --------------- ^^----------------^^ | ||
| | | | ||
| | the trait `Trait<'_>` is not implemented for `*mut ()` | ||
| required by a bound introduced by this call | ||
| | ||
= help: the trait `Trait<'a>` is implemented for `()` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |