Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove
#![feature(never_type)]
from tests."
This reverts commit 8f6197f.
- Loading branch information
1 parent
ca81548
commit 1719337
Showing
90 changed files
with
268 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
pub enum Void {} | ||
|
||
#[no_mangle] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
// check-pass | ||
|
||
#![feature(never_type)] | ||
|
||
pub fn main() { | ||
loop { | ||
match None { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
fn foo(x: usize, y: !, z: usize) { } | ||
|
||
fn cast_a() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
fn foo(x: usize, y: !, z: usize) { } | ||
|
||
fn call_foo_a() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
enum Helper<T, U> { | ||
T(T, [!; 0]), | ||
#[allow(dead_code)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
fn foo() -> Result<u32, !> { | ||
Ok(123) | ||
} | ||
|
2 changes: 1 addition & 1 deletion
2
src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Test that ! errors when used in illegal positions with feature(never_type) disabled | ||
|
||
trait Foo { | ||
type Wub; | ||
} | ||
|
||
type Ma = (u32, !, i32); //~ ERROR type is experimental | ||
type Meeshka = Vec<!>; //~ ERROR type is experimental | ||
type Mow = &'static fn(!) -> !; //~ ERROR type is experimental | ||
type Skwoz = &'static mut !; //~ ERROR type is experimental | ||
|
||
impl Foo for Meeshka { | ||
type Wub = !; //~ ERROR type is experimental | ||
} | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
error[E0658]: The `!` type is experimental | ||
--> $DIR/feature-gate-never_type.rs:7:17 | ||
| | ||
LL | type Ma = (u32, !, i32); | ||
| ^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/35121 | ||
= help: add `#![feature(never_type)]` to the crate attributes to enable | ||
|
||
error[E0658]: The `!` type is experimental | ||
--> $DIR/feature-gate-never_type.rs:8:20 | ||
| | ||
LL | type Meeshka = Vec<!>; | ||
| ^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/35121 | ||
= help: add `#![feature(never_type)]` to the crate attributes to enable | ||
|
||
error[E0658]: The `!` type is experimental | ||
--> $DIR/feature-gate-never_type.rs:9:24 | ||
| | ||
LL | type Mow = &'static fn(!) -> !; | ||
| ^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/35121 | ||
= help: add `#![feature(never_type)]` to the crate attributes to enable | ||
|
||
error[E0658]: The `!` type is experimental | ||
--> $DIR/feature-gate-never_type.rs:10:27 | ||
| | ||
LL | type Skwoz = &'static mut !; | ||
| ^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/35121 | ||
= help: add `#![feature(never_type)]` to the crate attributes to enable | ||
|
||
error[E0658]: The `!` type is experimental | ||
--> $DIR/feature-gate-never_type.rs:13:16 | ||
| | ||
LL | type Wub = !; | ||
| ^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/35121 | ||
= help: add `#![feature(never_type)]` to the crate attributes to enable | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// run-pass | ||
|
||
#![allow(unreachable_code)] | ||
#![feature(never_type)] | ||
|
||
#[allow(unused)] | ||
fn never_returns() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![feature(never_type)] | ||
#![deny(unused_must_use)] | ||
|
||
#[must_use] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(never_type)] | ||
|
||
fn main() { | ||
let val: ! = loop { break break; }; | ||
//~^ ERROR mismatched types | ||
|
Oops, something went wrong.