Skip to content

Commit 8ca1c9e

Browse files
committed
Rename tests for const tuple properly
1 parent 9e0a27c commit 8ca1c9e

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2506,7 +2506,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
25062506
};
25072507

25082508
let ty::Tuple(tys) = ty.kind() else {
2509-
let e = tcx.dcx().span_err(span, format!("expected {}, found const tuple", ty));
2509+
let e = tcx.dcx().span_err(span, format!("expected `{}`, found const tuple", ty));
25102510
return Const::new_error(tcx, e);
25112511
};
25122512

tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.rs renamed to tests/ui/const-generics/mgca/tuple_expr_arg_complex.rs

File renamed without changes.

tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.stderr renamed to tests/ui/const-generics/mgca/tuple_expr_arg_complex.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: complex const arguments must be placed inside of a `const` block
2-
--> $DIR/adt_expr_arg_tuple_expr_complex.rs:13:25
2+
--> $DIR/tuple_expr_arg_complex.rs:13:25
33
|
44
LL | takes_tuple::<{ (N, N + 1) }>();
55
| ^^^^^
66

77
error: complex const arguments must be placed inside of a `const` block
8-
--> $DIR/adt_expr_arg_tuple_expr_complex.rs:14:25
8+
--> $DIR/tuple_expr_arg_complex.rs:14:25
99
|
1010
LL | takes_tuple::<{ (N, T::ASSOC + 1) }>();
1111
| ^^^^^^^^^^^^
1212

1313
error: complex const arguments must be placed inside of a `const` block
14-
--> $DIR/adt_expr_arg_tuple_expr_complex.rs:16:36
14+
--> $DIR/tuple_expr_arg_complex.rs:16:36
1515
|
1616
LL | takes_nested_tuple::<{ (N, (N, N + 1)) }>();
1717
| ^^^^^
1818

1919
error: generic parameters may not be used in const operations
20-
--> $DIR/adt_expr_arg_tuple_expr_complex.rs:17:44
20+
--> $DIR/tuple_expr_arg_complex.rs:17:44
2121
|
2222
LL | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>();
2323
| ^

tests/ui/const-generics/mgca/tuple_expr_arg_mismatch_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![expect(incomplete_features)]
33

44
pub fn takes_nested_tuple<const N: u32>() {
5-
takes_nested_tuple::<{ () }> //~ ERROR expected u32, found const tuple
5+
takes_nested_tuple::<{ () }> //~ ERROR expected `u32`, found const tuple
66
}
77

88
fn main() {}

tests/ui/const-generics/mgca/tuple_expr_arg_mismatch_type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: expected u32, found const tuple
1+
error: expected `u32`, found const tuple
22
--> $DIR/tuple_expr_arg_mismatch_type.rs:5:28
33
|
44
LL | takes_nested_tuple::<{ () }>

tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_simple.rs renamed to tests/ui/const-generics/mgca/tuple_expr_arg_simple.rs

File renamed without changes.

0 commit comments

Comments
 (0)