Skip to content

Commit f0a7d8e

Browse files
Add incremental-fulldeps test suite and regression test for #47290.
1 parent 8756ef6 commit f0a7d8e

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

src/bootstrap/check.rs

+5
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,11 @@ static HOST_COMPILETESTS: &[Test] = &[
568568
mode: "compile-fail",
569569
suite: "compile-fail-fulldeps",
570570
},
571+
Test {
572+
path: "src/test/incremental-fulldeps",
573+
mode: "incremental",
574+
suite: "incremental-fulldeps",
575+
},
571576
Test { path: "src/test/run-make", mode: "run-make", suite: "run-make" },
572577
Test { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" },
573578

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// no-prefer-dynamic
12+
13+
#![crate_type = "proc-macro"]
14+
15+
extern crate proc_macro;
16+
17+
use proc_macro::TokenStream;
18+
19+
// Add a function to shift DefIndex of registrar function
20+
#[cfg(cfail2)]
21+
fn foo() {}
22+
23+
#[proc_macro_derive(IncrementalMacro)]
24+
pub fn derive(input: TokenStream) -> TokenStream {
25+
#[cfg(cfail2)]
26+
{
27+
foo();
28+
}
29+
30+
"".parse().unwrap()
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:incremental_proc_macro_aux.rs
12+
// ignore-stage1
13+
// revisions: cfail1 cfail2
14+
// must-compile-successfully
15+
16+
// This test makes sure that we still find the proc-macro registrar function
17+
// when we compile proc-macros incrementally (see #47292).
18+
19+
#![crate_type = "rlib"]
20+
21+
#[macro_use]
22+
extern crate incremental_proc_macro_aux;
23+
24+
#[derive(IncrementalMacro)]
25+
pub struct Foo {
26+
x: u32
27+
}

0 commit comments

Comments
 (0)