Added new attribute syntax with backward compatibility.
Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
This commit is contained in:
parent
6eae7df43c
commit
4e00cf6134
7 changed files with 98 additions and 11 deletions
14
src/test/compile-fail/attr.rs
Normal file
14
src/test/compile-fail/attr.rs
Normal 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() {}
|
||||
16
src/test/run-pass/attr-mix-new.rs
Normal file
16
src/test/run-pass/attr-mix-new.rs
Normal 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() {}
|
||||
4
src/test/run-pass/attr-shebang.rs
Normal file
4
src/test/run-pass/attr-shebang.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#![allow(unknown_features)]
|
||||
#![feature(bogus)]
|
||||
fn main() { }
|
||||
// ignore-license
|
||||
13
src/test/run-pass/attr.rs
Normal file
13
src/test/run-pass/attr.rs
Normal 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() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue