rustc: Forbid plugin_registrar in only rlib form

If a plugin registrar is available, the library must be found in dylib form, not
just in rlib form.

Closes #15475
This commit is contained in:
Alex Crichton 2014-07-09 19:13:28 -07:00
parent 3f3291e0c7
commit fe48c3b620
3 changed files with 50 additions and 1 deletions

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.
// no-prefer-dynamic
#![crate_type = "rlib"]
#![feature(plugin_registrar)]
extern crate rustc;
use rustc::plugin::Registry;
#[plugin_registrar]
pub fn plugin_registrar(_: &mut Registry) {}

View file

@ -0,0 +1,20 @@
// 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:rlib_crate_test.rs
// ignore-stage1
// ignore-tidy-linelength
// ignore-android
#![feature(phase)]
#[phase(plugin)] extern crate rlib_crate_test;
//~^ ERROR: plugin crate `rlib_crate_test` only found in rlib format, but must be available in dylib format
fn main() {}