Closed
Description
UPDATE: There are mentoring instructions to be found in a comment below.
Object safety checker produces messages with "supertrait something" even when the cause is in where-clause.
trait Bar<X:?Sized> {}
trait Foo where Box<Self>: Bar<Self> {}
fn f(x: Box<Foo>) {}
fn main () {
}
rustc 1.17.0-nightly (b1e31766d 2017-03-03)
error[E0038]: the trait `Foo` cannot be made into an object
--> <anon>:3:1
|
3 | fn f(x: Box<Foo>) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
|
= note: the trait cannot use `Self` as a type parameter in the supertrait listing
error: aborting due to previous error
Rust Playground: https://is.gd/mAvVNW
Indeed this seems object-unsafe, but the message should be something about "where-clause", not "supertrait listing".
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.