mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add a pretty printing test involving a never pattern.
This currently prints badly, with unclosed indentation.
This commit is contained in:
@@ -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() {}
|
||||
@@ -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() {}
|
||||
Reference in New Issue
Block a user