Skip to content

Commit 08525dd

Browse files
committed
test(resolve): Allow self_lifetime_elision_not_applicable in pre-existing tests
1 parent 3982f64 commit 08525dd

75 files changed

Lines changed: 212 additions & 168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/ui/async-await/inference_var_self_argument.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(self_lifetime_elision_not_applicable)]
12
//! This is a regression test for an ICE.
23
//@ edition: 2021
34

tests/ui/async-await/inference_var_self_argument.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0307]: invalid `self` parameter type: `&dyn Foo`
2-
--> $DIR/inference_var_self_argument.rs:5:24
2+
--> $DIR/inference_var_self_argument.rs:6:24
33
|
44
LL | async fn foo(self: &dyn Foo) {
55
| ^^^^^^^^
@@ -8,14 +8,14 @@ LL | async fn foo(self: &dyn Foo) {
88
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
99

1010
error[E0038]: the trait `Foo` is not dyn compatible
11-
--> $DIR/inference_var_self_argument.rs:5:33
11+
--> $DIR/inference_var_self_argument.rs:6:33
1212
|
1313
LL | async fn foo(self: &dyn Foo) {
1414
| ^ `Foo` is not dyn compatible
1515
|
1616
note: for a trait to be dyn compatible it needs to allow building a vtable
1717
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
18-
--> $DIR/inference_var_self_argument.rs:5:14
18+
--> $DIR/inference_var_self_argument.rs:6:14
1919
|
2020
LL | trait Foo {
2121
| --- this trait is not dyn compatible...

tests/ui/closures/2229_closure_analysis/issue-88476.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ edition:2021
22

33
#![feature(rustc_attrs)]
4+
#![allow(self_lifetime_elision_not_applicable)]
45

56
// Test that we can't move out of struct that impls `Drop`.
67

tests/ui/closures/2229_closure_analysis/issue-88476.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: attributes on expressions are experimental
2-
--> $DIR/issue-88476.rs:20:13
2+
--> $DIR/issue-88476.rs:21:13
33
|
44
LL | let x = #[rustc_capture_analysis] move || {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | let x = #[rustc_capture_analysis] move || {
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: attributes on expressions are experimental
12-
--> $DIR/issue-88476.rs:48:13
12+
--> $DIR/issue-88476.rs:49:13
1313
|
1414
LL | let c = #[rustc_capture_analysis] move || {
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | let c = #[rustc_capture_analysis] move || {
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error: First Pass analysis includes:
22-
--> $DIR/issue-88476.rs:20:39
22+
--> $DIR/issue-88476.rs:21:39
2323
|
2424
LL | let x = #[rustc_capture_analysis] move || {
2525
| _______________________________________^
@@ -28,13 +28,13 @@ LL | | };
2828
| |_____^
2929
|
3030
note: Capturing f[(0, 0)] -> Immutable
31-
--> $DIR/issue-88476.rs:26:26
31+
--> $DIR/issue-88476.rs:27:26
3232
|
3333
LL | println!("{:?}", f.0);
3434
| ^^^
3535

3636
error: Min Capture analysis includes:
37-
--> $DIR/issue-88476.rs:20:39
37+
--> $DIR/issue-88476.rs:21:39
3838
|
3939
LL | let x = #[rustc_capture_analysis] move || {
4040
| _______________________________________^
@@ -43,13 +43,13 @@ LL | | };
4343
| |_____^
4444
|
4545
note: Min Capture f[] -> ByValue
46-
--> $DIR/issue-88476.rs:26:26
46+
--> $DIR/issue-88476.rs:27:26
4747
|
4848
LL | println!("{:?}", f.0);
4949
| ^^^
5050

5151
error: First Pass analysis includes:
52-
--> $DIR/issue-88476.rs:48:39
52+
--> $DIR/issue-88476.rs:49:39
5353
|
5454
LL | let c = #[rustc_capture_analysis] move || {
5555
| _______________________________________^
@@ -58,13 +58,13 @@ LL | | };
5858
| |_____^
5959
|
6060
note: Capturing character[(0, 0)] -> Immutable
61-
--> $DIR/issue-88476.rs:54:24
61+
--> $DIR/issue-88476.rs:55:24
6262
|
6363
LL | println!("{}", character.hp)
6464
| ^^^^^^^^^^^^
6565

6666
error: Min Capture analysis includes:
67-
--> $DIR/issue-88476.rs:48:39
67+
--> $DIR/issue-88476.rs:49:39
6868
|
6969
LL | let c = #[rustc_capture_analysis] move || {
7070
| _______________________________________^
@@ -73,7 +73,7 @@ LL | | };
7373
| |_____^
7474
|
7575
note: Min Capture character[(0, 0)] -> ByValue
76-
--> $DIR/issue-88476.rs:54:24
76+
--> $DIR/issue-88476.rs:55:24
7777
|
7878
LL | println!("{}", character.hp)
7979
| ^^^^^^^^^^^^

tests/ui/closures/2229_closure_analysis/run_pass/issue-88476.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ check-pass
22
//@ edition:2021
33

