From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/range/issue-54505-no-std.rs | 6 +++-- src/test/ui/range/issue-54505-no-std.stderr | 38 ++++++++++++++++++----------- 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'src/test/ui/range') 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) {} 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) {} | ^^^^^^^^^^ ------------------------- 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) {} | ^^^^^^^^^^ ------------------------- 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) {} | ^^^^^^^^^^ ------------------------- 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) {} | ^^^^^^^^^^ ------------------------- 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) {} | ^^^^^^^^^^ ------------------------- 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) {} | ^^^^^^^^^^ ------------------------- -error: aborting due to 7 previous errors +error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0308`. -- cgit v1.2.3