mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 07:03:45 +00:00
Add incremental-fulldeps test suite and regression test for #47290.
This commit is contained in:
parent
8756ef6385
commit
f0a7d8e2bd
@ -568,6 +568,11 @@ static HOST_COMPILETESTS: &[Test] = &[
|
||||
mode: "compile-fail",
|
||||
suite: "compile-fail-fulldeps",
|
||||
},
|
||||
Test {
|
||||
path: "src/test/incremental-fulldeps",
|
||||
mode: "incremental",
|
||||
suite: "incremental-fulldeps",
|
||||
},
|
||||
Test { path: "src/test/run-make", mode: "run-make", suite: "run-make" },
|
||||
Test { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" },
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
// Copyright 2018 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 = "proc-macro"]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
// Add a function to shift DefIndex of registrar function
|
||||
#[cfg(cfail2)]
|
||||
fn foo() {}
|
||||
|
||||
#[proc_macro_derive(IncrementalMacro)]
|
||||
pub fn derive(input: TokenStream) -> TokenStream {
|
||||
#[cfg(cfail2)]
|
||||
{
|
||||
foo();
|
||||
}
|
||||
|
||||
"".parse().unwrap()
|
||||
}
|
27
src/test/incremental-fulldeps/incremental_proc_macro.rs
Normal file
27
src/test/incremental-fulldeps/incremental_proc_macro.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright 2018 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:incremental_proc_macro_aux.rs
|
||||
// ignore-stage1
|
||||
// revisions: cfail1 cfail2
|
||||
// must-compile-successfully
|
||||
|
||||
// This test makes sure that we still find the proc-macro registrar function
|
||||
// when we compile proc-macros incrementally (see #47292).
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[macro_use]
|
||||
extern crate incremental_proc_macro_aux;
|
||||
|
||||
#[derive(IncrementalMacro)]
|
||||
pub struct Foo {
|
||||
x: u32
|
||||
}
|
Loading…
Reference in New Issue
Block a user