cargo dev fmt

This commit is contained in:
Jacherr 2023-11-08 21:17:40 +00:00
parent b6d56c47f9
commit 483b109e6e
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::{last_path_segment, match_def_path};
use clippy_utils::paths::ALLOCATOR_GLOBAL; use clippy_utils::paths::ALLOCATOR_GLOBAL;
use clippy_utils::source::snippet; use clippy_utils::source::snippet;
use clippy_utils::{last_path_segment, match_def_path};
use rustc_errors::Applicability; use rustc_errors::Applicability;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir, GenericArg, QPath, TyKind}; use rustc_hir::{self as hir, GenericArg, QPath, TyKind};

View File

@ -99,4 +99,4 @@
pub const OPTION_EXPECT: [&str; 4] = ["core", "option", "Option", "expect"]; pub const OPTION_EXPECT: [&str; 4] = ["core", "option", "Option", "expect"];
#[expect(clippy::invalid_paths)] // not sure why it thinks this, it works so #[expect(clippy::invalid_paths)] // not sure why it thinks this, it works so
pub const BOOL_THEN: [&str; 4] = ["core", "bool", "<impl bool>", "then"]; pub const BOOL_THEN: [&str; 4] = ["core", "bool", "<impl bool>", "then"];
pub const ALLOCATOR_GLOBAL: [&str; 3] = ["alloc", "alloc", "Global"]; pub const ALLOCATOR_GLOBAL: [&str; 3] = ["alloc", "alloc", "Global"];

View File

@ -3,7 +3,7 @@
#![allow(dead_code)] #![allow(dead_code)]
#![feature(allocator_api)] #![feature(allocator_api)]
use std::alloc::{Layout, AllocError, Allocator}; use std::alloc::{AllocError, Allocator, Layout};
use std::ptr::NonNull; use std::ptr::NonNull;
struct SizedStruct(i32); struct SizedStruct(i32);
@ -22,7 +22,7 @@ unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
/// The following should trigger the lint /// The following should trigger the lint
mod should_trigger { mod should_trigger {
use super::{SizedStruct, DummyAllocator}; use super::{DummyAllocator, SizedStruct};
const C: Vec<Box<i32>> = Vec::new(); const C: Vec<Box<i32>> = Vec::new();
static S: Vec<Box<i32>> = Vec::new(); static S: Vec<Box<i32>> = Vec::new();
@ -46,7 +46,7 @@ fn allocator_match() -> Vec<Box<i32, DummyAllocator>, DummyAllocator> {
/// The following should not trigger the lint /// The following should not trigger the lint
mod should_not_trigger { mod should_not_trigger {
use super::{BigStruct, UnsizedStruct, DummyAllocator}; use super::{BigStruct, DummyAllocator, UnsizedStruct};
struct C(Vec<Box<UnsizedStruct>>); struct C(Vec<Box<UnsizedStruct>>);
struct D(Vec<Box<BigStruct>>); struct D(Vec<Box<BigStruct>>);