-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Move object safety suggestions to the end of the error #88892
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> | ||
--> $DIR/issue-18959.rs:1:20 | ||
| | ||
LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); } | ||
| ^^^ ...because method `foo` has generic type parameters | ||
LL | pub trait Bar: Foo { } | ||
| --- this trait cannot be made into an object... | ||
= help: consider moving `foo` to another trait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to account for cases where the problem is caused by a super trait and make this diagnostic better targeted.
@bors r+ |
📌 Commit 40f2a3b has been approved by |
Move object safety suggestions to the end of the error
Move object safety suggestions to the end of the error
Move object safety suggestions to the end of the error
@bors r- I think this is causing a bunch of failures in #88940 (comment) |
40f2a3b
to
9762116
Compare
@bors r=petrochenkov We now sort the suggestions before emition for consistent output. |
📌 Commit 9762116 has been approved by |
Move object safety suggestions to the end of the error
Move object safety suggestions to the end of the error
…arth Rollup of 10 pull requests Successful merges: - rust-lang#88292 (Enable --generate-link-to-definition for rustc's docs) - rust-lang#88729 (Recover from `Foo(a: 1, b: 2)`) - rust-lang#88875 (cleanup(rustc_trait_selection): remove vestigial code from rustc_on_unimplemented) - rust-lang#88892 (Move object safety suggestions to the end of the error) - rust-lang#88928 (Document the closure arguments for `reduce`.) - rust-lang#88976 (Clean up and add doc comments for CStr) - rust-lang#88983 (Allow calling `get_body_with_borrowck_facts` without `-Z polonius`) - rust-lang#88985 (Update clobber_abi list to include k[1-7] regs) - rust-lang#88986 (Update the backtrace crate) - rust-lang#89009 (Fix typo in `break` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.