09f16b596d
Do not attempt to provide an accurate suggestion for `impl Trait` in bare trait types when linting. Instead, only do the object safety check when an E0782 is already going to be emitted in the 2021 edition. Fix #120241.
13 lines
625 B
Plaintext
13 lines
625 B
Plaintext
error[E0038]: the trait `Copy` cannot be made into an object
|
|
--> $DIR/avoid-ice-on-warning-2.rs:4:13
|
|
|
|
|
LL | fn id<F>(f: Copy) -> usize {
|
|
| ^^^^ `Copy` cannot be made into an object
|
|
|
|
|
= note: the trait cannot be made into an object because it requires `Self: Sized`
|
|
= 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>
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|