]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/unused_label.rs
Rustup
[rust.git] / clippy_lints / src / unused_label.rs
index ca3000326750cc23a0781ac36f4f6d18b58577b3..5c5550ed30fb2e675a3059f6b1d13e941a11ea37 100644 (file)
@@ -70,10 +70,10 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for UnusedLabelVisitor<'a, 'tcx> {
     fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
         match expr.node {
             hir::ExprBreak(destination, _) | hir::ExprContinue(destination) => if let Some(label) = destination.label {
-                self.labels.remove(&label.name.as_str());
+                self.labels.remove(&label.ident.as_str());
             },
             hir::ExprLoop(_, Some(label), _) | hir::ExprWhile(_, _, Some(label)) => {
-                self.labels.insert(label.name.as_str(), expr.span);
+                self.labels.insert(label.ident.as_str(), expr.span);
             },
             _ => (),
         }