Skip to content

Commit 3149261

Browse files
authored
Rollup merge of rust-lang#38607 - estebank:test-for-36935, r=alexcrichton
Test for appropriate span on second custom derive Adds test for and closes rust-lang#36935.
2 parents a81cd32 + d8b3a64 commit 3149261

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

src/bootstrap/step.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
316316
"codegen-units");
317317
suite("check-incremental", "src/test/incremental", "incremental",
318318
"incremental");
319-
suite("check-ui", "src/test/ui", "ui", "ui");
320319
}
321320

322321
if build.config.build.contains("msvc") {
@@ -363,6 +362,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
363362
});
364363
};
365364

365+
suite("check-ui", "src/test/ui", "ui", "ui");
366366
suite("check-rpass-full", "src/test/run-pass-fulldeps",
367367
"run-pass", "run-pass-fulldeps");
368368
suite("check-rfail-full", "src/test/run-fail-fulldeps",
@@ -1374,7 +1374,6 @@ mod tests {
13741374

13751375
assert!(plan.iter().any(|s| s.name.contains("-ui")));
13761376
assert!(plan.iter().any(|s| s.name.contains("cfail")));
1377-
assert!(plan.iter().any(|s| s.name.contains("cfail")));
13781377
assert!(plan.iter().any(|s| s.name.contains("cfail-full")));
13791378
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));
13801379
assert!(plan.iter().any(|s| s.name.contains("debuginfo")));
@@ -1407,8 +1406,7 @@ mod tests {
14071406
assert!(plan.iter().all(|s| s.host == "A"));
14081407
assert!(plan.iter().all(|s| s.target == "C"));
14091408

1410-
assert!(plan.iter().any(|s| s.name.contains("-ui")));
1411-
assert!(plan.iter().any(|s| s.name.contains("cfail")));
1409+
assert!(!plan.iter().any(|s| s.name.contains("-ui")));
14121410
assert!(plan.iter().any(|s| s.name.contains("cfail")));
14131411
assert!(!plan.iter().any(|s| s.name.contains("cfail-full")));
14141412
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2016 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+
#![feature(proc_macro, proc_macro_lib)]
15+
16+
extern crate proc_macro;
17+
18+
use proc_macro::TokenStream;
19+
20+
#[proc_macro_derive(Foo)]
21+
pub fn derive_foo(input: TokenStream) -> TokenStream {
22+
input
23+
}
24+
25+
#[proc_macro_derive(Bar)]
26+
pub fn derive_bar(input: TokenStream) -> TokenStream {
27+
panic!("lolnope");
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 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:plugin.rs
12+
13+
#![feature(proc_macro)]
14+
15+
#[macro_use] extern crate plugin;
16+
17+
#[derive(Foo, Bar)]
18+
struct Baz {
19+
a: i32,
20+
b: i32,
21+
}
22+
23+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: custom derive attribute panicked
2+
--> $DIR/issue-36935.rs:17:15
3+
|
4+
17 | #[derive(Foo, Bar)]
5+
| ^^^
6+
|
7+
= help: message: lolnope
8+

0 commit comments

Comments
 (0)