Added new attribute syntax with backward compatibility.

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
This commit is contained in:
Daniel Fagnan 2014-02-24 19:42:40 -07:00 committed by Alex Crichton
parent 6eae7df43c
commit 4e00cf6134
7 changed files with 98 additions and 11 deletions

View file

@ -0,0 +1,14 @@
// Copyright 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.
fn main() {}
#![lang(foo)] //~ ERROR An inner attribute was not permitted in this context.
fn foo() {}

View file

@ -0,0 +1,16 @@
// Copyright 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.
#[foo(bar)]
mod foo {
#![feature(globs)]
}
fn main() {}

View file

@ -0,0 +1,4 @@
#![allow(unknown_features)]
#![feature(bogus)]
fn main() { }
// ignore-license

13
src/test/run-pass/attr.rs Normal file
View file

@ -0,0 +1,13 @@
// Copyright 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.
#[main]
fn foo() {
}