Slight rewording of diagnostic message

This commit is contained in:
Esteban Küber 2020-01-30 10:20:47 -08:00
parent 6870f79e9c
commit 144e259445
16 changed files with 26 additions and 26 deletions

View file

@ -44,7 +44,7 @@ impl ObjectSafetyViolation {
pub fn error_msg(&self) -> Cow<'static, str> {
match *self {
ObjectSafetyViolation::SizedSelf(_) => {
"the trait cannot require that `Self : Sized`".into()
"traits that require `Self: Sized` cannot be made into an object".into()
}
ObjectSafetyViolation::SupertraitSelf => {
"the trait cannot use `Self` as a type parameter \

View file

@ -16,7 +16,7 @@ error[E0038]: the trait `std::marker::Copy` cannot be made into an object
LL | let _: &Copy + 'static;
| ^^^^^ the trait `std::marker::Copy` cannot be made into an object
|
= note: the trait cannot require that `Self : Sized`
= note: traits that require `Self: Sized` cannot be made into an object
error: aborting due to 3 previous errors

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:18:38
|
LL | trait NonObjectSafe1: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {
| ^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe1` cannot be made into an object
@ -38,7 +38,7 @@ error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:38:6
|
LL | trait NonObjectSafe1: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | impl Trait for dyn NonObjectSafe1 {}
| ^^^^^ the trait `NonObjectSafe1` cannot be made into an object

View file

@ -2,9 +2,9 @@ error[E0038]: the trait `Array` cannot be made into an object
--> $DIR/issue-20692.rs:7:5
|
LL | trait Array: Sized + Copy {}
| ----- ---- the trait cannot require that `Self : Sized`
| ----- ---- traits that require `Self: Sized` cannot be made into an object
| |
| the trait cannot require that `Self : Sized`
| traits that require `Self: Sized` cannot be made into an object
...
LL | &dyn Array;
| ^^^^^^^^^^ the trait `Array` cannot be made into an object
@ -13,9 +13,9 @@ error[E0038]: the trait `Array` cannot be made into an object
--> $DIR/issue-20692.rs:4:13
|
LL | trait Array: Sized + Copy {}
| ----- ---- the trait cannot require that `Self : Sized`
| ----- ---- traits that require `Self: Sized` cannot be made into an object
| |
| the trait cannot require that `Self : Sized`
| traits that require `Self: Sized` cannot be made into an object
...
LL | let _ = x
| ^ the trait `Array` cannot be made into an object

View file

@ -13,7 +13,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/kindck-inherited-copy-bound.rs:28:19
|
LL | trait Foo : Copy {
| ---- the trait cannot require that `Self : Sized`
| ---- traits that require `Self: Sized` cannot be made into an object
...
LL | let z = &x as &dyn Foo;
| ^^^^^^^^ the trait `Foo` cannot be made into an object
@ -22,7 +22,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/kindck-inherited-copy-bound.rs:28:13
|
LL | trait Foo : Copy {
| ---- the trait cannot require that `Self : Sized`
| ---- traits that require `Self: Sized` cannot be made into an object
...
LL | let z = &x as &dyn Foo;
| ^^ the trait `Foo` cannot be made into an object

View file

@ -13,7 +13,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/kindck-inherited-copy-bound.rs:28:13
|
LL | trait Foo : Copy {
| ---- the trait cannot require that `Self : Sized`
| ---- traits that require `Self: Sized` cannot be made into an object
...
LL | let z = &x as &dyn Foo;
| ^^ the trait `Foo` cannot be made into an object

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized-2.rs:14:30
|
LL | where Self : Sized
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^ the trait `Bar` cannot be made into an object

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized-2.rs:16:5
|
LL | where Self : Sized
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | t
| ^ the trait `Bar` cannot be made into an object

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized.rs:12:30
|
LL | trait Bar : Sized {
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^ the trait `Bar` cannot be made into an object

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized.rs:14:5
|
LL | trait Bar : Sized {
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | t
| ^ the trait `Bar` cannot be made into an object

View file

@ -15,7 +15,7 @@ error[E0038]: the trait `A` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-self.rs:3:13
|
LL | trait A: Sized {
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
LL | fn f(a: A) -> A;
| ^ the trait `A` cannot be made into an object

View file

@ -10,7 +10,7 @@ error[E0038]: the trait `std::marker::Copy` cannot be made into an object
LL | m!(dyn Copy + Send + 'static);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` cannot be made into an object
|
= note: the trait cannot require that `Self : Sized`
= note: traits that require `Self: Sized` cannot be made into an object
error: aborting due to 2 previous errors

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj-box.rs:16:33
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | let t_box: Box<dyn Trait> = Box::new(S);
| ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
@ -14,7 +14,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | takes_box(Box::new(S));
| ^^^^^^^^^^^ the trait `Trait` cannot be made into an object
@ -26,7 +26,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | Box::new(S) as Box<dyn Trait>;
| ^^^^^^^^^^^ the trait `Trait` cannot be made into an object

View file

@ -2,7 +2,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj.rs:16:25
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | let t: &dyn Trait = &S;
| ^^ the trait `Trait` cannot be made into an object
@ -14,7 +14,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj.rs:17:17
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | takes_trait(&S);
| ^^ the trait `Trait` cannot be made into an object
@ -26,7 +26,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-convert-unsafe-trait-obj.rs:15:5
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | &S as &dyn Trait;
| ^^ the trait `Trait` cannot be made into an object

View file

@ -25,7 +25,7 @@ error[E0038]: the trait `std::marker::Copy` cannot be made into an object
LL | fn bar() where Vec<dyn Copy>:, {}
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` cannot be made into an object
|
= note: the trait cannot require that `Self : Sized`
= note: traits that require `Self: Sized` cannot be made into an object
error: aborting due to 3 previous errors

View file

@ -16,7 +16,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-unsafe-trait-obj-match.rs:26:21
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | Some(()) => &S,
| ^^ the trait `Trait` cannot be made into an object
@ -28,7 +28,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/wf-unsafe-trait-obj-match.rs:25:25
|
LL | trait Trait: Sized {}
| ----- the trait cannot require that `Self : Sized`
| ----- traits that require `Self: Sized` cannot be made into an object
...
LL | let t: &dyn Trait = match opt() {
| ^^^^^^^^^^^ the trait `Trait` cannot be made into an object