Deny 2018 idiom lints (#1108)
This lint is allow by default, which is why this wasn't spotted earlier. It's denied by rust-lang/rust, so it's good to warn about it here so it can be fixed more quickly.
This commit is contained in:
parent
e6a81b7566
commit
7bab2c0695
13 changed files with 18 additions and 18 deletions
|
|
@ -7,6 +7,7 @@
|
|||
//! The procedural macro here is relatively simple, it simply appends a
|
||||
//! `#[test]` function to the original token stream which asserts that the
|
||||
//! function itself contains the relevant instruction.
|
||||
#![deny(rust_2018_idioms)]
|
||||
|
||||
extern crate proc_macro;
|
||||
extern crate proc_macro2;
|
||||
|
|
@ -177,7 +178,7 @@ struct Invoc {
|
|||
}
|
||||
|
||||
impl syn::parse::Parse for Invoc {
|
||||
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
|
||||
fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
|
||||
use syn::{ext::IdentExt, Token};
|
||||
|
||||
let mut instr = String::new();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#![allow(improper_ctypes_definitions)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_features)]
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![feature(
|
||||
asm,
|
||||
const_fn,
|
||||
|
|
@ -68,9 +69,6 @@ extern crate std;
|
|||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
extern crate std_detect;
|
||||
#[cfg(test)]
|
||||
extern crate stdarch_test;
|
||||
|
||||
#[path = "mod.rs"]
|
||||
mod core_arch;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use crate::core_arch::x86::__m256i;
|
|||
use crate::core_arch::x86::__m512i;
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::stdarch_test::assert_instr;
|
||||
use stdarch_test::assert_instr;
|
||||
|
||||
#[allow(improper_ctypes)]
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ mod tests {
|
|||
}
|
||||
|
||||
impl fmt::Debug for FxsaveArea {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "[")?;
|
||||
for i in 0..self.data.len() {
|
||||
write!(f, "{}", self.data[i])?;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
use crate::core_arch::x86::__m128i;
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::stdarch_test::assert_instr;
|
||||
use stdarch_test::assert_instr;
|
||||
|
||||
#[allow(improper_ctypes)]
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ mod tests {
|
|||
}
|
||||
|
||||
impl fmt::Debug for XsaveArea {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "[")?;
|
||||
for i in 0..self.data.len() {
|
||||
write!(f, "{}", self.data[i])?;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ mod tests {
|
|||
}
|
||||
|
||||
impl fmt::Debug for FxsaveArea {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "[")?;
|
||||
for i in 0..self.data.len() {
|
||||
write!(f, "{}", self.data[i])?;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ mod tests {
|
|||
}
|
||||
|
||||
impl fmt::Debug for XsaveArea {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "[")?;
|
||||
for i in 0..self.data.len() {
|
||||
write!(f, "{}", self.data[i])?;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
//!
|
||||
//! This macro expands to a `#[test]` function which tests the local machine
|
||||
//! for the appropriate cfg before calling the inner test function.
|
||||
#![deny(rust_2018_idioms)]
|
||||
|
||||
extern crate proc_macro;
|
||||
extern crate proc_macro2;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ impl CpuInfo {
|
|||
})
|
||||
}
|
||||
/// Returns the value of the cpuinfo `field`.
|
||||
pub(crate) fn field(&self, field: &str) -> CpuInfoField {
|
||||
pub(crate) fn field(&self, field: &str) -> CpuInfoField<'_> {
|
||||
for l in self.raw.lines() {
|
||||
if l.trim().starts_with(field) {
|
||||
return CpuInfoField::new(l.split(": ").nth(1));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#![unstable(feature = "stdsimd", issue = "27731")]
|
||||
#![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)]
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(clippy::shadow_reuse)]
|
||||
#![deny(clippy::missing_inline_in_public_items)]
|
||||
#![cfg_attr(all(target_os = "freebsd", target_arch = "aarch64"), feature(asm))]
|
||||
|
|
@ -20,7 +21,8 @@
|
|||
#![cfg_attr(feature = "std_detect_file_io", feature(vec_spare_capacity))]
|
||||
#![no_std]
|
||||
|
||||
#[cfg_attr(feature = "rustc-dep-of-std", allow(unused_extern_crates))]
|
||||
// rust-lang/rust#83888: removing `extern crate` gives an error that `vec_spare_capacity` is unknown
|
||||
#[cfg_attr(feature = "std_detect_file_io", allow(unused_extern_crates))]
|
||||
#[cfg(feature = "std_detect_file_io")]
|
||||
extern crate alloc;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
//! output once globally and then provides the `assert` function which makes
|
||||
//! assertions about the disassembly of a function.
|
||||
#![feature(test)] // For black_box
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(clippy::missing_docs_in_private_items, clippy::print_stdout)]
|
||||
|
||||
extern crate assert_instr_macro;
|
||||
extern crate cc;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate rustc_demangle;
|
||||
extern crate simd_test_macro;
|
||||
#[macro_use]
|
||||
extern crate cfg_if;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
extern crate proc_macro;
|
||||
extern crate proc_macro2;
|
||||
#![deny(rust_2018_idioms)]
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
#[macro_use]
|
||||
|
|
@ -357,7 +356,7 @@ fn find_instrs(attrs: &[syn::Attribute]) -> Vec<String> {
|
|||
// TODO: should probably just reuse `Invoc` from the `assert-instr-macro`
|
||||
// crate.
|
||||
impl syn::parse::Parse for AssertInstr {
|
||||
fn parse(content: syn::parse::ParseStream) -> syn::Result<Self> {
|
||||
fn parse(content: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
|
||||
let input;
|
||||
parenthesized!(input in content);
|
||||
let _ = input.parse::<syn::Meta>()?;
|
||||
|
|
@ -443,7 +442,7 @@ struct RustcArgsRequiredConst {
|
|||
}
|
||||
|
||||
impl syn::parse::Parse for RustcArgsRequiredConst {
|
||||
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
|
||||
fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
|
||||
let content;
|
||||
parenthesized!(content in input);
|
||||
let list =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue