Skip to content

Commit 03d4fd9

Browse files
committed
Use descriptive variant name
1 parent 05f0dee commit 03d4fd9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc/middle/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
352352

353353
hir::ItemKind::Mod(..) => self.check_missing_stability(i.id, i.span, "module"),
354354

355-
_ => self.check_missing_stability(i.id, i.span, "node")
355+
_ => self.check_missing_stability(i.id, i.span, i.node.descriptive_variant())
356356
}
357357

358358
intravisit::walk_item(self, i)
@@ -382,7 +382,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
382382
}
383383

384384
fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem) {
385-
self.check_missing_stability(i.id, i.span, "node");
385+
self.check_missing_stability(i.id, i.span, i.node.descriptive_variant());
386386
intravisit::walk_foreign_item(self, i);
387387
}
388388

src/test/ui/missing/missing-stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![stable(feature = "stable_test_feature", since = "1.0.0")]
77

88
pub fn unmarked() {
9-
//~^ ERROR node has missing stability attribute
9+
//~^ ERROR function has missing stability attribute
1010
()
1111
}
1212

@@ -20,5 +20,5 @@ pub mod foo {
2020
pub mod bar {
2121
// #[stable] is not inherited
2222
pub fn unmarked() {}
23-
//~^ ERROR node has missing stability attribute
23+
//~^ ERROR function has missing stability attribute
2424
}

src/test/ui/missing/missing-stability.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
error: node has missing stability attribute
1+
error: function has missing stability attribute
22
--> $DIR/missing-stability.rs:8:1
33
|
44
LL | / pub fn unmarked() {
5-
LL | | //~^ ERROR node has missing stability attribute
5+
LL | | //~^ ERROR function has missing stability attribute
66
LL | | ()
77
LL | | }
88
| |_^
99

10-
error: node has missing stability attribute
10+
error: function has missing stability attribute
1111
--> $DIR/missing-stability.rs:22:5
1212
|
1313
LL | pub fn unmarked() {}

0 commit comments

Comments
 (0)