Skip to content

Commit

Permalink
Auto merge of rust-lang#9790 - ehuss:fix-plugin-registrar, r=alexcric…
Browse files Browse the repository at this point in the history
…hton

Fix plugin registrar change.

The plugin tests were broken due to a change in rust-lang/rust#85296 which removed the `plugin_registrar` attribute.
  • Loading branch information
bors authored and ehuss committed Aug 20, 2021
1 parent 26528cf commit 09eb666
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tests/testsuite/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,15 @@ fn plugin_with_extra_dylib_dep() {
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
#![feature(rustc_private)]
extern crate baz;
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
#[plugin_registrar]
pub fn foo(reg: &mut Registry) {
#[no_mangle]
pub fn __rustc_plugin_registrar(reg: &mut Registry) {
println!("{}", baz::baz());
}
"#,
Expand Down
12 changes: 6 additions & 6 deletions tests/testsuite/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ fn plugin_to_the_max() {
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
#![feature(rustc_private)]
extern crate baz;
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
#[plugin_registrar]
pub fn foo(_reg: &mut Registry) {
#[no_mangle]
pub fn __rustc_plugin_registrar(_reg: &mut Registry) {
println!("{}", baz::baz());
}
"#,
Expand Down Expand Up @@ -191,7 +191,7 @@ fn plugin_with_dynamic_native_dependency() {
.file(
"bar/src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
#![feature(rustc_private)]
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
Expand All @@ -200,8 +200,8 @@ fn plugin_with_dynamic_native_dependency() {
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
extern { fn foo(); }
#[plugin_registrar]
pub fn bar(_reg: &mut Registry) {
#[no_mangle]
pub fn __rustc_plugin_registrar(_reg: &mut Registry) {
unsafe { foo() }
}
"#,
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/proc_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fn plugin_and_proc_macro() {
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
#![feature(rustc_private)]
#![feature(proc_macro, proc_macro_lib)]
extern crate rustc_driver;
Expand All @@ -236,8 +236,8 @@ fn plugin_and_proc_macro() {
extern crate proc_macro;
use proc_macro::TokenStream;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {}
#[no_mangle]
pub fn __rustc_plugin_registrar(reg: &mut Registry) {}
#[proc_macro_derive(Questionable)]
pub fn questionable(input: TokenStream) -> TokenStream {
Expand Down

0 comments on commit 09eb666

Please sign in to comment.