1
Fork 0

Use descriptive variant name

This commit is contained in:
varkor 2019-02-08 14:30:13 +01:00
parent 05f0dee04a
commit 03d4fd973a
3 changed files with 7 additions and 7 deletions

View file

@ -352,7 +352,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
hir::ItemKind::Mod(..) => self.check_missing_stability(i.id, i.span, "module"),
_ => self.check_missing_stability(i.id, i.span, "node")
_ => self.check_missing_stability(i.id, i.span, i.node.descriptive_variant())
}
intravisit::walk_item(self, i)
@ -382,7 +382,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
}
fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem) {
self.check_missing_stability(i.id, i.span, "node");
self.check_missing_stability(i.id, i.span, i.node.descriptive_variant());
intravisit::walk_foreign_item(self, i);
}

View file

@ -6,7 +6,7 @@
#![stable(feature = "stable_test_feature", since = "1.0.0")]
pub fn unmarked() {
//~^ ERROR node has missing stability attribute
//~^ ERROR function has missing stability attribute
()
}
@ -20,5 +20,5 @@ pub mod foo {
pub mod bar {
// #[stable] is not inherited
pub fn unmarked() {}
//~^ ERROR node has missing stability attribute
//~^ ERROR function has missing stability attribute
}

View file

@ -1,13 +1,13 @@
error: node has missing stability attribute
error: function has missing stability attribute
--> $DIR/missing-stability.rs:8:1
|
LL | / pub fn unmarked() {
LL | | //~^ ERROR node has missing stability attribute
LL | | //~^ ERROR function has missing stability attribute
LL | | ()
LL | | }
| |_^
error: node has missing stability attribute
error: function has missing stability attribute
--> $DIR/missing-stability.rs:22:5
|
LL | pub fn unmarked() {}