-
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.
use
delay_span_bug
instead of bug!
when doing layout sanity check
It's possible that `is_object_safe` is called on a trait that is ill-formed, and we shouldn't ICE unless there are no errors being raised. Using `delay_span_bug` solves this. fixes #56806
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub trait Trait { | ||
fn dyn_instead_of_self(self: Box<dyn Trait>); | ||
//~^ ERROR invalid method receiver type: std::boxed::Box<(dyn Trait + 'static)> | ||
} | ||
|
||
pub 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,12 @@ | ||
error[E0307]: invalid method receiver type: std::boxed::Box<(dyn Trait + 'static)> | ||
--> $DIR/issue-56806.rs:2:34 | ||
| | ||
LL | fn dyn_instead_of_self(self: Box<dyn Trait>); | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: type must be `Self` or a type that dereferences to it | ||
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0307`. |