From e1139cf570a7156ef53441db256a2350ef2b5b89 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Mon, 13 Dec 2021 00:00:51 +0000 Subject: [PATCH] Fix clippy tests --- tests/ui/asm_syntax.rs | 4 ++-- tests/ui/asm_syntax.stderr | 6 ++--- tests/ui/entry.fixed | 2 +- tests/ui/entry.rs | 2 +- tests/ui/missing-doc.rs | 3 ++- tests/ui/missing-doc.stderr | 48 ++++++++++++++++++------------------- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/tests/ui/asm_syntax.rs b/tests/ui/asm_syntax.rs index 4a62f6f2909f3..0220bf3331f5b 100644 --- a/tests/ui/asm_syntax.rs +++ b/tests/ui/asm_syntax.rs @@ -1,11 +1,10 @@ // only-x86_64 // ignore-aarch64 -#![feature(asm)] - #[warn(clippy::inline_asm_x86_intel_syntax)] mod warn_intel { pub(super) unsafe fn use_asm() { + use std::arch::asm; asm!(""); asm!("", options()); asm!("", options(nostack)); @@ -17,6 +16,7 @@ mod warn_intel { #[warn(clippy::inline_asm_x86_att_syntax)] mod warn_att { pub(super) unsafe fn use_asm() { + use std::arch::asm; asm!(""); asm!("", options()); asm!("", options(nostack)); diff --git a/tests/ui/asm_syntax.stderr b/tests/ui/asm_syntax.stderr index 409f4db76bc25..e9b150121aa31 100644 --- a/tests/ui/asm_syntax.stderr +++ b/tests/ui/asm_syntax.stderr @@ -1,5 +1,5 @@ error: Intel x86 assembly syntax used - --> $DIR/asm_syntax.rs:9:9 + --> $DIR/asm_syntax.rs:8:9 | LL | asm!(""); | ^^^^^^^^ @@ -8,7 +8,7 @@ LL | asm!(""); = help: use AT&T x86 assembly syntax error: Intel x86 assembly syntax used - --> $DIR/asm_syntax.rs:10:9 + --> $DIR/asm_syntax.rs:9:9 | LL | asm!("", options()); | ^^^^^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL | asm!("", options()); = help: use AT&T x86 assembly syntax error: Intel x86 assembly syntax used - --> $DIR/asm_syntax.rs:11:9 + --> $DIR/asm_syntax.rs:10:9 | LL | asm!("", options(nostack)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/entry.fixed b/tests/ui/entry.fixed index 8a36ec833d76d..e43635abcd112 100644 --- a/tests/ui/entry.fixed +++ b/tests/ui/entry.fixed @@ -2,8 +2,8 @@ #![allow(unused, clippy::needless_pass_by_value, clippy::collapsible_if)] #![warn(clippy::map_entry)] -#![feature(asm)] +use std::arch::asm; use std::collections::HashMap; use std::hash::Hash; diff --git a/tests/ui/entry.rs b/tests/ui/entry.rs index d972a201ad764..d999b3b7dc80d 100644 --- a/tests/ui/entry.rs +++ b/tests/ui/entry.rs @@ -2,8 +2,8 @@ #![allow(unused, clippy::needless_pass_by_value, clippy::collapsible_if)] #![warn(clippy::map_entry)] -#![feature(asm)] +use std::arch::asm; use std::collections::HashMap; use std::hash::Hash; diff --git a/tests/ui/missing-doc.rs b/tests/ui/missing-doc.rs index 148531c285d3d..6e2e710e21c84 100644 --- a/tests/ui/missing-doc.rs +++ b/tests/ui/missing-doc.rs @@ -2,10 +2,11 @@ // When denying at the crate level, be sure to not get random warnings from the // injected intrinsics by the compiler. #![allow(dead_code)] -#![feature(global_asm)] //! Some garbage docs for the crate here #![doc = "More garbage"] +use std::arch::global_asm; + type Typedef = String; pub type PubTypedef = String; diff --git a/tests/ui/missing-doc.stderr b/tests/ui/missing-doc.stderr index 7a3a448c9d6c2..a876dc078ebff 100644 --- a/tests/ui/missing-doc.stderr +++ b/tests/ui/missing-doc.stderr @@ -1,5 +1,5 @@ error: missing documentation for a type alias - --> $DIR/missing-doc.rs:9:1 + --> $DIR/missing-doc.rs:10:1 | LL | type Typedef = String; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -7,37 +7,37 @@ LL | type Typedef = String; = note: `-D clippy::missing-docs-in-private-items` implied by `-D warnings` error: missing documentation for a type alias - --> $DIR/missing-doc.rs:10:1 + --> $DIR/missing-doc.rs:11:1 | LL | pub type PubTypedef = String; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a module - --> $DIR/missing-doc.rs:12:1 + --> $DIR/missing-doc.rs:13:1 | LL | mod module_no_dox {} | ^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a module - --> $DIR/missing-doc.rs:13:1 + --> $DIR/missing-doc.rs:14:1 | LL | pub mod pub_module_no_dox {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:17:1 + --> $DIR/missing-doc.rs:18:1 | LL | pub fn foo2() {} | ^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:18:1 + --> $DIR/missing-doc.rs:19:1 | LL | fn foo3() {} | ^^^^^^^^^^^^ error: missing documentation for an enum - --> $DIR/missing-doc.rs:32:1 + --> $DIR/missing-doc.rs:33:1 | LL | / enum Baz { LL | | BazA { a: isize, b: isize }, @@ -46,31 +46,31 @@ LL | | } | |_^ error: missing documentation for a variant - --> $DIR/missing-doc.rs:33:5 + --> $DIR/missing-doc.rs:34:5 | LL | BazA { a: isize, b: isize }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a struct field - --> $DIR/missing-doc.rs:33:12 + --> $DIR/missing-doc.rs:34:12 | LL | BazA { a: isize, b: isize }, | ^^^^^^^^ error: missing documentation for a struct field - --> $DIR/missing-doc.rs:33:22 + --> $DIR/missing-doc.rs:34:22 | LL | BazA { a: isize, b: isize }, | ^^^^^^^^ error: missing documentation for a variant - --> $DIR/missing-doc.rs:34:5 + --> $DIR/missing-doc.rs:35:5 | LL | BarB, | ^^^^ error: missing documentation for an enum - --> $DIR/missing-doc.rs:37:1 + --> $DIR/missing-doc.rs:38:1 | LL | / pub enum PubBaz { LL | | PubBazA { a: isize }, @@ -78,43 +78,43 @@ LL | | } | |_^ error: missing documentation for a variant - --> $DIR/missing-doc.rs:38:5 + --> $DIR/missing-doc.rs:39:5 | LL | PubBazA { a: isize }, | ^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a struct field - --> $DIR/missing-doc.rs:38:15 + --> $DIR/missing-doc.rs:39:15 | LL | PubBazA { a: isize }, | ^^^^^^^^ error: missing documentation for a constant - --> $DIR/missing-doc.rs:58:1 + --> $DIR/missing-doc.rs:59:1 | LL | const FOO: u32 = 0; | ^^^^^^^^^^^^^^^^^^^ error: missing documentation for a constant - --> $DIR/missing-doc.rs:65:1 + --> $DIR/missing-doc.rs:66:1 | LL | pub const FOO4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a static - --> $DIR/missing-doc.rs:67:1 + --> $DIR/missing-doc.rs:68:1 | LL | static BAR: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a static - --> $DIR/missing-doc.rs:74:1 + --> $DIR/missing-doc.rs:75:1 | LL | pub static BAR4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a module - --> $DIR/missing-doc.rs:76:1 + --> $DIR/missing-doc.rs:77:1 | LL | / mod internal_impl { LL | | /// dox @@ -126,31 +126,31 @@ LL | | } | |_^ error: missing documentation for a function - --> $DIR/missing-doc.rs:79:5 + --> $DIR/missing-doc.rs:80:5 | LL | pub fn undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:80:5 + --> $DIR/missing-doc.rs:81:5 | LL | pub fn undocumented2() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:81:5 + --> $DIR/missing-doc.rs:82:5 | LL | fn undocumented3() {} | ^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:86:9 + --> $DIR/missing-doc.rs:87:9 | LL | pub fn also_undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/missing-doc.rs:87:9 + --> $DIR/missing-doc.rs:88:9 | LL | fn also_undocumented2() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^