Skip to content

Commit ae96584

Browse files
committed
Update tests
1 parent cd2f5eb commit ae96584

11 files changed

Lines changed: 14 additions & 34 deletions

tests/ui/const-generics/associated-const-bindings/ambiguity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// We used to say "ambiguous associated type" on ambiguous associated consts.
22
// Ensure that we now use the correct label.
33

4-
#![feature(min_generic_const_args, unsized_const_params)]
4+
#![feature(adt_const_params, min_generic_const_args, unsized_const_params)]
55
#![allow(incomplete_features)]
66

77
trait Trait0: Parent0<i32> + Parent0<u32> {}

tests/ui/const-generics/associated-const-bindings/ambiguity.stderr

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
error: `unsized_const_params` requires `adt_const_params` to be enabled
2-
--> $DIR/ambiguity.rs:4:36
3-
|
4-
LL | #![feature(min_generic_const_args, unsized_const_params)]
5-
| ^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: enable all of these features
8-
91
error[E0222]: ambiguous associated constant `K` in bounds of `Trait0`
102
--> $DIR/ambiguity.rs:13:25
113
|
@@ -42,6 +34,6 @@ LL | fn take1(_: impl Trait1<C = "?">) {}
4234
T: Parent2::C = "?",
4335
T: Parent1::C = "?"
4436

45-
error: aborting due to 3 previous errors
37+
error: aborting due to 2 previous errors
4638

4739
For more information about this error, try `rustc --explain E0222`.

tests/ui/const-generics/associated-const-bindings/coexisting-with-type-binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
//@ check-pass
77

8-
#![feature(min_generic_const_args, unsized_const_params)]
8+
#![feature(adt_const_params, min_generic_const_args, unsized_const_params)]
99
#![allow(incomplete_features)]
1010

1111
trait Trait: SuperTrait {

tests/ui/const-generics/associated-const-bindings/dyn-compat-assoc-const-ty-mentions-self.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
//@ dont-require-annotations: NOTE
55

6+
#![feature(adt_const_params)]
67
#![feature(generic_const_items)]
78
#![feature(generic_const_parameter_types)]
89
#![feature(min_generic_const_args)]

tests/ui/const-generics/associated-const-bindings/dyn-compat-assoc-const-ty-mentions-self.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0038]: the trait `Trait` is not dyn compatible
2-
--> $DIR/dyn-compat-assoc-const-ty-mentions-self.rs:37:16
2+
--> $DIR/dyn-compat-assoc-const-ty-mentions-self.rs:38:16
33
|
44
LL | let _: dyn Trait;
55
| ^^^^^ `Trait` is not dyn compatible
66
|
77
note: for a trait to be dyn compatible it needs to allow building a vtable
88
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
9-
--> $DIR/dyn-compat-assoc-const-ty-mentions-self.rs:17:11
9+
--> $DIR/dyn-compat-assoc-const-ty-mentions-self.rs:18:11
1010
|
1111
LL | trait Trait {
1212
| ----- this trait is not dyn compatible...

tests/ui/const-generics/associated-const-bindings/dyn-compat-self-const-projections-in-assoc-const-ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// to the rest of the compiler and by extension the user via diagnostics.
55
//@ known-bug: unknown
66

7-
#![feature(min_generic_const_args, unsized_const_params, generic_const_parameter_types)]
7+
#![feature(adt_const_params, min_generic_const_args, unsized_const_params, generic_const_parameter_types)]
88
#![expect(incomplete_features)]
99

1010
trait A {

tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Detect and reject escaping late-bound generic params in
22
// the type of assoc consts used in an equality bound.
33
#![feature(
4+
adt_const_params,
45
min_generic_const_args,
56
unsized_const_params,
67
generic_const_parameter_types,
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
error: `unsized_const_params` requires `adt_const_params` to be enabled
2-
--> $DIR/esc-bound-var-in-ty.rs:5:5
3-
|
4-
LL | unsized_const_params,
5-
| ^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: enable all of these features
8-
91
error: the type of the associated constant `K` cannot capture late-bound generic parameters
10-
--> $DIR/esc-bound-var-in-ty.rs:15:35
2+
--> $DIR/esc-bound-var-in-ty.rs:16:35
113
|
124
LL | fn take(_: impl for<'r> Trait<'r, K = const { &() }>) {}
135
| -- ^ its type cannot capture the late-bound lifetime parameter `'r`
@@ -16,5 +8,5 @@ LL | fn take(_: impl for<'r> Trait<'r, K = const { &() }>) {}
168
|
179
= note: `K` has type `&'r ()`
1810

19-
error: aborting due to 2 previous errors
11+
error: aborting due to 1 previous error
2012

tests/ui/const-generics/mgca/size-of-generic-ptr-in-array-len.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ error: generic parameters may not be used in const operations
99
|
1010
LL | [0; const { size_of::<*mut T>() }];
1111
| ^
12+
|
13+
= help: add `#![feature(opaque_generic_const_args)]` to allow generic expressions as the RHS of const items
1214

1315
error: aborting due to 2 previous errors
1416

tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ICE: assertion failed: !value.has_infer()
22
// issue: rust-lang/rust#115806
3-
#![feature(min_generic_const_args, unsized_const_params)]
3+
#![feature(adt_const_params, min_generic_const_args, unsized_const_params)]
44
#![allow(incomplete_features)]
55

66
pub struct NoPin;

0 commit comments

Comments
 (0)