Skip to content

Commit

Permalink
Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu
Browse files Browse the repository at this point in the history
Remove deprecated LLVM-style inline assembly

The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove
it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it
is time to remove `llvm_asm!` to avoid continued maintenance cost.

Closes #70173.
Closes #92794.
Closes #87612.
Closes #82065.

cc `@rust-lang/wg-inline-asm`

r? `@Amanieu`
  • Loading branch information
bors committed Jan 17, 2022
2 parents f4a88f2 + d389cfc commit 55fa2ea
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 29 deletions.
1 change: 0 additions & 1 deletion clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ fn is_linted_explicit_deref_position(parent: Option<Node<'_>>, child_id: HirId,
| ExprKind::Continue(..)
| ExprKind::Ret(..)
| ExprKind::InlineAsm(..)
| ExprKind::LlvmInlineAsm(..)
| ExprKind::Struct(..)
| ExprKind::Repeat(..)
| ExprKind::Yield(..) => true,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ impl<'tcx> Visitor<'tcx> for InsertSearcher<'_, 'tcx> {
self.loops.pop();
},
ExprKind::Block(block, _) => self.visit_block(block),
ExprKind::InlineAsm(_) | ExprKind::LlvmInlineAsm(_) => {
ExprKind::InlineAsm(_) => {
self.can_use_entry = false;
},
_ => {
Expand Down
1 change: 0 additions & 1 deletion clippy_lints/src/loops/never_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
ExprKind::Struct(_, _, None)
| ExprKind::Yield(_, _)
| ExprKind::Closure(_, _, _, _, _)
| ExprKind::LlvmInlineAsm(_)
| ExprKind::Path(_)
| ExprKind::ConstBlock(_)
| ExprKind::Lit(_)
Expand Down
1 change: 0 additions & 1 deletion clippy_lints/src/suspicious_operation_groupings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ fn ident_difference_expr_with_base_location(
| (Repeat(_, _), Repeat(_, _))
| (Struct(_), Struct(_))
| (MacCall(_), MacCall(_))
| (LlvmInlineAsm(_), LlvmInlineAsm(_))
| (InlineAsm(_), InlineAsm(_))
| (Ret(_), Ret(_))
| (Continue(_), Continue(_))
Expand Down
4 changes: 0 additions & 4 deletions clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,6 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
kind!("InlineAsm(_)");
out!("// unimplemented: `ExprKind::InlineAsm` is not further destructured at the moment");
},
ExprKind::LlvmInlineAsm(_) => {
kind!("LlvmInlineAsm(_)");
out!("// unimplemented: `ExprKind::LlvmInlineAsm` is not further destructured at the moment");
},
ExprKind::Struct(qpath, fields, base) => {
bind!(self, qpath, fields);
opt_bind!(self, base);
Expand Down
13 changes: 0 additions & 13 deletions clippy_lints/src/utils/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,6 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
}
}
},
hir::ExprKind::LlvmInlineAsm(asm) => {
let inputs = &asm.inputs_exprs;
let outputs = &asm.outputs_exprs;
println!("{}LlvmInlineAsm", ind);
println!("{}inputs:", ind);
for e in inputs.iter() {
print_expr(cx, e, indent + 1);
}
println!("{}outputs:", ind);
for e in outputs.iter() {
print_expr(cx, e, indent + 1);
}
},
hir::ExprKind::Struct(path, fields, ref base) => {
println!("{}Struct", ind);
println!("{}path: {:?}", ind, path);
Expand Down
1 change: 0 additions & 1 deletion clippy_utils/src/eager_or_lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ fn expr_eagerness<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> EagernessS
| ExprKind::Continue(_)
| ExprKind::Ret(_)
| ExprKind::InlineAsm(_)
| ExprKind::LlvmInlineAsm(_)
| ExprKind::Yield(..)
| ExprKind::Err => {
self.eagerness = ForceNoChange;
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
}
self.hash_pat(pat);
},
ExprKind::LlvmInlineAsm(..) | ExprKind::Err => {},
ExprKind::Err => {},
ExprKind::Lit(ref l) => {
l.node.hash(&mut self.s);
},
Expand Down
3 changes: 1 addition & 2 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,7 @@ pub fn can_move_expr_to_closure_no_visit<'tcx>(
| ExprKind::Continue(_)
| ExprKind::Ret(_)
| ExprKind::Yield(..)
| ExprKind::InlineAsm(_)
| ExprKind::LlvmInlineAsm(_) => false,
| ExprKind::InlineAsm(_) => false,
// Accessing a field of a local value can only be done if the type isn't
// partially moved.
ExprKind::Field(
Expand Down
2 changes: 0 additions & 2 deletions clippy_utils/src/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ fn check_statement<'tcx>(
// just an assignment
StatementKind::SetDiscriminant { place, .. } => check_place(tcx, **place, span, body),

StatementKind::LlvmInlineAsm { .. } => Err((span, "cannot use inline assembly in const fn".into())),

StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping { dst, src, count }) => {
check_operand(tcx, dst, span, body)?;
check_operand(tcx, src, span, body)?;
Expand Down
2 changes: 0 additions & 2 deletions clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ impl<'a> Sugg<'a> {
| hir::ExprKind::Field(..)
| hir::ExprKind::Index(..)
| hir::ExprKind::InlineAsm(..)
| hir::ExprKind::LlvmInlineAsm(..)
| hir::ExprKind::ConstBlock(..)
| hir::ExprKind::Lit(..)
| hir::ExprKind::Loop(..)
Expand Down Expand Up @@ -205,7 +204,6 @@ impl<'a> Sugg<'a> {
| ast::ExprKind::ForLoop(..)
| ast::ExprKind::Index(..)
| ast::ExprKind::InlineAsm(..)
| ast::ExprKind::LlvmInlineAsm(..)
| ast::ExprKind::ConstBlock(..)
| ast::ExprKind::Lit(..)
| ast::ExprKind::Loop(..)
Expand Down

0 comments on commit 55fa2ea

Please sign in to comment.