Skip to content

Commit a439c02

Browse files
may not => cannot
1 parent 1a521db commit a439c02

38 files changed

+54
-54
lines changed

compiler/rustc_hir_analysis/locales/en-US.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ hir_analysis_missing_type_params =
8989
.note = because of the default `Self` reference, type parameters must be specified on object types
9090
9191
hir_analysis_copy_impl_on_type_with_dtor =
92-
the trait `Copy` may not be implemented for this type; the type has a destructor
92+
the trait `Copy` cannot be implemented for this type; the type has a destructor
9393
.label = `Copy` not allowed on types with destructors
9494
9595
hir_analysis_multiple_relaxed_default_bounds =
9696
type parameter has more than one relaxed default bound, only one is supported
9797
9898
hir_analysis_copy_impl_on_non_adt =
99-
the trait `Copy` may not be implemented for this type
99+
the trait `Copy` cannot be implemented for this type
100100
.label = type is not a structure or enumeration
101101
102102
hir_analysis_const_impl_for_non_const_trait =

compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
8686
tcx.sess,
8787
span,
8888
E0204,
89-
"the trait `Copy` may not be implemented for this type"
89+
"the trait `Copy` cannot be implemented for this type"
9090
);
9191

9292
// We'll try to suggest constraining type parameters to fulfill the requirements of

compiler/rustc_hir_typeck/locales/en-US.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ hir_typeck_field_multiply_specified_in_initializer =
44
.previous_use_label = first use of `{$ident}`
55
66
hir_typeck_copy_impl_on_type_with_dtor =
7-
the trait `Copy` may not be implemented for this type; the type has a destructor
7+
the trait `Copy` cannot be implemented for this type; the type has a destructor
88
.label = `Copy` not allowed on types with destructors
99
1010
hir_typeck_multiple_relaxed_default_bounds =
1111
type parameter has more than one relaxed default bound, only one is supported
1212
1313
hir_typeck_copy_impl_on_non_adt =
14-
the trait `Copy` may not be implemented for this type
14+
the trait `Copy` cannot be implemented for this type
1515
.label = type is not a structure or enumeration
1616
1717
hir_typeck_trait_object_declared_with_no_traits =

library/core/src/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ pub trait StructuralEq {
324324
/// attempt to derive a `Copy` implementation, we'll get an error:
325325
///
326326
/// ```text
327-
/// the trait `Copy` may not be implemented for this type; field `points` does not implement `Copy`
327+
/// the trait `Copy` cannot be implemented for this type; field `points` does not implement `Copy`
328328
/// ```
329329
///
330330
/// Shared references (`&T`) are also `Copy`, so a type can be `Copy`, even when it holds

tests/ui/coherence/coherence-impls-copy.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ LL | impl Copy for [MyType] {}
5252
|
5353
= note: define and implement a trait or new type instead
5454

55-
error[E0206]: the trait `Copy` may not be implemented for this type
55+
error[E0206]: the trait `Copy` cannot be implemented for this type
5656
--> $DIR/coherence-impls-copy.rs:21:15
5757
|
5858
LL | impl Copy for &'static mut MyType {}
5959
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
6060

61-
error[E0206]: the trait `Copy` may not be implemented for this type
61+
error[E0206]: the trait `Copy` cannot be implemented for this type
6262
--> $DIR/coherence-impls-copy.rs:25:15
6363
|
6464
LL | impl Copy for (MyType, MyType) {}
6565
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
6666

67-
error[E0206]: the trait `Copy` may not be implemented for this type
67+
error[E0206]: the trait `Copy` cannot be implemented for this type
6868
--> $DIR/coherence-impls-copy.rs:30:15
6969
|
7070
LL | impl Copy for [MyType] {}

tests/ui/coherence/deep-bad-copy-reason.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'tcx, T> Clone for List<'tcx, T> {
3131
}
3232

3333
impl<'tcx, T> Copy for List<'tcx, T> {}
34-
//~^ ERROR the trait `Copy` may not be implemented for this type
34+
//~^ ERROR the trait `Copy` cannot be implemented for this type
3535

3636
fn assert_is_copy<T: Copy>() {}
3737

tests/ui/coherence/deep-bad-copy-reason.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/deep-bad-copy-reason.rs:33:24
33
|
44
LL | pub struct List<'tcx, T>(Interned<'tcx, ListS<T>>);

tests/ui/error-codes/E0184.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
1+
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
22
--> $DIR/E0184.rs:1:10
33
|
44
LL | #[derive(Copy)]

tests/ui/error-codes/E0206.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
struct Bar;
33

44
impl Copy for &'static mut Bar { }
5-
//~^ ERROR the trait `Copy` may not be implemented for this type
5+
//~^ ERROR the trait `Copy` cannot be implemented for this type
66

77
fn main() {
88
}

tests/ui/error-codes/E0206.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0206]: the trait `Copy` may not be implemented for this type
1+
error[E0206]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/E0206.rs:4:15
33
|
44
LL | impl Copy for &'static mut Bar { }

tests/ui/exclusive-drop-and-copy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// issue #20126
22

3-
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
3+
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
44
struct Foo;
55

66
impl Drop for Foo {
77
fn drop(&mut self) {}
88
}
99

10-
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
10+
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
1111
struct Bar<T>(::std::marker::PhantomData<T>);
1212

1313
impl<T> Drop for Bar<T> {

tests/ui/exclusive-drop-and-copy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
1+
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
22
--> $DIR/exclusive-drop-and-copy.rs:3:10
33
|
44
LL | #[derive(Copy, Clone)]
55
| ^^^^ `Copy` not allowed on types with destructors
66
|
77
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
88

9-
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
9+
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
1010
--> $DIR/exclusive-drop-and-copy.rs:10:10
1111
|
1212
LL | #[derive(Copy, Clone)]

tests/ui/issues/issue-27340.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct Foo;
22
#[derive(Copy, Clone)]
3-
//~^ ERROR the trait `Copy` may not be implemented for this type
3+
//~^ ERROR the trait `Copy` cannot be implemented for this type
44
struct Bar(Foo);
55

66
fn main() {}

tests/ui/issues/issue-27340.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/issue-27340.rs:2:10
33
|
44
LL | #[derive(Copy, Clone)]

tests/ui/opt-in-copy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ struct IWantToCopyThis {
55
}
66

77
impl Copy for IWantToCopyThis {}
8-
//~^ ERROR the trait `Copy` may not be implemented for this type
8+
//~^ ERROR the trait `Copy` cannot be implemented for this type
99

1010
enum CantCopyThisEither {
1111
A,
@@ -17,6 +17,6 @@ enum IWantToCopyThisToo {
1717
}
1818

1919
impl Copy for IWantToCopyThisToo {}
20-
//~^ ERROR the trait `Copy` may not be implemented for this type
20+
//~^ ERROR the trait `Copy` cannot be implemented for this type
2121

2222
fn main() {}

tests/ui/opt-in-copy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/opt-in-copy.rs:7:15
33
|
44
LL | but_i_cant: CantCopyThis,
@@ -7,7 +7,7 @@ LL | but_i_cant: CantCopyThis,
77
LL | impl Copy for IWantToCopyThis {}
88
| ^^^^^^^^^^^^^^^
99

10-
error[E0204]: the trait `Copy` may not be implemented for this type
10+
error[E0204]: the trait `Copy` cannot be implemented for this type
1111
--> $DIR/opt-in-copy.rs:19:15
1212
|
1313
LL | ButICant(CantCopyThisEither),

tests/ui/range/range_traits-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/range_traits-2.rs:3:10
33
|
44
LL | #[derive(Copy, Clone)]

tests/ui/range/range_traits-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/range_traits-3.rs:3:10
33
|
44
LL | #[derive(Copy, Clone)]

tests/ui/range/range_traits-6.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/range_traits-6.rs:3:10
33
|
44
LL | #[derive(Copy, Clone)]

tests/ui/span/E0204.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ struct Foo {
22
foo: Vec<u32>,
33
}
44

5-
impl Copy for Foo { } //~ ERROR may not be implemented for this type
5+
impl Copy for Foo { } //~ ERROR cannot be implemented for this type
66

7-
#[derive(Copy)] //~ ERROR may not be implemented for this type
7+
#[derive(Copy)] //~ ERROR cannot be implemented for this type
88
struct Foo2<'a> {
99
ty: &'a mut bool,
1010
}
@@ -14,9 +14,9 @@ enum EFoo {
1414
Baz,
1515
}
1616

17-
impl Copy for EFoo { } //~ ERROR may not be implemented for this type
17+
impl Copy for EFoo { } //~ ERROR cannot be implemented for this type
1818

19-
#[derive(Copy)] //~ ERROR may not be implemented for this type
19+
#[derive(Copy)] //~ ERROR cannot be implemented for this type
2020
enum EFoo2<'a> {
2121
Bar(&'a mut bool),
2222
Baz,

tests/ui/span/E0204.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/E0204.rs:5:15
33
|
44
LL | foo: Vec<u32>,
@@ -7,7 +7,7 @@ LL | foo: Vec<u32>,
77
LL | impl Copy for Foo { }
88
| ^^^
99

10-
error[E0204]: the trait `Copy` may not be implemented for this type
10+
error[E0204]: the trait `Copy` cannot be implemented for this type
1111
--> $DIR/E0204.rs:7:10
1212
|
1313
LL | #[derive(Copy)]
@@ -18,7 +18,7 @@ LL | ty: &'a mut bool,
1818
|
1919
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
2020

21-
error[E0204]: the trait `Copy` may not be implemented for this type
21+
error[E0204]: the trait `Copy` cannot be implemented for this type
2222
--> $DIR/E0204.rs:17:15
2323
|
2424
LL | Bar { x: Vec<u32> },
@@ -27,7 +27,7 @@ LL | Bar { x: Vec<u32> },
2727
LL | impl Copy for EFoo { }
2828
| ^^^^
2929

30-
error[E0204]: the trait `Copy` may not be implemented for this type
30+
error[E0204]: the trait `Copy` cannot be implemented for this type
3131
--> $DIR/E0204.rs:19:10
3232
|
3333
LL | #[derive(Copy)]

tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
77
pub y: T
88
}
99

10-
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
10+
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
1111
pub struct AABB<K: Copy + Debug>{
1212
pub loc: Vector2<K>,
1313
pub size: Vector2<K>

tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
77
pub y: T
88
}
99

10-
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
10+
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
1111
pub struct AABB<K: Copy>{
1212
pub loc: Vector2<K>,
1313
pub size: Vector2<K>

tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/missing-bound-in-derive-copy-impl-3.rs:10:17
33
|
44
LL | #[derive(Debug, Copy, Clone)]

tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
66
pub y: T
77
}
88

9-
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
9+
#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
1010
pub struct AABB<K>{
1111
pub loc: Vector2<K>,
1212
pub size: Vector2<K>

tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/missing-bound-in-derive-copy-impl.rs:9:17
33
|
44
LL | #[derive(Debug, Copy, Clone)]

tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
1414
impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
1515

1616
impl<S: std::fmt::Display> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
17-
//~^ ERROR the trait `Copy` may not be implemented for this type
17+
//~^ ERROR the trait `Copy` cannot be implemented for this type
1818

1919
fn main() {}

tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
1414
impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
1515

1616
impl<S> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
17-
//~^ ERROR the trait `Copy` may not be implemented for this type
17+
//~^ ERROR the trait `Copy` cannot be implemented for this type
1818

1919
fn main() {}

tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/missing-bound-in-manual-copy-impl-2.rs:16:18
33
|
44
LL | struct Wrapper<T>(T);

tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
struct Wrapper<T>(T);
55

66
impl<S: Copy> Copy for Wrapper<S> {}
7-
//~^ ERROR the trait `Copy` may not be implemented for this type
7+
//~^ ERROR the trait `Copy` cannot be implemented for this type
88

99
fn main() {}

tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
struct Wrapper<T>(T);
55

66
impl<S> Copy for Wrapper<S> {}
7-
//~^ ERROR the trait `Copy` may not be implemented for this type
7+
//~^ ERROR the trait `Copy` cannot be implemented for this type
88

99
fn main() {}

tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/missing-bound-in-manual-copy-impl.rs:6:18
33
|
44
LL | struct Wrapper<T>(T);

tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0204]: the trait `Copy` may not be implemented for this type
1+
error[E0204]: the trait `Copy` cannot be implemented for this type
22
--> $DIR/copy-is-not-modulo-regions.rs:13:21
33
|
44
LL | struct Bar<'lt>(Foo<'lt>);

