Skip to content

Commit 9f49700

Browse files
committed
Add a pretty printing test involving a never pattern.
This currently prints badly, with unclosed indentation.
1 parent b8c54d6 commit 9f49700

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/pretty/never-pattern.pp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(prelude_import)]
2+
#![no_std]
3+
//@ pretty-mode:expanded
4+
//@ pp-exact:never-pattern.pp
5+
//@ only-x86_64
6+
7+
#![allow(incomplete_features)]
8+
#![feature(never_patterns)]
9+
#![feature(never_type)]
10+
#[prelude_import]
11+
use ::std::prelude::rust_2015::*;
12+
#[macro_use]
13+
extern crate std;
14+
15+
fn f(x: Result<u32, !>) {
16+
_ = match x { Ok(x) => x, Err(!) , }; }
17+
18+
fn main() {}

tests/pretty/never-pattern.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ pretty-mode:expanded
2+
//@ pp-exact:never-pattern.pp
3+
//@ only-x86_64
4+
5+
#![allow(incomplete_features)]
6+
#![feature(never_patterns)]
7+
#![feature(never_type)]
8+
9+
fn f(x: Result<u32, !>) {
10+
_ = match x {
11+
Ok(x) => x,
12+
Err(!),
13+
};
14+
}
15+
16+
fn main() {}

0 commit comments

Comments
 (0)