Rollup merge of #22241 - kmcallister:macro-plugin-cleanup, r=sfackler
This commit is contained in:
commit
901d2c7b0d
14 changed files with 396 additions and 243 deletions
22
src/test/auxiliary/plugin_with_plugin_lib.rs
Normal file
22
src/test/auxiliary/plugin_with_plugin_lib.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// 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.
|
||||
|
||||
// force-host
|
||||
|
||||
#![feature(plugin_registrar)]
|
||||
#![deny(plugin_as_library)] // should have no effect in a plugin crate
|
||||
|
||||
extern crate macro_crate_test;
|
||||
extern crate rustc;
|
||||
|
||||
use rustc::plugin::Registry;
|
||||
|
||||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(_: &mut Registry) { }
|
||||
|
|
@ -16,6 +16,6 @@
|
|||
|
||||
#![feature(plugin)]
|
||||
#![plugin(rlib_crate_test)]
|
||||
//~^ ERROR: plugin crate `rlib_crate_test` only found in rlib format, but must be available in dylib format
|
||||
//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
22
src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs
Normal file
22
src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2013-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.
|
||||
|
||||
// aux-build:macro_crate_test.rs
|
||||
// ignore-stage1
|
||||
// ignore-cross-compile
|
||||
//
|
||||
// macro_crate_test will not compile on a cross-compiled target because
|
||||
// libsyntax is not compiled for it.
|
||||
|
||||
#![deny(plugin_as_library)]
|
||||
|
||||
extern crate macro_crate_test; //~ ERROR compiler plugin used as an ordinary library
|
||||
|
||||
fn main() { }
|
||||
27
src/test/compile-fail-fulldeps/plugin-plus-extern-crate.rs
Normal file
27
src/test/compile-fail-fulldeps/plugin-plus-extern-crate.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2013-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.
|
||||
|
||||
// aux-build:macro_crate_test.rs
|
||||
// ignore-stage1
|
||||
// ignore-cross-compile
|
||||
//
|
||||
// macro_crate_test will not compile on a cross-compiled target because
|
||||
// libsyntax is not compiled for it.
|
||||
|
||||
#![deny(plugin_as_library)]
|
||||
#![feature(plugin)]
|
||||
#![plugin(macro_crate_test)]
|
||||
|
||||
extern crate macro_crate_test; //~ ERROR compiler plugin used as an ordinary library
|
||||
|
||||
fn main() {
|
||||
assert_eq!(1, make_a_1!());
|
||||
macro_crate_test::foo();
|
||||
}
|
||||
26
src/test/run-pass-fulldeps/plugin-lib-ok-in-plugin.rs
Normal file
26
src/test/run-pass-fulldeps/plugin-lib-ok-in-plugin.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2013-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.
|
||||
|
||||
// aux-build:macro_crate_test.rs
|
||||
// aux-build:plugin_with_plugin_lib.rs
|
||||
// ignore-stage1
|
||||
// ignore-cross-compile
|
||||
//
|
||||
// macro_crate_test will not compile on a cross-compiled target because
|
||||
// libsyntax is not compiled for it.
|
||||
|
||||
#![deny(plugin_as_library)]
|
||||
#![feature(plugin)]
|
||||
#![plugin(macro_crate_test)]
|
||||
#![plugin(plugin_with_plugin_lib)]
|
||||
|
||||
fn main() {
|
||||
assert_eq!(1, make_a_1!());
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
// macro_crate_test will not compile on a cross-compiled target because
|
||||
// libsyntax is not compiled for it.
|
||||
|
||||
#![allow(plugin_as_library)]
|
||||
#![feature(plugin)]
|
||||
#![plugin(macro_crate_test)]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue