mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -876,6 +876,7 @@ fn print_arm(&mut self, arm: &ast::Arm) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.end(); // Close the ibox for the pattern.
|
||||
self.word(",");
|
||||
}
|
||||
self.end(); // Close enclosing cbox.
|
||||
|
||||
@@ -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() {}
|
||||
@@ -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