Skip to content

Commit

Permalink
Retain assembly operands span when lowering AST to HIR
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Dec 6, 2020
1 parent 8eca423 commit 0e527ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/loops.rs
Expand Up @@ -768,7 +768,7 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
ExprKind::InlineAsm(ref asm) => asm
.operands
.iter()
.map(|o| match o {
.map(|(o, _)| match o {
InlineAsmOperand::In { expr, .. }
| InlineAsmOperand::InOut { expr, .. }
| InlineAsmOperand::Const { expr }
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/hir_utils.rs
Expand Up @@ -517,7 +517,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
}
}
asm.options.hash(&mut self.s);
for op in asm.operands {
for (op, _op_sp) in asm.operands {
match op {
InlineAsmOperand::In { reg, expr } => {
reg.hash(&mut self.s);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/inspector.rs
Expand Up @@ -293,7 +293,7 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
println!("{}template: {}", ind, InlineAsmTemplatePiece::to_string(asm.template));
println!("{}options: {:?}", ind, asm.options);
println!("{}operands:", ind);
for op in asm.operands {
for (op, _op_sp) in asm.operands {
match op {
hir::InlineAsmOperand::In { expr, .. }
| hir::InlineAsmOperand::InOut { expr, .. }
Expand Down

0 comments on commit 0e527ba

Please sign in to comment.