Add a pretty printing test involving a never pattern.

This currently prints badly, with unclosed indentation.
This commit is contained in:
Nicholas Nethercote 2025-04-24 19:15:18 +10:00
parent b8c54d6358
commit 9f497008b0
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#![feature(prelude_import)]
#![no_std]
//@ pretty-mode:expanded
//@ pp-exact:never-pattern.pp
//@ only-x86_64
#![allow(incomplete_features)]
#![feature(never_patterns)]
#![feature(never_type)]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
fn f(x: Result<u32, !>) {
_ = match x { Ok(x) => x, Err(!) , }; }
fn main() {}

View file

@ -0,0 +1,16 @@
//@ pretty-mode:expanded
//@ pp-exact:never-pattern.pp
//@ only-x86_64
#![allow(incomplete_features)]
#![feature(never_patterns)]
#![feature(never_type)]
fn f(x: Result<u32, !>) {
_ = match x {
Ok(x) => x,
Err(!),
};
}
fn main() {}