Skip to content

Commit 675fa96

Browse files
committed
Updated the error messages for TestAbiEqNonsense in both debug.generic.stderr and debug.rs.
1 parent 32c3479 commit 675fa96

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

tests/ui/abi/debug.generic.stderr

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ error: fn_abi_of(test) = FnAbi {
8989
conv: Rust,
9090
can_unwind: $SOME_BOOL,
9191
}
92-
--> $DIR/debug.rs:19:1
92+
--> $DIR/debug.rs:23:1
9393
|
9494
LL | fn test(_x: u8) -> bool { true }
9595
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -185,7 +185,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi {
185185
conv: Rust,
186186
can_unwind: $SOME_BOOL,
187187
}
188-
--> $DIR/debug.rs:22:1
188+
--> $DIR/debug.rs:26:1
189189
|
190190
LL | type TestFnPtr = fn(bool) -> u8;
191191
| ^^^^^^^^^^^^^^
@@ -263,13 +263,13 @@ error: fn_abi_of(test_generic) = FnAbi {
263263
conv: Rust,
264264
can_unwind: $SOME_BOOL,
265265
}
266-
--> $DIR/debug.rs:25:1
266+
--> $DIR/debug.rs:29:1
267267
|
268268
LL | fn test_generic<T>(_x: *const T) { }
269269
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270270

271271
error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions
272-
--> $DIR/debug.rs:28:1
272+
--> $DIR/debug.rs:32:1
273273
|
274274
LL | const C: () = ();
275275
| ^^^^^^^^^^^
@@ -419,7 +419,7 @@ error: ABIs are not compatible
419419
conv: Rust,
420420
can_unwind: $SOME_BOOL,
421421
}
422-
--> $DIR/debug.rs:44:1
422+
--> $DIR/debug.rs:48:1
423423
|
424424
LL | type TestAbiNe = (fn(u8), fn(u32));
425425
| ^^^^^^^^^^^^^^
@@ -571,7 +571,7 @@ error: ABIs are not compatible
571571
conv: Rust,
572572
can_unwind: $SOME_BOOL,
573573
}
574-
--> $DIR/debug.rs:47:1
574+
--> $DIR/debug.rs:51:1
575575
|
576576
LL | type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32]));
577577
| ^^^^^^^^^^^^^^^^^^^^
@@ -720,7 +720,7 @@ error: ABIs are not compatible
720720
conv: Rust,
721721
can_unwind: $SOME_BOOL,
722722
}
723-
--> $DIR/debug.rs:50:1
723+
--> $DIR/debug.rs:54:1
724724
|
725725
LL | type TestAbiNeFloat = (fn(f32), fn(u32));
726726
| ^^^^^^^^^^^^^^^^^^^
@@ -870,28 +870,27 @@ error: ABIs are not compatible
870870
conv: Rust,
871871
can_unwind: $SOME_BOOL,
872872
}
873-
--> $DIR/debug.rs:54:1
873+
--> $DIR/debug.rs:58:1
874874
|
875875
LL | type TestAbiNeSign = (fn(i32), fn(u32));
876876
| ^^^^^^^^^^^^^^^^^^
877877

878-
error[E0277]: the size for values of type `str` cannot be known at compilation time
879-
--> $DIR/debug.rs:57:46
878+
error[E0277]: the trait bound `str: Sized` is not satisfied
879+
--> $DIR/debug.rs:61:46
880880
|
881881
LL | type TestAbiEqNonsense = (fn((str, str)), fn((str, str)));
882-
| ^^^^^^^^^^ doesn't have a size known at compile-time
882+
| ^^^^^^^^^^ the trait `Sized` is not implemented for `str`
883883
|
884-
= help: the trait `Sized` is not implemented for `str`
885884
= note: only the last element of a tuple may have a dynamically sized type
886885

887886
error: unrecognized argument
888-
--> $DIR/debug.rs:59:13
887+
--> $DIR/debug.rs:63:13
889888
|
890889
LL | #[rustc_abi("assert_eq")]
891890
| ^^^^^^^^^^^
892891

893892
error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions
894-
--> $DIR/debug.rs:32:5
893+
--> $DIR/debug.rs:36:5
895894
|
896895
LL | const C: () = ();
897896
| ^^^^^^^^^^^
@@ -981,7 +980,7 @@ error: fn_abi_of(assoc_test) = FnAbi {
981980
conv: Rust,
982981
can_unwind: $SOME_BOOL,
983982
}
984-
--> $DIR/debug.rs:37:5
983+
--> $DIR/debug.rs:41:5
985984
|
986985
LL | fn assoc_test(&self) { }
987986
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/abi/debug.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
// This pattern is prepared for when we account for alignment in the niche.
77
//@ normalize-stderr: "(valid_range): [1-9]\.\.=(429496729[0-9]|1844674407370955161[0-9])" -> "$1: $$NON_NULL"
88
// Some attributes are only computed for release builds:
9+
//@ add-core-stubs
910
//@ compile-flags: -O
1011
//@ revisions: generic riscv64
1112
//@ [riscv64] only-riscv64
1213
//@ [generic] ignore-riscv64
13-
#![feature(rustc_attrs)]
14+
15+
#![feature(rustc_attrs,no_core)]
16+
#![no_core]
1417
#![crate_type = "lib"]
1518

19+
extern crate minicore;
1620
struct S(u16);
1721

1822
#[rustc_abi(debug)]
@@ -54,7 +58,7 @@ type TestAbiNeFloat = (fn(f32), fn(u32)); //~ ERROR: ABIs are not compatible
5458
type TestAbiNeSign = (fn(i32), fn(u32)); //~ ERROR: ABIs are not compatible
5559

5660
#[rustc_abi(assert_eq)]
57-
type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); //~ ERROR: cannot be known at compilation time
61+
type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); //~ ERROR: the trait bound `str: Sized` is not satisfied [E0277]
5862

5963
#[rustc_abi("assert_eq")] //~ ERROR unrecognized argument
6064
type Bad = u32;

0 commit comments

Comments
 (0)