Attempt to fix #54505 tests for wasm

This commit is contained in:
Paweł Romanowski 2018-10-08 18:39:09 +02:00
parent 611e5c4751
commit 882e373275
2 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,4 @@
// error-pattern: `#[panic_handler]` function required, but not found
// error-pattern: language item required, but not found: `eh_personality`
// Regression test for #54505 - range borrowing suggestion had
// incorrect syntax (missing parentheses).
@ -9,9 +7,14 @@
// (so all Ranges resolve to core::ops::Range...)
#![no_std]
#![feature(lang_items)]
use core::ops::RangeBounds;
#[cfg(not(target_arch = "wasm32"))]
#[lang = "eh_personality"]
extern fn eh_personality() {}
// take a reference to any built-in range
fn take_range(_r: &impl RangeBounds<i8>) {}

View File

@ -1,9 +1,7 @@
error: `#[panic_handler]` function required, but not found
error: language item required, but not found: `eh_personality`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:21:16
--> $DIR/issue-54505-no-std.rs:24:16
|
LL | take_range(0..1);
| ^^^^
@ -15,7 +13,7 @@ LL | take_range(0..1);
found type `core::ops::Range<{integer}>`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:26:16
--> $DIR/issue-54505-no-std.rs:29:16
|
LL | take_range(1..);
| ^^^
@ -27,7 +25,7 @@ LL | take_range(1..);
found type `core::ops::RangeFrom<{integer}>`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:31:16
--> $DIR/issue-54505-no-std.rs:34:16
|
LL | take_range(..);
| ^^
@ -39,7 +37,7 @@ LL | take_range(..);
found type `core::ops::RangeFull`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:36:16
--> $DIR/issue-54505-no-std.rs:39:16
|
LL | take_range(0..=1);
| ^^^^^
@ -51,7 +49,7 @@ LL | take_range(0..=1);
found type `core::ops::RangeInclusive<{integer}>`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:41:16
--> $DIR/issue-54505-no-std.rs:44:16
|
LL | take_range(..5);
| ^^^
@ -63,7 +61,7 @@ LL | take_range(..5);
found type `core::ops::RangeTo<{integer}>`
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:46:16
--> $DIR/issue-54505-no-std.rs:49:16
|
LL | take_range(..=42);
| ^^^^^
@ -74,6 +72,6 @@ LL | take_range(..=42);
= note: expected type `&_`
found type `core::ops::RangeToInclusive<{integer}>`
error: aborting due to 8 previous errors
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.