Skip to content

Commit 7a8b402

Browse files
Fix tests
1 parent 0e326d4 commit 7a8b402

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,
11781178
for attr in &krate.attrs {
11791179
if attr.check_name("feature") {
11801180
let release_channel = option_env!("CFG_RELEASE_CHANNEL").unwrap_or("(unknown)");
1181-
span_err!(span_handler, attr.span, E0558,
1181+
span_err!(span_handler, attr.span, E0554,
11821182
"#[feature] may not be used on the {} release channel",
11831183
release_channel);
11841184
}

src/test/compile-fail/stability-attribute-sanity.rs

+25-24
Original file line numberDiff line numberDiff line change
@@ -15,83 +15,84 @@
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

1717
mod bogus_attribute_types_1 {
18-
#[stable(feature = "a", since = "a", reason)] //~ ERROR unknown meta item 'reason'
18+
#[stable(feature = "a", since = "a", reason)] //~ ERROR unknown meta item 'reason' [E0541]
1919
fn f1() { }
2020

21-
#[stable(feature = "a", since)] //~ ERROR incorrect meta item
21+
#[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
2222
fn f2() { }
2323

24-
#[stable(feature, since = "a")] //~ ERROR incorrect meta item
24+
#[stable(feature, since = "a")] //~ ERROR incorrect meta item [E0539]
2525
fn f3() { }
2626

27-
#[stable(feature = "a", since(b))] //~ ERROR incorrect meta item
27+
#[stable(feature = "a", since(b))] //~ ERROR incorrect meta item [E0539]
2828
fn f5() { }
2929

30-
#[stable(feature(b), since = "a")] //~ ERROR incorrect meta item
30+
#[stable(feature(b), since = "a")] //~ ERROR incorrect meta item [E0539]
3131
fn f6() { }
3232
}
3333

3434
mod bogus_attribute_types_2 {
35-
#[unstable] //~ ERROR incorrect stability attribute type
35+
#[unstable] //~ ERROR incorrect stability attribute type [E0548]
3636
fn f1() { }
3737

38-
#[unstable = "a"] //~ ERROR incorrect stability attribute type
38+
#[unstable = "a"] //~ ERROR incorrect stability attribute type [E0548]
3939
fn f2() { }
4040

41-
#[stable] //~ ERROR incorrect stability attribute type
41+
#[stable] //~ ERROR incorrect stability attribute type [E0548]
4242
fn f3() { }
4343

44-
#[stable = "a"] //~ ERROR incorrect stability attribute type
44+
#[stable = "a"] //~ ERROR incorrect stability attribute type [E0548]
4545
fn f4() { }
4646

4747
#[stable(feature = "a", since = "b")]
48-
#[rustc_deprecated] //~ ERROR incorrect stability attribute type
48+
#[rustc_deprecated] //~ ERROR incorrect stability attribute type [E0548]
4949
fn f5() { }
5050

5151
#[stable(feature = "a", since = "b")]
52-
#[rustc_deprecated = "a"] //~ ERROR incorrect stability attribute type
52+
#[rustc_deprecated = "a"] //~ ERROR incorrect stability attribute type [E0548]
5353
fn f6() { }
5454
}
5555

5656
mod missing_feature_names {
57-
#[unstable(issue = "0")] //~ ERROR missing 'feature'
57+
#[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546]
5858
fn f1() { }
5959

60-
#[unstable(feature = "a")] //~ ERROR missing 'issue'
60+
#[unstable(feature = "a")] //~ ERROR missing 'issue' [E0547]
6161
fn f2() { }
6262

63-
#[stable(since = "a")] //~ ERROR missing 'feature'
63+
#[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
6464
fn f3() { }
6565
}
6666

6767
mod missing_version {
68-
#[stable(feature = "a")] //~ ERROR missing 'since'
68+
#[stable(feature = "a")] //~ ERROR missing 'since' [E0542]
6969
fn f1() { }
7070

7171
#[stable(feature = "a", since = "b")]
72-
#[rustc_deprecated(reason = "a")] //~ ERROR missing 'since'
72+
#[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542]
7373
fn f2() { }
7474
}
7575

7676
#[unstable(feature = "a", issue = "0")]
77-
#[stable(feature = "a", since = "b")]
78-
fn multiple1() { } //~ ERROR multiple stability levels
77+
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
78+
fn multiple1() { }
7979

8080
#[unstable(feature = "a", issue = "0")]
81-
#[unstable(feature = "a", issue = "0")]
82-
fn multiple2() { } //~ ERROR multiple stability levels
81+
#[unstable(feature = "a", issue = "0")] //~ ERROR multiple stability levels [E0544]
82+
fn multiple2() { }
8383

8484
#[stable(feature = "a", since = "b")]
85-
#[stable(feature = "a", since = "b")]
86-
fn multiple3() { } //~ ERROR multiple stability levels
85+
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
86+
fn multiple3() { }
8787

8888
#[stable(feature = "a", since = "b")]
8989
#[rustc_deprecated(since = "b", reason = "text")]
9090
#[rustc_deprecated(since = "b", reason = "text")]
91-
fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes
91+
fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540]
9292
//~^ ERROR Invalid stability or deprecation version found
9393

9494
#[rustc_deprecated(since = "a", reason = "text")]
95-
fn deprecated_without_unstable_or_stable() { } //~ ERROR rustc_deprecated attribute must be paired
95+
fn deprecated_without_unstable_or_stable() { }
96+
//~^ ERROR rustc_deprecated attribute must be paired with either stable or unstable attribute
9697

9798
fn main() { }

0 commit comments

Comments
 (0)