Skip to content

Commit

Permalink
Auto merge of #13374 - cuishuang:master, r=Centri3
Browse files Browse the repository at this point in the history
Remove unnecessary symbols and add missing symbols

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: Remove unnecessary symbols and add missing symbols
  • Loading branch information
bors committed Sep 9, 2024
2 parents 0ee2650 + b0db9c2 commit 1e797e9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/unnecessary_to_owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ fn check_if_applicable_to_argument<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'tcx
// check that:
// 1. This is a method with only one argument that doesn't come from a trait.
// 2. That it has `Borrow` in its generic predicates.
// 3. `Self` is a std "map type" (ie `HashSet`, `HashMap`, BTreeSet`, `BTreeMap`).
// 3. `Self` is a std "map type" (ie `HashSet`, `HashMap`, `BTreeSet`, `BTreeMap`).
fn check_borrow_predicate<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) {
if let ExprKind::MethodCall(_, caller, &[arg], _) = expr.kind
&& let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/crashes/ice-3969.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://github.com/rust-lang/rust-clippy/issues/3969
// used to crash: error: internal compiler error:
// src/librustc_traits/normalize_erasing_regions.rs:43: could not fully normalize `<i32 as
// std::iter::Iterator>::Item test from rustc ./ui/trivial-bounds/trivial-bounds-inconsistent.rs
// std::iter::Iterator>::Item` test from rustc ./ui/trivial-bounds/trivial-bounds-inconsistent.rs

// Check that tautalogically false bounds are accepted, and are used
// in type inference.
Expand All @@ -18,7 +18,7 @@ struct Dst<X: ?Sized> {
struct TwoStrs(str, str)
where
str: Sized;
//~^ ERROR: trait bound str: std::marker::Sized does not depend on any type or lifetim
//~^ ERROR: trait bound str: std::marker::Sized does not depend on any type or lifetime
//~| NOTE: `-D trivial-bounds` implied by `-D warnings`

fn unsized_local()
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/crashes/ice-6251.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// originally from glacier/fixed/77329.rs
// assertion failed: `(left == right) ; different DefIds
// assertion failed: `(left == right)` ; different DefIds
//@no-rustfix
fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
std::iter::empty()
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/floating_point_arithmetic_nostd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![no_std]

// The following should not lint, as the suggested methods `{f16,f32,f64,f128}.mul_add()`
// and ``{f16,f32,f64,f128}::abs()` are not available in no_std
// and `{f16,f32,f64,f128}::abs()` are not available in no_std

pub fn mul_add() {
let a: f64 = 1234.567;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unsafe_removed_from_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::cell::UnsafeCell as TotallySafeCell;
//~| NOTE: `-D clippy::unsafe-removed-from-name` implied by `-D warnings`

use std::cell::UnsafeCell as TotallySafeCellAgain;
//~^ ERROR: removed `unsafe` from the name of `UnsafeCell` in use as `TotallySafeCellAgain
//~^ ERROR: removed `unsafe` from the name of `UnsafeCell` in use as `TotallySafeCellAgain`

// Shouldn't error
use std::cell::RefCell as ProbablyNotUnsafe;
Expand Down

0 comments on commit 1e797e9

Please sign in to comment.