Skip to content

Commit 882e373

Browse files
committed
Attempt to fix #54505 tests for wasm
1 parent 611e5c4 commit 882e373

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/test/ui/range/issue-54505-no-std.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// error-pattern: `#[panic_handler]` function required, but not found
2-
// error-pattern: language item required, but not found: `eh_personality`
3-
42

53
// Regression test for #54505 - range borrowing suggestion had
64
// incorrect syntax (missing parentheses).
@@ -9,9 +7,14 @@
97
// (so all Ranges resolve to core::ops::Range...)
108

119
#![no_std]
10+
#![feature(lang_items)]
1211

1312
use core::ops::RangeBounds;
1413

14+
#[cfg(not(target_arch = "wasm32"))]
15+
#[lang = "eh_personality"]
16+
extern fn eh_personality() {}
17+
1518

1619
// take a reference to any built-in range
1720
fn take_range(_r: &impl RangeBounds<i8>) {}

src/test/ui/range/issue-54505-no-std.stderr

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
error: `#[panic_handler]` function required, but not found
22

3-
error: language item required, but not found: `eh_personality`
4-
53
error[E0308]: mismatched types
6-
--> $DIR/issue-54505-no-std.rs:21:16
4+
--> $DIR/issue-54505-no-std.rs:24:16
75
|
86
LL | take_range(0..1);
97
| ^^^^
@@ -15,7 +13,7 @@ LL | take_range(0..1);
1513
found type `core::ops::Range<{integer}>`
1614

1715
error[E0308]: mismatched types
18-
--> $DIR/issue-54505-no-std.rs:26:16
16+
--> $DIR/issue-54505-no-std.rs:29:16
1917
|
2018
LL | take_range(1..);
2119
| ^^^
@@ -27,7 +25,7 @@ LL | take_range(1..);
2725
found type `core::ops::RangeFrom<{integer}>`
2826

2927
error[E0308]: mismatched types
30-
--> $DIR/issue-54505-no-std.rs:31:16
28+
--> $DIR/issue-54505-no-std.rs:34:16
3129
|
3230
LL | take_range(..);
3331
| ^^
@@ -39,7 +37,7 @@ LL | take_range(..);
3937
found type `core::ops::RangeFull`
4038

4139
error[E0308]: mismatched types
42-
--> $DIR/issue-54505-no-std.rs:36:16
40+
--> $DIR/issue-54505-no-std.rs:39:16
4341
|
4442
LL | take_range(0..=1);
4543
| ^^^^^
@@ -51,7 +49,7 @@ LL | take_range(0..=1);
5149
found type `core::ops::RangeInclusive<{integer}>`
5250

5351
error[E0308]: mismatched types
54-
--> $DIR/issue-54505-no-std.rs:41:16
52+
--> $DIR/issue-54505-no-std.rs:44:16
5553
|
5654
LL | take_range(..5);
5755
| ^^^
@@ -63,7 +61,7 @@ LL | take_range(..5);
6361
found type `core::ops::RangeTo<{integer}>`
6462

6563
error[E0308]: mismatched types
66-
--> $DIR/issue-54505-no-std.rs:46:16
64+
--> $DIR/issue-54505-no-std.rs:49:16
6765
|
6866
LL | take_range(..=42);
6967
| ^^^^^
@@ -74,6 +72,6 @@ LL | take_range(..=42);
7472
= note: expected type `&_`
7573
found type `core::ops::RangeToInclusive<{integer}>`
7674

77-
error: aborting due to 8 previous errors
75+
error: aborting due to 7 previous errors
7876

7977
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)