Stabilise ?

cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
This commit is contained in:
Nick Cameron 2016-10-06 11:36:36 +13:00
parent 9d4d0da7af
commit 9bc6d26092
38 changed files with 29 additions and 90 deletions

View file

@ -1,18 +0,0 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
macro_rules! id {
($e:expr) => { $e }
}
fn main() {
id!(x?); //~ error: the `?` operator is not stable (see issue #31436)
y?; //~ error: the `?` operator is not stable (see issue #31436)
}

View file

@ -8,12 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(question_mark)]
// Make sure that the span of try shorthand does not include the trailing
// semicolon;
fn a() -> Result<i32, ()> {
Err(5)?; //~ ERROR 16:5: 16:12
Err(5)?; //~ ERROR 14:5: 14:12
Ok(1)
}

View file

@ -14,7 +14,6 @@
#![allow(unused_must_use)]
#![allow(unused_features)]
#![feature(box_syntax)]
#![feature(question_mark)]
use std::fmt::{self, Write};
use std::usize;

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(conservative_impl_trait, question_mark)]
#![feature(conservative_impl_trait)]
struct State;
type Error = ();

View file

@ -10,8 +10,6 @@
// pretty-expanded FIXME #23616
#![feature(question_mark)]
use std::fs::File;
use std::io::{self, BufReader, Read};

View file

@ -10,8 +10,6 @@
// Regression test for #20797.
#![feature(question_mark)]
use std::default::Default;
use std::io;
use std::fs;

View file

@ -11,8 +11,6 @@
// Regression test for #21400 which itself was extracted from
// stackoverflow.com/questions/28031155/is-my-borrow-checker-drunk/28031580
#![feature(question_mark)]
fn main() {
let mut t = Test;
assert_eq!(t.method1("one"), Ok(1));

View file

@ -18,8 +18,6 @@
// This test verifies that the expansion is hygienic, i.e. it's not affected by other `val` and
// `err` bindings that may be in scope.
#![feature(question_mark)]
use std::num::ParseIntError;
fn main() {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(question_mark)]
use std::fs::File;
use std::io::{Read, self};
use std::num::ParseIntError;