Skip to content

Commit 55aba32

Browse files
committed
Update existing UI tests
1 parent 6636916 commit 55aba32

7 files changed

+69
-38
lines changed

Diff for: tests/ui/object-safety/assoc_const_bounds.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
#![feature(generic_const_items)]
2+
#![allow(incomplete_features, dead_code)]
3+
4+
// check-pass
5+
16
trait Foo<T> {
27
const BAR: bool
3-
where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
4-
Self: Sized;
8+
where
9+
Self: Sized;
510
}
611

712
trait Cake {}

Diff for: tests/ui/object-safety/assoc_const_bounds.stderr

-15
This file was deleted.

Diff for: tests/ui/object-safety/assoc_const_bounds_sized.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
#![feature(generic_const_items)]
2+
#![allow(incomplete_features, dead_code)]
3+
4+
// check-pass
5+
16
trait Foo {
27
const BAR: bool
3-
where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
4-
Self: Sized;
8+
where
9+
Self: Sized;
510
}
611

712
fn foo(_: &dyn Foo) {}

Diff for: tests/ui/object-safety/assoc_const_bounds_sized.stderr

-15
This file was deleted.

Diff for: tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr renamed to tests/ui/suggestions/missing-lifetime-in-assoc-const-type.default.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0106]: missing lifetime specifier
2-
--> $DIR/missing-lifetime-in-assoc-const-type.rs:2:14
2+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14
33
|
44
LL | const A: &str = "";
55
| ^ expected named lifetime parameter
@@ -11,7 +11,7 @@ LL ~ const A: &'a str = "";
1111
|
1212

1313
error[E0106]: missing lifetime specifier
14-
--> $DIR/missing-lifetime-in-assoc-const-type.rs:3:14
14+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14
1515
|
1616
LL | const B: S = S { s: &() };
1717
| ^ expected named lifetime parameter
@@ -24,7 +24,7 @@ LL ~ const B: S<'a> = S { s: &() };
2424
|
2525

2626
error[E0106]: missing lifetime specifier
27-
--> $DIR/missing-lifetime-in-assoc-const-type.rs:4:15
27+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15
2828
|
2929
LL | const C: &'_ str = "";
3030
| ^^ expected named lifetime parameter
@@ -38,7 +38,7 @@ LL ~ const C: &'a str = "";
3838
|
3939

4040
error[E0106]: missing lifetime specifiers
41-
--> $DIR/missing-lifetime-in-assoc-const-type.rs:5:14
41+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14
4242
|
4343
LL | const D: T = T { a: &(), b: &() };
4444
| ^ expected 2 lifetime parameters
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
error[E0106]: missing lifetime specifier
2+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14
3+
|
4+
LL | const A: &str = "";
5+
| ^ expected named lifetime parameter
6+
|
7+
help: consider introducing a named lifetime parameter
8+
|
9+
LL | const A<'a>: &'a str = "";
10+
| ++++ ++
11+
12+
error[E0106]: missing lifetime specifier
13+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14
14+
|
15+
LL | const B: S = S { s: &() };
16+
| ^ expected named lifetime parameter
17+
|
18+
help: consider introducing a named lifetime parameter
19+
|
20+
LL | const B<'a>: S<'a> = S { s: &() };
21+
| ++++ ++++
22+
23+
error[E0106]: missing lifetime specifier
24+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15
25+
|
26+
LL | const C: &'_ str = "";
27+
| ^^ expected named lifetime parameter
28+
|
29+
help: consider introducing a named lifetime parameter
30+
|
31+
LL | const C<'a>: &'a str = "";
32+
| ++++ ~~
33+
34+
error[E0106]: missing lifetime specifiers
35+
--> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14
36+
|
37+
LL | const D: T = T { a: &(), b: &() };
38+
| ^ expected 2 lifetime parameters
39+
|
40+
help: consider introducing a named lifetime parameter
41+
|
42+
LL | const D<'a>: T<'a, 'a> = T { a: &(), b: &() };
43+
| ++++ ++++++++
44+
45+
error: aborting due to 4 previous errors
46+
47+
For more information about this error, try `rustc --explain E0106`.

Diff for: tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: default generic_const_items
2+
3+
#![cfg_attr(generic_const_items, feature(generic_const_items), allow(incomplete_features))]
4+
15
trait ZstAssert: Sized {
26
const A: &str = ""; //~ ERROR missing lifetime specifier
37
const B: S = S { s: &() }; //~ ERROR missing lifetime specifier

0 commit comments

Comments
 (0)