cargo clippy --fix

This commit is contained in:
Johann Hemmann 2024-01-18 13:59:49 +01:00
parent 1ab8c7fd27
commit fad4fa163c
178 changed files with 595 additions and 738 deletions

View file

@ -80,7 +80,7 @@ pub fn layout_of_adt_query(
matches!(def, AdtId::EnumId(..)),
is_unsafe_cell(db, def),
layout_scalar_valid_range(db, def),
|min, max| repr_discr(&dl, &repr, min, max).unwrap_or((Integer::I8, false)),
|min, max| repr_discr(dl, &repr, min, max).unwrap_or((Integer::I8, false)),
variants.iter_enumerated().filter_map(|(id, _)| {
let AdtId::EnumId(e) = def else { return None };
let d = db.const_eval_discriminant(db.enum_data(e).variants[id.0].0).ok()?;

View file

@ -12,7 +12,7 @@ pub fn target_data_layout_query(
) -> Option<Arc<TargetDataLayout>> {
let crate_graph = db.crate_graph();
let target_layout = crate_graph[krate].target_layout.as_ref().ok()?;
let res = TargetDataLayout::parse_from_llvm_datalayout_string(&target_layout);
let res = TargetDataLayout::parse_from_llvm_datalayout_string(target_layout);
if let Err(_e) = &res {
// FIXME: Print the error here once it implements debug/display
// also logging here is somewhat wrong, but unfortunately this is the earliest place we can

View file

@ -366,11 +366,11 @@ fn return_position_impl_trait() {
}
let waker = Arc::new(EmptyWaker).into();
let mut context = Context::from_waker(&waker);
let x = pinned.poll(&mut context);
x
pinned.poll(&mut context)
}
let x = unwrap_fut(f());
x
unwrap_fut(f())
}
size_and_align_expr! {
struct Foo<T>(T, T, (T, T));

View file

@ -36,7 +36,7 @@ fn ref_simple() {
let mut y: i32 = 5;
]
|x: i32| {
y = y + x;
y += x;
y
}
}
@ -66,7 +66,7 @@ fn ref_simple() {
let x: &mut X = &mut X(2, 6);
]
|| {
(*x).0 as i64 + x.1
x.0 as i64 + x.1
}
}
}
@ -188,9 +188,7 @@ fn match_pattern() {
struct X(i64, i32, (u8, i128));
let _y: X = X(2, 5, (7, 3));
move |x: i64| {
match _y {
_ => x,
}
x
}
}
size_and_align_expr! {
@ -264,8 +262,8 @@ fn regression_15623() {
let c = 5;
move || {
let 0 = a else { return b; };
let y = c;
y
c
}
}
}