Add a pretty printing test involving a never pattern.
This currently prints badly, with unclosed indentation.
This commit is contained in:
parent
b8c54d6358
commit
9f497008b0
2 changed files with 34 additions and 0 deletions
18
tests/pretty/never-pattern.pp
Normal file
18
tests/pretty/never-pattern.pp
Normal 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() {}
|
||||
16
tests/pretty/never-pattern.rs
Normal file
16
tests/pretty/never-pattern.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue