diff options
| author | bors <bors@rust-lang.org> | 2015-02-10 11:15:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-10 11:15:52 +0000 |
| commit | 94c06a1be0ccfcf1a8e105fc98d126de372dbd40 (patch) | |
| tree | 34c42bfdc779516ea7be5d116b31ed1bf3507ef8 /src/test/compile-fail | |
| parent | de8bc44753881aacdaf435f5ba61de3c20916761 (diff) | |
| parent | 1aedc45f85fe9feb70971f9d0c743c4af550a080 (diff) | |
| download | rust-94c06a1be0ccfcf1a8e105fc98d126de372dbd40.tar.gz rust-94c06a1be0ccfcf1a8e105fc98d126de372dbd40.zip | |
Auto merge of #22026 - kmcallister:plugin, r=sfackler
```rust #[plugin] #[no_link] extern crate bleh; ``` becomes a crate attribute ```rust #![plugin(bleh)] ``` The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/malformed-plugin-1.rs (renamed from src/test/compile-fail/multi-plugin-attr.rs) | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/malformed-plugin-2.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/malformed-plugin-3.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs | 15 |
4 files changed, 42 insertions, 3 deletions
diff --git a/src/test/compile-fail/multi-plugin-attr.rs b/src/test/compile-fail/malformed-plugin-1.rs index 1d98cd26a38..254a797ef1c 100644 --- a/src/test/compile-fail/multi-plugin-attr.rs +++ b/src/test/compile-fail/malformed-plugin-1.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[plugin] -#[plugin] //~ ERROR #[plugin] specified multiple times -extern crate std; +#![plugin] //~ ERROR malformed plugin attribute fn main() {} diff --git a/src/test/compile-fail/malformed-plugin-2.rs b/src/test/compile-fail/malformed-plugin-2.rs new file mode 100644 index 00000000000..884087b7bc5 --- /dev/null +++ b/src/test/compile-fail/malformed-plugin-2.rs @@ -0,0 +1,13 @@ +// 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. + +#![plugin="bleh"] //~ ERROR malformed plugin attribute + +fn main() {} diff --git a/src/test/compile-fail/malformed-plugin-3.rs b/src/test/compile-fail/malformed-plugin-3.rs new file mode 100644 index 00000000000..4885bb901df --- /dev/null +++ b/src/test/compile-fail/malformed-plugin-3.rs @@ -0,0 +1,13 @@ +// 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. + +#![plugin(foo="bleh")] //~ ERROR malformed plugin attribute + +fn main() {} diff --git a/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs b/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs new file mode 100644 index 00000000000..ccda5cbdceb --- /dev/null +++ b/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs @@ -0,0 +1,15 @@ +// 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. + +#[plugin] //~ ERROR #[plugin] on `extern crate` is deprecated +//~^ HELP use a crate attribute instead, i.e. #![plugin(std)] +extern crate std; + +fn main() {} |