tests/ui/traits/copy-is-not-modulo-regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct Bar<'lt>(Foo<'lt>);
1111

1212
#[cfg(not_static)]
1313
impl<'any> Copy for Bar<'any> {}
14-
//[not_static]~^ the trait `Copy` may not be implemented for this type
14+
//[not_static]~^ the trait `Copy` cannot be implemented for this type
1515

1616
#[cfg(yes_static)]
1717
impl<'any> Copy for Bar<'static> {}

tests/ui/traits/issue-50480.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#[derive(Clone, Copy)]
2-
//~^ ERROR the trait `Copy` may not be implemented for this type
2+
//~^ ERROR the trait `Copy` cannot be implemented for this type
33
struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
44
//~^ ERROR cannot find type `NotDefined` in this scope
55
//~| ERROR cannot find type `NotDefined` in this scope
66
//~| ERROR cannot find type `N` in this scope
77
//~| ERROR cannot find type `N` in this scope
88

99
#[derive(Clone, Copy)]
10-
//~^ ERROR the trait `Copy` may not be implemented for this type
10+
//~^ ERROR the trait `Copy` cannot be implemented for this type
1111
struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
1212
//~^ ERROR cannot find type `NotDefined` in this scope
1313
//~| ERROR cannot find type `N` in this scope

tests/ui/traits/issue-50480.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ error[E0412]: cannot find type `NotDefined` in this scope
6060
LL | struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
6161
| ^^^^^^^^^^ not found in this scope
6262

63-
error[E0204]: the trait `Copy` may not be implemented for this type
63+
error[E0204]: the trait `Copy` cannot be implemented for this type
6464
--> $DIR/issue-50480.rs:1:17
6565
|
6666
LL | #[derive(Clone, Copy)]
@@ -73,7 +73,7 @@ LL | struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
7373
|
7474
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
7575

76-
error[E0204]: the trait `Copy` may not be implemented for this type
76+
error[E0204]: the trait `Copy` cannot be implemented for this type
7777
--> $DIR/issue-50480.rs:9:17
7878
|
7979
LL | #[derive(Clone, Copy)]

0 commit comments

Comments
 (0)