rustc: implement unstable(issue = "nnn").

This takes an issue number and points people to it in the printed error
message. This commit does not make it an error to have no `issue` field.
This commit is contained in:
Huon Wilson 2015-07-02 21:00:59 -07:00
parent fe283b4067
commit 69d340a40d
4 changed files with 92 additions and 25 deletions

View file

@ -0,0 +1,20 @@
// Copyright 2015 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.
#![feature(staged_api)]
#![staged_api]
#![stable(feature = "foo", since = "1.2.0")]
#[unstable(feature = "foo", issue = "1")]
pub fn unstable() {}
#[unstable(feature = "foo", reason = "message", issue = "2")]
pub fn unstable_msg() {}

View file

@ -0,0 +1,21 @@
// Copyright 2013-2014 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.
// aux-build:stability_attribute_issue.rs
#![deny(deprecated)]
extern crate stability_attribute_issue;
use stability_attribute_issue::*;
fn main() {
unstable(); //~ ERROR use of unstable library feature 'foo' (see issue #1)
unstable_msg(); //~ ERROR use of unstable library feature 'foo': message (see issue #2)
}