minor test improvements

This commit is contained in:
Waffle Lapkin 2025-11-13 23:24:32 +01:00
parent 7d33e7e091
commit 3f606fac00
No known key found for this signature in database
9 changed files with 11 additions and 11 deletions

View file

@ -3,7 +3,7 @@
//@ check-pass
#![feature(never_type)]
#![allow(unreachable_code)]
#![expect(unreachable_code)]
fn foo(x: !) -> ! {
x

View file

@ -3,7 +3,7 @@
//
//@ check-fail
#![feature(exhaustive_patterns, never_type)]
#![feature(never_type)]
mod inner {
pub struct Wrapper<T>(T);

View file

@ -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)]

View file

@ -0,0 +1,2 @@
! is !
None is none

View file

@ -3,7 +3,7 @@
//@ check-pass
#![feature(never_type)]
#![allow(dropping_copy_types)]
#![expect(dropping_copy_types)]
#![warn(unused)]
fn main() {

View file

@ -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

View file

@ -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`

View file

@ -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);

View file

@ -2,8 +2,8 @@
#![feature(never_type)]
#![allow(dead_code)]
#![allow(unreachable_code)]
#![allow(unused_variables)]
#![expect(unreachable_code)]
#![expect(unused_variables)]
struct Foo;