use std::collections::BTreeSet;
use std::mem::replace;
+use rustc_error_codes::*;
+
mod diagnostics;
type Res = def::Res<NodeId>;
match item.kind {
ItemKind::TyAlias(_, ref generics) |
- ItemKind::OpaqueTy(_, ref generics) |
- ItemKind::Fn(_, _, ref generics, _) => {
+ ItemKind::Fn(_, ref generics, _) => {
self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes),
|this| visit::walk_item(this, item));
}
this.visit_ty(ty);
}
- ImplItemKind::OpaqueTy(ref bounds) => {
- // If this is a trait impl, ensure the type
- // exists in trait
- this.check_trait_item(impl_item.ident,
- TypeNS,
- impl_item.span,
- |n, s| TypeNotMemberOfTrait(n, s));
-
- for bound in bounds {
- this.visit_param_bound(bound);
- }
- }
ImplItemKind::Macro(_) =>
panic!("unexpanded macro in resolve!"),
}
fn with_resolved_label(&mut self, label: Option<Label>, id: NodeId, f: impl FnOnce(&mut Self)) {
if let Some(label) = label {
- self.diagnostic_metadata.unused_labels.insert(id, label.ident.span);
+ if label.ident.as_str().as_bytes()[1] != b'_' {
+ self.diagnostic_metadata.unused_labels.insert(id, label.ident.span);
+ }
self.with_label_rib(NormalRibKind, |this| {
let ident = label.ident.modern_and_legacy();
this.label_ribs.last_mut().unwrap().bindings.insert(ident, id);