Skip to content

Commit 06e4c91

Browse files
committed
reviews
1 parent 5a4d526 commit 06e4c91

9 files changed

+26
-26
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
547547
{
548548
diag.span_note(
549549
constraint.span,
550-
format!("raw pointer casts of trait objects do not cast away lifetimes"),
550+
format!("raw pointer casts of trait objects cannot extend lifetimes"),
551551
);
552552
diag.note(format!(
553553
"this was previously accepted by the compiler but was changed recently"

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
15551555

15561556
debug!(?src_tty, ?dst_tty, ?src_obj, ?dst_obj);
15571557

1558-
// Trait parameters are Invariant, the only part that actually has
1558+
// Trait parameters are invariant, the only part that actually has
15591559
// subtyping here is the lifetime bound of the dyn-type.
15601560
//
15611561
// For example in `dyn Trait<'a> + 'b <: dyn Trait<'c> + 'd` we would

tests/ui/cast/ptr-to-ptr-different-regions.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | ptr as _
99
= note: requirement occurs because of a mutable pointer to `dyn Trait`
1010
= note: mutable pointers are invariant over their type parameter
1111
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
12-
note: raw pointer casts of trait objects do not cast away lifetimes
12+
note: raw pointer casts of trait objects cannot extend lifetimes
1313
--> $DIR/ptr-to-ptr-different-regions.rs:17:5
1414
|
1515
LL | ptr as _

tests/ui/cast/ptr-to-ptr-indirect-different-regions.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | a as _
99
= note: requirement occurs because of a mutable pointer to `MyWrap<dyn Trait>`
1010
= note: mutable pointers are invariant over their type parameter
1111
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
12-
note: raw pointer casts of trait objects do not cast away lifetimes
12+
note: raw pointer casts of trait objects cannot extend lifetimes
1313
--> $DIR/ptr-to-ptr-indirect-different-regions.rs:8:5
1414
|
1515
LL | a as _

tests/ui/cast/ptr-to-ptr-principalless.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LL | x as _
2828
= note: requirement occurs because of a mutable pointer to `dyn Send`
2929
= note: mutable pointers are invariant over their type parameter
3030
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
31-
note: raw pointer casts of trait objects do not cast away lifetimes
31+
note: raw pointer casts of trait objects cannot extend lifetimes
3232
--> $DIR/ptr-to-ptr-principalless.rs:8:5
3333
|
3434
LL | x as _
@@ -47,7 +47,7 @@ LL | x as _
4747
= note: requirement occurs because of a mutable pointer to `dyn Send`
4848
= note: mutable pointers are invariant over their type parameter
4949
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
50-
note: raw pointer casts of trait objects do not cast away lifetimes
50+
note: raw pointer casts of trait objects cannot extend lifetimes
5151
--> $DIR/ptr-to-ptr-principalless.rs:13:5
5252
|
5353
LL | x as _
@@ -79,7 +79,7 @@ LL | x as _
7979
= note: requirement occurs because of a mutable pointer to `Wrapper<dyn Send>`
8080
= note: mutable pointers are invariant over their type parameter
8181
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
82-
note: raw pointer casts of trait objects do not cast away lifetimes
82+
note: raw pointer casts of trait objects cannot extend lifetimes
8383
--> $DIR/ptr-to-ptr-principalless.rs:18:5
8484
|
8585
LL | x as _
@@ -98,7 +98,7 @@ LL | x as _
9898
= note: requirement occurs because of a mutable pointer to `Wrapper<dyn Send>`
9999
= note: mutable pointers are invariant over their type parameter
100100
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
101-
note: raw pointer casts of trait objects do not cast away lifetimes
101+
note: raw pointer casts of trait objects cannot extend lifetimes
102102
--> $DIR/ptr-to-ptr-principalless.rs:23:5
103103
|
104104
LL | x as _
@@ -130,7 +130,7 @@ LL | x as _
130130
= note: requirement occurs because of a mutable pointer to `dyn Sync`
131131
= note: mutable pointers are invariant over their type parameter
132132
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
133-
note: raw pointer casts of trait objects do not cast away lifetimes
133+
note: raw pointer casts of trait objects cannot extend lifetimes
134134
--> $DIR/ptr-to-ptr-principalless.rs:30:5
135135
|
136136
LL | x as _
@@ -149,7 +149,7 @@ LL | x as _
149149
= note: requirement occurs because of a mutable pointer to `dyn Sync`
150150
= note: mutable pointers are invariant over their type parameter
151151
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
152-
note: raw pointer casts of trait objects do not cast away lifetimes
152+
note: raw pointer casts of trait objects cannot extend lifetimes
153153
--> $DIR/ptr-to-ptr-principalless.rs:35:5
154154
|
155155
LL | x as _
@@ -181,7 +181,7 @@ LL | x as _
181181
= note: requirement occurs because of a mutable pointer to `Wrapper<dyn Sync>`
182182
= note: mutable pointers are invariant over their type parameter
183183
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
184-
note: raw pointer casts of trait objects do not cast away lifetimes
184+
note: raw pointer casts of trait objects cannot extend lifetimes
185185
--> $DIR/ptr-to-ptr-principalless.rs:40:5
186186
|
187187
LL | x as _
@@ -200,7 +200,7 @@ LL | x as _
200200
= note: requirement occurs because of a mutable pointer to `Wrapper<dyn Sync>`
201201
= note: mutable pointers are invariant over their type parameter
202202
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
203-
note: raw pointer casts of trait objects do not cast away lifetimes
203+
note: raw pointer casts of trait objects cannot extend lifetimes
204204
--> $DIR/ptr-to-ptr-principalless.rs:45:5
205205
|
206206
LL | x as _
@@ -232,7 +232,7 @@ LL | x as _
232232
= note: requirement occurs because of a mutable pointer to `dyn Send`
233233
= note: mutable pointers are invariant over their type parameter
234234
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
235-
note: raw pointer casts of trait objects do not cast away lifetimes
235+
note: raw pointer casts of trait objects cannot extend lifetimes
236236
--> $DIR/ptr-to-ptr-principalless.rs:53:5
237237
|
238238
LL | x as _
@@ -251,7 +251,7 @@ LL | x as _
251251
= note: requirement occurs because of a mutable pointer to `dyn Send`
252252
= note: mutable pointers are invariant over their type parameter
253253
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
254-
note: raw pointer casts of trait objects do not cast away lifetimes
254+
note: raw pointer casts of trait objects cannot extend lifetimes
255255
--> $DIR/ptr-to-ptr-principalless.rs:58:5
256256
|
257257
LL | x as _

tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let _send = unsend as *const S<dyn Cat<'static>>;
1010
= note: requirement occurs because of the type `S<dyn Cat<'_>>`, which makes the generic argument `dyn Cat<'_>` invariant
1111
= note: the struct `S<T>` is invariant over the parameter `T`
1212
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
13-
note: raw pointer casts of trait objects do not cast away lifetimes
13+
note: raw pointer casts of trait objects cannot extend lifetimes
1414
--> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:24:17
1515
|
1616
LL | let _send = unsend as *const S<dyn Cat<'static>>;

tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let _send = unsend as *const S<dyn Cat<'static>>;
1010
= note: requirement occurs because of the type `S<dyn Cat<'_>>`, which makes the generic argument `dyn Cat<'_>` invariant
1111
= note: the struct `S<T>` is invariant over the parameter `T`
1212
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
13-
note: raw pointer casts of trait objects do not cast away lifetimes
13+
note: raw pointer casts of trait objects cannot extend lifetimes
1414
--> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:24:17
1515
|
1616
LL | let _send = unsend as *const S<dyn Cat<'static>>;

tests/ui/cast/ptr-to-trait-obj-different-regions-lt-ext.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn bad_cast<'a>(x: *const dyn Static<'static>) -> *const dyn Static<'a> {
66
LL | x as _
77
| ^^^^^^ returning this value requires that `'a` must outlive `'static`
88
|
9-
note: raw pointer casts of trait objects do not cast away lifetimes
9+
note: raw pointer casts of trait objects cannot extend lifetimes
1010
--> $DIR/ptr-to-trait-obj-different-regions-lt-ext.rs:12:5
1111
|
1212
LL | x as _

tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | x as _
1212
= note: requirement occurs because of a mutable pointer to `dyn Trait<'_>`
1313
= note: mutable pointers are invariant over their type parameter
1414
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
15-
note: raw pointer casts of trait objects do not cast away lifetimes
15+
note: raw pointer casts of trait objects cannot extend lifetimes
1616
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:7:5
1717
|
1818
LL | x as _
@@ -34,7 +34,7 @@ LL | x as _
3434
= note: requirement occurs because of a mutable pointer to `dyn Trait<'_>`
3535
= note: mutable pointers are invariant over their type parameter
3636
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
37-
note: raw pointer casts of trait objects do not cast away lifetimes
37+
note: raw pointer casts of trait objects cannot extend lifetimes
3838
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:7:5
3939
|
4040
LL | x as _
@@ -58,7 +58,7 @@ LL | x as _
5858
= note: requirement occurs because of a mutable pointer to `dyn Trait<'_>`
5959
= note: mutable pointers are invariant over their type parameter
6060
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
61-
note: raw pointer casts of trait objects do not cast away lifetimes
61+
note: raw pointer casts of trait objects cannot extend lifetimes
6262
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:12:5
6363
|
6464
LL | x as _
@@ -80,7 +80,7 @@ LL | x as _
8080
= note: requirement occurs because of a mutable pointer to `dyn Trait<'_>`
8181
= note: mutable pointers are invariant over their type parameter
8282
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
83-
note: raw pointer casts of trait objects do not cast away lifetimes
83+
note: raw pointer casts of trait objects cannot extend lifetimes
8484
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:16:5
8585
|
8686
LL | x as _
@@ -125,7 +125,7 @@ LL | x as _
125125
= note: requirement occurs because of a mutable pointer to `dyn Assocked<Assoc = dyn Send>`
126126
= note: mutable pointers are invariant over their type parameter
127127
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
128-
note: raw pointer casts of trait objects do not cast away lifetimes
128+
note: raw pointer casts of trait objects cannot extend lifetimes
129129
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:32:5
130130
|
131131
LL | x as _
@@ -148,7 +148,7 @@ LL | x as _
148148
= note: requirement occurs because of a mutable pointer to `dyn Assocked<Assoc = dyn Send>`
149149
= note: mutable pointers are invariant over their type parameter
150150
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
151-
note: raw pointer casts of trait objects do not cast away lifetimes
151+
note: raw pointer casts of trait objects cannot extend lifetimes
152152
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:32:5
153153
|
154154
LL | x as _
@@ -175,7 +175,7 @@ LL | x as _
175175
= note: requirement occurs because of a mutable pointer to `dyn Assocked<Assoc = dyn Trait<'_>>`
176176
= note: mutable pointers are invariant over their type parameter
177177
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
178-
note: raw pointer casts of trait objects do not cast away lifetimes
178+
note: raw pointer casts of trait objects cannot extend lifetimes
179179
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:39:5
180180
|
181181
LL | x as _
@@ -198,7 +198,7 @@ LL | x as _
198198
= note: requirement occurs because of a mutable pointer to `dyn Assocked<Assoc = dyn Trait<'_>>`
199199
= note: mutable pointers are invariant over their type parameter
200200
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
201-
note: raw pointer casts of trait objects do not cast away lifetimes
201+
note: raw pointer casts of trait objects cannot extend lifetimes
202202
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:39:5
203203
|
204204
LL | x as _
@@ -225,7 +225,7 @@ LL | require_static(ptr as _)
225225
| `ptr` escapes the function body here
226226
| argument requires that `'a` must outlive `'static`
227227
|
228-
note: raw pointer casts of trait objects do not cast away lifetimes
228+
note: raw pointer casts of trait objects cannot extend lifetimes
229229
--> $DIR/ptr-to-trait-obj-different-regions-misc.rs:46:20
230230
|
231231
LL | require_static(ptr as _)

0 commit comments

Comments
 (0)