Skip to content

Commit 5c7384e

Browse files
Add regression test
1 parent d14311c commit 5c7384e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Some lints are emitted in `rustc_attr_parsing`, during ast lowering.
2+
// Emitting these lints is delayed until after ast lowering.
3+
// This test tests that the delayed hints are correctly hashed for incremental.
4+
5+
//@ check-pass
6+
//@ revisions: cfail1 cfail2 cfail3
7+
//@ compile-flags: -Z query-dep-graph -O -Zincremental-ignore-spans
8+
//@ ignore-backends: gcc
9+
#![feature(rustc_attrs)]
10+
11+
// This attribute is here so the `has_delayed_lints` will be true on all revisions
12+
#[doc(test = 1)]
13+
//~^ WARN `#[doc(test(...)]` takes a list of attributes [invalid_doc_attributes]
14+
15+
// Between revision 1 and 2, the only thing we change is that we add "test = 2"
16+
// This will emit an extra delayed lint, but it will not change the HIR hash.
17+
// We check that even tho the HIR hash didn't change, the extra lint is emitted
18+
#[cfg_attr(cfail1, doc(hidden))]
19+
#[cfg_attr(not(cfail1), doc(hidden, test = 2))]
20+
//[cfail2,cfail3]~^ WARN `#[doc(test(...)]` takes a list of attributes [invalid_doc_attributes]
21+
22+
// The HIR hash should not change between revisions, for this test to be representative
23+
#[rustc_clean(cfg="cfail2")]
24+
#[rustc_clean(cfg="cfail3")]
25+
trait Test {}
26+
27+
fn main() {}

0 commit comments

Comments
 (0)