Skip to content

Commit 30448e8

Browse files
committed
Auto merge of #10871 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 50ab3ce + 84f8ce8 commit 30448e8

37 files changed

+137
-355
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.71"
3+
version = "0.1.72"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_lints"
3-
version = "0.1.71"
3+
version = "0.1.72"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_lints/src/casts/cast_ref_to_mut.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

clippy_lints/src/casts/mod.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ mod cast_possible_truncation;
99
mod cast_possible_wrap;
1010
mod cast_precision_loss;
1111
mod cast_ptr_alignment;
12-
mod cast_ref_to_mut;
1312
mod cast_sign_loss;
1413
mod cast_slice_different_sizes;
1514
mod cast_slice_from_raw_parts;
@@ -331,41 +330,6 @@ declare_clippy_lint! {
331330
"casting a function pointer to any integer type"
332331
}
333332

334-
declare_clippy_lint! {
335-
/// ### What it does
336-
/// Checks for casts of `&T` to `&mut T` anywhere in the code.
337-
///
338-
/// ### Why is this bad?
339-
/// It’s basically guaranteed to be undefined behavior.
340-
/// `UnsafeCell` is the only way to obtain aliasable data that is considered
341-
/// mutable.
342-
///
343-
/// ### Example
344-
/// ```rust,ignore
345-
/// fn x(r: &i32) {
346-
/// unsafe {
347-
/// *(r as *const _ as *mut _) += 1;
348-
/// }
349-
/// }
350-
/// ```
351-
///
352-
/// Instead consider using interior mutability types.
353-
///
354-
/// ```rust
355-
/// use std::cell::UnsafeCell;
356-
///
357-
/// fn x(r: &UnsafeCell<i32>) {
358-
/// unsafe {
359-
/// *r.get() += 1;
360-
/// }
361-
/// }
362-
/// ```
363-
#[clippy::version = "1.33.0"]
364-
pub CAST_REF_TO_MUT,
365-
correctness,
366-
"a cast of reference to a mutable pointer"
367-
}
368-
369333
declare_clippy_lint! {
370334
/// ### What it does
371335
/// Checks for expressions where a character literal is cast
@@ -709,7 +673,6 @@ impl_lint_pass!(Casts => [
709673
CAST_POSSIBLE_TRUNCATION,
710674
CAST_POSSIBLE_WRAP,
711675
CAST_LOSSLESS,
712-
CAST_REF_TO_MUT,
713676
CAST_PTR_ALIGNMENT,
714677
CAST_SLICE_DIFFERENT_SIZES,
715678
UNNECESSARY_CAST,
@@ -778,7 +741,6 @@ impl<'tcx> LateLintPass<'tcx> for Casts {
778741
}
779742
}
780743

781-
cast_ref_to_mut::check(cx, expr);
782744
cast_ptr_alignment::check(cx, expr);
783745
char_lit_as_u8::check(cx, expr);
784746
ptr_as_ptr::check(cx, expr, &self.msrv);

clippy_lints/src/declared_lints.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
8181
crate::casts::CAST_POSSIBLE_WRAP_INFO,
8282
crate::casts::CAST_PRECISION_LOSS_INFO,
8383
crate::casts::CAST_PTR_ALIGNMENT_INFO,
84-
crate::casts::CAST_REF_TO_MUT_INFO,
8584
crate::casts::CAST_SIGN_LOSS_INFO,
8685
crate::casts::CAST_SLICE_DIFFERENT_SIZES_INFO,
8786
crate::casts::CAST_SLICE_FROM_RAW_PARTS_INFO,
@@ -213,7 +212,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
213212
crate::instant_subtraction::UNCHECKED_DURATION_SUBTRACTION_INFO,
214213
crate::int_plus_one::INT_PLUS_ONE_INFO,
215214
crate::invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS_INFO,
216-
crate::invalid_utf8_in_unchecked::INVALID_UTF8_IN_UNCHECKED_INFO,
217215
crate::items_after_statements::ITEMS_AFTER_STATEMENTS_INFO,
218216
crate::items_after_test_module::ITEMS_AFTER_TEST_MODULE_INFO,
219217
crate::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR_INFO,

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
12191219
return false;
12201220
}
12211221

1222-
let predicate = EarlyBinder(predicate).subst(cx.tcx, &substs_with_referent_ty);
1222+
let predicate = EarlyBinder::bind(predicate).subst(cx.tcx, &substs_with_referent_ty);
12231223
let obligation = Obligation::new(cx.tcx, ObligationCause::dummy(), cx.param_env, predicate);
12241224
let infcx = cx.tcx.infer_ctxt().build();
12251225
infcx.predicate_must_hold_modulo_regions(&obligation)

clippy_lints/src/drop_forget_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetRef {
9898
let is_copy = is_copy(cx, arg_ty);
9999
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
100100
let (lint, msg) = match fn_name {
101-
// early return for uplifted lints: drop_ref, drop_copy, forget_ref, forget_copy
101+
// early return for uplifted lints: dropping_references, dropping_copy_types, forgetting_references, forgetting_copy_types
102102
sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return,
103103
sym::mem_forget if arg_ty.is_ref() => return,
104104
sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return,

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn get_ufcs_type_name<'tcx>(cx: &LateContext<'tcx>, method_def_id: DefId, substs
243243
| ty::Ref(..)
244244
| ty::Slice(_)
245245
| ty::Tuple(_) => {
246-
format!("<{}>", EarlyBinder(ty).subst(cx.tcx, substs))
246+
format!("<{}>", EarlyBinder::bind(ty).subst(cx.tcx, substs))
247247
},
248248
_ => ty.to_string(),
249249
}

clippy_lints/src/invalid_utf8_in_unchecked.rs

Lines changed: 0 additions & 74 deletions
This file was deleted.

clippy_lints/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ mod inline_fn_without_body;
157157
mod instant_subtraction;
158158
mod int_plus_one;
159159
mod invalid_upcast_comparisons;
160-
mod invalid_utf8_in_unchecked;
161160
mod items_after_statements;
162161
mod items_after_test_module;
163162
mod iter_not_returning_iterator;
@@ -952,7 +951,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
952951
store.register_late_pass(move |_| Box::new(manual_retain::ManualRetain::new(msrv())));
953952
let verbose_bit_mask_threshold = conf.verbose_bit_mask_threshold;
954953
store.register_late_pass(move |_| Box::new(operators::Operators::new(verbose_bit_mask_threshold)));
955-
store.register_late_pass(|_| Box::new(invalid_utf8_in_unchecked::InvalidUtf8InUnchecked));
956954
store.register_late_pass(|_| Box::<std_instead_of_core::StdReexports>::default());
957955
store.register_late_pass(move |_| Box::new(instant_subtraction::InstantSubtraction::new(msrv())));
958956
store.register_late_pass(|_| Box::new(partialeq_to_none::PartialeqToNone));

0 commit comments

Comments
 (0)