minor test improvements
This commit is contained in:
parent
7d33e7e091
commit
3f606fac00
9 changed files with 11 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(unreachable_code)]
|
||||
#![expect(unreachable_code)]
|
||||
|
||||
fn foo(x: !) -> ! {
|
||||
x
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
//
|
||||
//@ check-fail
|
||||
|
||||
#![feature(exhaustive_patterns, never_type)]
|
||||
#![feature(never_type)]
|
||||
|
||||
mod inner {
|
||||
pub struct Wrapper<T>(T);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that we can call static methods on ! both directly and when it appears in a generic
|
||||
//
|
||||
//@ run-pass
|
||||
//@ check-run-results
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
|
|
|
|||
2
tests/ui/never_type/impl-for-never.run.stdout
Normal file
2
tests/ui/never_type/impl-for-never.run.stdout
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
! is !
|
||||
None is none
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(dropping_copy_types)]
|
||||
#![expect(dropping_copy_types)]
|
||||
#![warn(unused)]
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Test that we can't use another type in place of !
|
||||
|
||||
#![feature(never_type)]
|
||||
#![deny(warnings)]
|
||||
|
||||
fn main() {
|
||||
let x: ! = "hello"; //~ ERROR mismatched types
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/never-assign-wrong-type.rs:7:16
|
||||
--> $DIR/never-assign-wrong-type.rs:6:16
|
||||
|
|
||||
LL | let x: ! = "hello";
|
||||
| - ^^^^^^^ expected `!`, found `&str`
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@
|
|||
//
|
||||
//@ run-pass
|
||||
|
||||
#![allow(unused_variables)]
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(unreachable_patterns)]
|
||||
// Test that we can extract a ! through pattern matching then use it as several different types.
|
||||
#![feature(never_type)]
|
||||
#![expect(unused_variables)]
|
||||
#![expect(unreachable_code)]
|
||||
|
||||
fn main() {
|
||||
let x: Result<u32, !> = Ok(123);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#![feature(never_type)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(unused_variables)]
|
||||
#![expect(unreachable_code)]
|
||||
#![expect(unused_variables)]
|
||||
|
||||
struct Foo;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue