summaryrefslogtreecommitdiffstats
path: root/src/test/ui/range
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
commit5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch)
tree35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /src/test/ui/range
parentAdding debian version 1.66.0+dfsg1-1. (diff)
downloadrustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz
rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/range')
-rw-r--r--src/test/ui/range/issue-54505-no-std.rs6
-rw-r--r--src/test/ui/range/issue-54505-no-std.stderr38
2 files changed, 28 insertions, 16 deletions
diff --git a/src/test/ui/range/issue-54505-no-std.rs b/src/test/ui/range/issue-54505-no-std.rs
index ab1a025b5..9f378b483 100644
--- a/src/test/ui/range/issue-54505-no-std.rs
+++ b/src/test/ui/range/issue-54505-no-std.rs
@@ -1,5 +1,3 @@
-// error-pattern: `#[panic_handler]` function required, but not found
-
// Regression test for #54505 - range borrowing suggestion had
// incorrect syntax (missing parentheses).
@@ -18,6 +16,10 @@ extern "C" fn eh_personality() {}
#[lang = "eh_catch_typeinfo"]
static EH_CATCH_TYPEINFO: u8 = 0;
+#[panic_handler]
+fn panic_handler() {}
+//~^ ERROR return type should be `!`
+//~| ERROR function should have one argument
// take a reference to any built-in range
fn take_range(_r: &impl RangeBounds<i8>) {}
diff --git a/src/test/ui/range/issue-54505-no-std.stderr b/src/test/ui/range/issue-54505-no-std.stderr
index c4e36b0b1..9fb0e54a8 100644
--- a/src/test/ui/range/issue-54505-no-std.stderr
+++ b/src/test/ui/range/issue-54505-no-std.stderr
@@ -1,7 +1,17 @@
-error: `#[panic_handler]` function required, but not found
+error: return type should be `!`
+ --> $DIR/issue-54505-no-std.rs:20:20
+ |
+LL | fn panic_handler() {}
+ | ^
+
+error: function should have one argument
+ --> $DIR/issue-54505-no-std.rs:20:1
+ |
+LL | fn panic_handler() {}
+ | ^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:27:16
+ --> $DIR/issue-54505-no-std.rs:29:16
|
LL | take_range(0..1);
| ---------- ^^^^
@@ -13,13 +23,13 @@ LL | take_range(0..1);
= note: expected reference `&_`
found struct `Range<{integer}>`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:32:16
+ --> $DIR/issue-54505-no-std.rs:34:16
|
LL | take_range(1..);
| ---------- ^^^
@@ -31,13 +41,13 @@ LL | take_range(1..);
= note: expected reference `&_`
found struct `RangeFrom<{integer}>`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:37:16
+ --> $DIR/issue-54505-no-std.rs:39:16
|
LL | take_range(..);
| ---------- ^^
@@ -49,13 +59,13 @@ LL | take_range(..);
= note: expected reference `&_`
found struct `RangeFull`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:42:16
+ --> $DIR/issue-54505-no-std.rs:44:16
|
LL | take_range(0..=1);
| ---------- ^^^^^
@@ -67,13 +77,13 @@ LL | take_range(0..=1);
= note: expected reference `&_`
found struct `RangeInclusive<{integer}>`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:47:16
+ --> $DIR/issue-54505-no-std.rs:49:16
|
LL | take_range(..5);
| ---------- ^^^
@@ -85,13 +95,13 @@ LL | take_range(..5);
= note: expected reference `&_`
found struct `RangeTo<{integer}>`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
error[E0308]: mismatched types
- --> $DIR/issue-54505-no-std.rs:52:16
+ --> $DIR/issue-54505-no-std.rs:54:16
|
LL | take_range(..=42);
| ---------- ^^^^^
@@ -103,11 +113,11 @@ LL | take_range(..=42);
= note: expected reference `&_`
found struct `RangeToInclusive<{integer}>`
note: function defined here
- --> $DIR/issue-54505-no-std.rs:23:4
+ --> $DIR/issue-54505-no-std.rs:25:4
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
-error: aborting due to 7 previous errors
+error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0308`.