Skip to content

Commit 144e259

Browse files
committed
Slight rewording of diagnostic message
1 parent 6870f79 commit 144e259

16 files changed

+26
-26
lines changed

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl ObjectSafetyViolation {
4444
pub fn error_msg(&self) -> Cow<'static, str> {
4545
match *self {
4646
ObjectSafetyViolation::SizedSelf(_) => {
47-
"the trait cannot require that `Self : Sized`".into()
47+
"traits that require `Self: Sized` cannot be made into an object".into()
4848
}
4949
ObjectSafetyViolation::SupertraitSelf => {
5050
"the trait cannot use `Self` as a type parameter \

src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error[E0038]: the trait `std::marker::Copy` cannot be made into an object
1616
LL | let _: &Copy + 'static;
1717
| ^^^^^ the trait `std::marker::Copy` cannot be made into an object
1818
|
19-
= note: the trait cannot require that `Self : Sized`
19+
= note: traits that require `Self: Sized` cannot be made into an object
2020

2121
error: aborting due to 3 previous errors
2222

src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
22
--> $DIR/feature-gate-object_safe_for_dispatch.rs:18:38
33
|
44
LL | trait NonObjectSafe1: Sized {}
5-
| ----- the trait cannot require that `Self : Sized`
5+
| ----- traits that require `Self: Sized` cannot be made into an object
66
...
77
LL | fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {
88
| ^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe1` cannot be made into an object
@@ -38,7 +38,7 @@ error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
3838
--> $DIR/feature-gate-object_safe_for_dispatch.rs:38:6
3939
|
4040
LL | trait NonObjectSafe1: Sized {}
41-
| ----- the trait cannot require that `Self : Sized`
41+
| ----- traits that require `Self: Sized` cannot be made into an object
4242
...
4343
LL | impl Trait for dyn NonObjectSafe1 {}
4444
| ^^^^^ the trait `NonObjectSafe1` cannot be made into an object

src/test/ui/issues/issue-20692.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error[E0038]: the trait `Array` cannot be made into an object
22
--> $DIR/issue-20692.rs:7:5
33
|
44
LL | trait Array: Sized + Copy {}
5-
| ----- ---- the trait cannot require that `Self : Sized`
5+
| ----- ---- traits that require `Self: Sized` cannot be made into an object
66
| |
7-
| the trait cannot require that `Self : Sized`
7+
| traits that require `Self: Sized` cannot be made into an object
88
...
99
LL | &dyn Array;
1010
| ^^^^^^^^^^ the trait `Array` cannot be made into an object
@@ -13,9 +13,9 @@ error[E0038]: the trait `Array` cannot be made into an object
1313
--> $DIR/issue-20692.rs:4:13
1414
|
1515
LL | trait Array: Sized + Copy {}
16-
| ----- ---- the trait cannot require that `Self : Sized`
16+
| ----- ---- traits that require `Self: Sized` cannot be made into an object
1717
| |
18-
| the trait cannot require that `Self : Sized`
18+
| traits that require `Self: Sized` cannot be made into an object
1919
...
2020
LL | let _ = x
2121
| ^ the trait `Array` cannot be made into an object

src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
1313
--> $DIR/kindck-inherited-copy-bound.rs:28:19
1414
|
1515
LL | trait Foo : Copy {
16-
| ---- the trait cannot require that `Self : Sized`
16+
| ---- traits that require `Self: Sized` cannot be made into an object
1717
...
1818
LL | let z = &x as &dyn Foo;
1919
| ^^^^^^^^ the trait `Foo` cannot be made into an object
@@ -22,7 +22,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
2222
--> $DIR/kindck-inherited-copy-bound.rs:28:13
2323
|
2424
LL | trait Foo : Copy {
25-
| ---- the trait cannot require that `Self : Sized`
25+
| ---- traits that require `Self: Sized` cannot be made into an object
2626
...
2727
LL | let z = &x as &dyn Foo;
2828
| ^^ the trait `Foo` cannot be made into an object

src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
1313
--> $DIR/kindck-inherited-copy-bound.rs:28:13
1414
|
1515
LL | trait Foo : Copy {
16-
| ---- the trait cannot require that `Self : Sized`
16+
| ---- traits that require `Self: Sized` cannot be made into an object
1717
...
1818
LL | let z = &x as &dyn Foo;
1919
| ^^ the trait `Foo` cannot be made into an object

src/test/ui/object-safety/object-safety-sized-2.curr.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
22
--> $DIR/object-safety-sized-2.rs:14:30
33
|
44
LL | where Self : Sized
5-
| ----- the trait cannot require that `Self : Sized`
5+
| ----- traits that require `Self: Sized` cannot be made into an object
66
...
77
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
88
| ^^^^^^^^ the trait `Bar` cannot be made into an object

src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
22
--> $DIR/object-safety-sized-2.rs:16:5
33
|
44
LL | where Self : Sized
5-
| ----- the trait cannot require that `Self : Sized`
5+
| ----- traits that require `Self: Sized` cannot be made into an object
66
...
77
LL | t
88
| ^ the trait `Bar` cannot be made into an object

src/test/ui/object-safety/object-safety-sized.curr.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
22
--> $DIR/object-safety-sized.rs:12:30
33
|
44
LL | trait Bar : Sized {
5-
| ----- the trait cannot require that `Self : Sized`
5+
| ----- traits that require `Self: Sized` cannot be made into an object
66
...
77
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
88
| ^^^^^^^^ the trait `Bar` cannot be made into an object

src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
22
--> $DIR/object-safety-sized.rs:14:5
33
|
44
LL | trait Bar : Sized {
5-
| ----- the trait cannot require that `Self : Sized`
5+
| ----- traits that require `Self: Sized` cannot be made into an object
66
...
77
LL | t
88
| ^ the trait `Bar` cannot be made into an object

0 commit comments

Comments
 (0)