Remove LLVM-style inline assembly from clippy

This commit is contained in:
Tomasz Miąsko 2022-01-12 00:00:00 +00:00
parent dda2aef64f
commit d389cfccb5
11 changed files with 3 additions and 29 deletions

View file

@ -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,

View file

@ -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;
},
_ => {

View file

@ -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(_)

View file

@ -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(_))

View file

@ -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);

View file

@ -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);

View file

@ -175,7 +175,6 @@ fn expr_eagerness(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> EagernessSuggest
| ExprKind::Continue(_)
| ExprKind::Ret(_)
| ExprKind::InlineAsm(_)
| ExprKind::LlvmInlineAsm(_)
| ExprKind::Yield(..)
| ExprKind::Err => {
self.eagerness = ForceNoChange;

View file

@ -685,7 +685,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);
},

View file

@ -777,8 +777,7 @@ pub fn can_move_expr_to_closure_no_visit(
| 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(

View file

@ -222,8 +222,6 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen
// 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)?;

View file

@ -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(..)
@ -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(..)