Rollup merge of #140246 - nnethercote:fix-never-pattern-printing, r=Nadrieril
Fix never pattern printing It's currently broken, but there's an easy fix. r? `@Nadrieril`
This commit is contained in:
commit
4f7aed6791
3 changed files with 34 additions and 0 deletions
|
|
@ -876,6 +876,7 @@ impl<'a> State<'a> {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
self.end(); // Close the ibox for the pattern.
|
||||
self.word(",");
|
||||
}
|
||||
self.end(); // Close enclosing cbox.
|
||||
|
|
|
|||
17
tests/pretty/never-pattern.pp
Normal file
17
tests/pretty/never-pattern.pp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#![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