4+
#![allow(self_lifetime_elision_not_applicable)]
5+
46
use std::rc::Rc;
57

68
// Test that we restrict precision when moving not-`Copy` types, if any of the parent paths

tests/ui/internal-lints/rustc_pass_by_value_self.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#![feature(rustc_attrs)]
88
#![deny(rustc::disallowed_pass_by_ref)]
99
#![allow(unused)]
10+
#![allow(self_lifetime_elision_not_applicable)]
1011

1112
#[rustc_pass_by_value]
1213
struct TyCtxt<'tcx> {

tests/ui/internal-lints/rustc_pass_by_value_self.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: passing `TyCtxt<'tcx>` by reference
2-
--> $DIR/rustc_pass_by_value_self.rs:18:15
2+
--> $DIR/rustc_pass_by_value_self.rs:19:15
33
|
44
LL | fn by_ref(&self) {}
55
| ^^^^^ help: try passing by value: `TyCtxt<'tcx>`
@@ -11,25 +11,25 @@ LL | #![deny(rustc::disallowed_pass_by_ref)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: passing `Ty<'tcx>` by reference
14-
--> $DIR/rustc_pass_by_value_self.rs:30:21
14+
--> $DIR/rustc_pass_by_value_self.rs:31:21
1515
|
1616
LL | fn by_ref(self: &Ty<'tcx>) {}
1717
| ^^^^^^^^^ help: try passing by value: `Ty<'tcx>`
1818

1919
error: passing `Foo` by reference
20-
--> $DIR/rustc_pass_by_value_self.rs:37:17
20+
--> $DIR/rustc_pass_by_value_self.rs:38:17
2121
|
2222
LL | fn with_ref(&self) {}
2323
| ^^^^^ help: try passing by value: `Foo`
2424

2525
error: passing `WithParameters<T, 1>` by reference
26-
--> $DIR/rustc_pass_by_value_self.rs:47:17
26+
--> $DIR/rustc_pass_by_value_self.rs:48:17
2727
|
2828
LL | fn with_ref(&self) {}
2929
| ^^^^^ help: try passing by value: `WithParameters<T, 1>`
3030

3131
error: passing `WithParameters<T, 1, u8>` by reference
32-
--> $DIR/rustc_pass_by_value_self.rs:51:17
32+
--> $DIR/rustc_pass_by_value_self.rs:52:17
3333
|
3434
LL | fn with_ref(&self) {}
3535
| ^^^^^ help: try passing by value: `WithParameters<T, 1, u8>`

tests/ui/issues/issue-17905-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(self_lifetime_elision_not_applicable)]
2+
13
#[derive(Debug)]
24
struct Pair<T, V> (T, V);
35

tests/ui/issues/issue-17905-2.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error[E0308]: mismatched `self` parameter type
2-
--> $DIR/issue-17905-2.rs:8:18
2+
--> $DIR/issue-17905-2.rs:10:18
33
|
44
LL | fn say(self: &Pair<&str, isize>) {
55
| ^^^^^^^^^^^^^^^^^^ lifetime mismatch
66
|
77
= note: expected struct `Pair<&_, _>`
88
found struct `Pair<&_, _>`
99
note: the anonymous lifetime defined here...
10-
--> $DIR/issue-17905-2.rs:8:24
10+
--> $DIR/issue-17905-2.rs:10:24
1111
|
1212
LL | fn say(self: &Pair<&str, isize>) {
1313
| ^^^^
1414
note: ...does not necessarily outlive the anonymous lifetime as defined here
15-
--> $DIR/issue-17905-2.rs:5:5
15+
--> $DIR/issue-17905-2.rs:7:5
1616
|
1717
LL | &str,
1818
| ^
1919

2020
error[E0308]: mismatched `self` parameter type
21-
--> $DIR/issue-17905-2.rs:8:18
21+
--> $DIR/issue-17905-2.rs:10:18
2222
|
2323
LL | fn say(self: &Pair<&str, isize>) {
2424
| ^^^^^^^^^^^^^^^^^^ lifetime mismatch
2525
|
2626
= note: expected struct `Pair<&_, _>`
2727
found struct `Pair<&_, _>`
2828
note: the anonymous lifetime as defined here...
29-
--> $DIR/issue-17905-2.rs:5:5
29+
--> $DIR/issue-17905-2.rs:7:5
3030
|
3131
LL | &str,
3232
| ^
3333
note: ...does not necessarily outlive the anonymous lifetime defined here
34-
--> $DIR/issue-17905-2.rs:8:24
34+
--> $DIR/issue-17905-2.rs:10:24
3535
|
3636
LL | fn say(self: &Pair<&str, isize>) {
3737
| ^^^^

tests/ui/issues/issue-21400.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ run-pass
2+
#![allow(self_lifetime_elision_not_applicable)]
23
// Regression test for #21400 which itself was extracted from
34
// stackoverflow.com/questions/28031155/is-my-borrow-checker-drunk/28031580
45

0 commit comments

Comments
 (0)