Skip to content

Commit b7f3f7f

Browse files
committed
Auto merge of rust-lang#7783 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` Finally an easy, conflict free rustup again 🎉 changelog: none
2 parents 01ea06a + 8f9ef87 commit b7f3f7f

File tree

116 files changed

+256
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+256
-254
lines changed

clippy_lints/src/booleans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ fn simplify_not(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<String> {
260260
},
261261
ExprKind::MethodCall(path, _, args, _) if args.len() == 1 => {
262262
let type_of_receiver = cx.typeck_results().expr_ty(&args[0]);
263-
if !is_type_diagnostic_item(cx, type_of_receiver, sym::option_type)
264-
&& !is_type_diagnostic_item(cx, type_of_receiver, sym::result_type)
263+
if !is_type_diagnostic_item(cx, type_of_receiver, sym::Option)
264+
&& !is_type_diagnostic_item(cx, type_of_receiver, sym::Result)
265265
{
266266
return None;
267267
}

clippy_lints/src/cargo_common_metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! lint on missing cargo common metadata
22
33
use clippy_utils::{diagnostics::span_lint, is_lint_allowed};
4-
use rustc_hir::{hir_id::CRATE_HIR_ID, Crate};
4+
use rustc_hir::hir_id::CRATE_HIR_ID;
55
use rustc_lint::{LateContext, LateLintPass};
66
use rustc_session::{declare_tool_lint, impl_lint_pass};
77
use rustc_span::source_map::DUMMY_SP;
@@ -77,7 +77,7 @@ fn is_empty_vec(value: &[String]) -> bool {
7777
}
7878

7979
impl LateLintPass<'_> for CargoCommonMetadata {
80-
fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
80+
fn check_crate(&mut self, cx: &LateContext<'_>) {
8181
if is_lint_allowed(cx, CARGO_COMMON_METADATA, CRATE_HIR_ID) {
8282
return;
8383
}

clippy_lints/src/case_sensitive_file_extension_comparisons.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &
5555
return Some(span);
5656
},
5757
ty::Adt(&ty::AdtDef { did, .. }, _) => {
58-
if ctx.tcx.is_diagnostic_item(sym::string_type, did) {
58+
if ctx.tcx.is_diagnostic_item(sym::String, did) {
5959
return Some(span);
6060
}
6161
},

clippy_lints/src/cognitive_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl CognitiveComplexity {
6767
helper.visit_expr(expr);
6868
let CcHelper { cc, returns } = helper;
6969
let ret_ty = cx.typeck_results().node_type(expr.hir_id);
70-
let ret_adjust = if is_type_diagnostic_item(cx, ret_ty, sym::result_type) {
70+
let ret_adjust = if is_type_diagnostic_item(cx, ret_ty, sym::Result) {
7171
returns
7272
} else {
7373
#[allow(clippy::integer_division)]

clippy_lints/src/disallowed_method.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::fn_def_id;
33

4-
use rustc_hir::{def::Res, def_id::DefIdMap, Crate, Expr};
4+
use rustc_hir::{def::Res, def_id::DefIdMap, Expr};
55
use rustc_lint::{LateContext, LateLintPass};
66
use rustc_session::{declare_tool_lint, impl_lint_pass};
77

@@ -70,7 +70,7 @@ impl DisallowedMethod {
7070
impl_lint_pass!(DisallowedMethod => [DISALLOWED_METHOD]);
7171

7272
impl<'tcx> LateLintPass<'tcx> for DisallowedMethod {
73-
fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
73+
fn check_crate(&mut self, cx: &LateContext<'_>) {
7474
for conf in &self.conf_disallowed {
7575
let (path, reason) = match conf {
7676
conf::DisallowedMethod::Simple(path) => (path, None),

clippy_lints/src/disallowed_type.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint;
22

33
use rustc_data_structures::fx::FxHashSet;
44
use rustc_hir::{
5-
def::Res, def_id::DefId, Crate, Item, ItemKind, PolyTraitRef, PrimTy, TraitBoundModifier, Ty, TyKind, UseKind,
5+
def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, TraitBoundModifier, Ty, TyKind, UseKind,
66
};
77
use rustc_lint::{LateContext, LateLintPass};
88
use rustc_session::{declare_tool_lint, impl_lint_pass};
@@ -75,7 +75,7 @@ impl DisallowedType {
7575
impl_lint_pass!(DisallowedType => [DISALLOWED_TYPE]);
7676

7777
impl<'tcx> LateLintPass<'tcx> for DisallowedType {
78-
fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
78+
fn check_crate(&mut self, cx: &LateContext<'_>) {
7979
for path in &self.disallowed {
8080
let segs = path.iter().map(ToString::to_string).collect::<Vec<_>>();
8181
match clippy_utils::path_to_res(cx, &segs.iter().map(String::as_str).collect::<Vec<_>>()) {

clippy_lints/src/doc.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl_lint_pass!(DocMarkdown =>
212212
);
213213

214214
impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
215-
fn check_crate(&mut self, cx: &LateContext<'tcx>, _: &'tcx hir::Crate<'_>) {
215+
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
216216
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
217217
check_attrs(cx, &self.valid_idents, attrs);
218218
}
@@ -317,7 +317,7 @@ fn lint_for_missing_headers<'tcx>(
317317
}
318318
if !headers.errors {
319319
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
320-
if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym::result_type) {
320+
if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym::Result) {
321321
span_lint(
322322
cx,
323323
MISSING_ERRORS_DOC,
@@ -335,7 +335,7 @@ fn lint_for_missing_headers<'tcx>(
335335
if let ty::Opaque(_, subs) = ret_ty.kind();
336336
if let Some(gen) = subs.types().next();
337337
if let ty::Generator(_, subs, _) = gen.kind();
338-
if is_type_diagnostic_item(cx, subs.as_generator().return_ty(), sym::result_type);
338+
if is_type_diagnostic_item(cx, subs.as_generator().return_ty(), sym::Result);
339339
then {
340340
span_lint(
341341
cx,
@@ -782,8 +782,8 @@ impl<'a, 'tcx> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
782782
// check for `unwrap`
783783
if let Some(arglists) = method_chain_args(expr, &["unwrap"]) {
784784
let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs();
785-
if is_type_diagnostic_item(self.cx, reciever_ty, sym::option_type)
786-
|| is_type_diagnostic_item(self.cx, reciever_ty, sym::result_type)
785+
if is_type_diagnostic_item(self.cx, reciever_ty, sym::Option)
786+
|| is_type_diagnostic_item(self.cx, reciever_ty, sym::Result)
787787
{
788788
self.panic_span = Some(expr.span);
789789
}

clippy_lints/src/fallible_impl_from.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'tcx> LateLintPass<'tcx> for FallibleImplFrom {
5757
if_chain! {
5858
if let hir::ItemKind::Impl(impl_) = &item.kind;
5959
if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(item.def_id);
60-
if cx.tcx.is_diagnostic_item(sym::from_trait, impl_trait_ref.def_id);
60+
if cx.tcx.is_diagnostic_item(sym::From, impl_trait_ref.def_id);
6161
then {
6262
lint_impl_body(cx, item.span, impl_.items);
6363
}
@@ -94,8 +94,8 @@ fn lint_impl_body<'tcx>(cx: &LateContext<'tcx>, impl_span: Span, impl_items: &[h
9494
// check for `unwrap`
9595
if let Some(arglists) = method_chain_args(expr, &["unwrap"]) {
9696
let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs();
97-
if is_type_diagnostic_item(self.lcx, reciever_ty, sym::option_type)
98-
|| is_type_diagnostic_item(self.lcx, reciever_ty, sym::result_type)
97+
if is_type_diagnostic_item(self.lcx, reciever_ty, sym::Option)
98+
|| is_type_diagnostic_item(self.lcx, reciever_ty, sym::Result)
9999
{
100100
self.result.push(expr.span);
101101
}

clippy_lints/src/feature_name.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
22
use clippy_utils::{diagnostics::span_lint, is_lint_allowed};
3-
use rustc_hir::{Crate, CRATE_HIR_ID};
3+
use rustc_hir::CRATE_HIR_ID;
44
use rustc_lint::{LateContext, LateLintPass};
55
use rustc_session::{declare_lint_pass, declare_tool_lint};
66
use rustc_span::source_map::DUMMY_SP;
@@ -110,7 +110,7 @@ fn lint(cx: &LateContext<'_>, feature: &str, substring: &str, is_prefix: bool) {
110110
}
111111

112112
impl LateLintPass<'_> for FeatureName {
113-
fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
113+
fn check_crate(&mut self, cx: &LateContext<'_>) {
114114
if is_lint_allowed(cx, REDUNDANT_FEATURE_NAMES, CRATE_HIR_ID)
115115
&& is_lint_allowed(cx, NEGATIVE_FEATURE_NAMES, CRATE_HIR_ID)
116116
{

clippy_lints/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessFormat {
6565
if_chain! {
6666
if format_args.format_string_symbols == [kw::Empty];
6767
if match cx.typeck_results().expr_ty(value).peel_refs().kind() {
68-
ty::Adt(adt, _) => cx.tcx.is_diagnostic_item(sym::string_type, adt.did),
68+
ty::Adt(adt, _) => cx.tcx.is_diagnostic_item(sym::String, adt.did),
6969
ty::Str => true,
7070
_ => false,
7171
};
@@ -112,7 +112,7 @@ fn is_display_arg(expr: &Expr<'_>) -> bool {
112112
if let ExprKind::Call(_, [_, fmt]) = expr.kind;
113113
if let ExprKind::Path(QPath::Resolved(_, path)) = fmt.kind;
114114
if let [.., t, _] = path.segments;
115-
if t.ident.name.as_str() == "Display";
115+
if t.ident.name == sym::Display;
116116
then { true } else { false }
117117
}
118118
}

clippy_lints/src/from_over_into.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl LateLintPass<'_> for FromOverInto {
6161
if_chain! {
6262
if let hir::ItemKind::Impl{ .. } = &item.kind;
6363
if let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(item.def_id);
64-
if cx.tcx.is_diagnostic_item(sym::into_trait, impl_trait_ref.def_id);
64+
if cx.tcx.is_diagnostic_item(sym::Into, impl_trait_ref.def_id);
6565

6666
then {
6767
span_lint_and_help(

clippy_lints/src/from_str_radix_10.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ impl LateLintPass<'tcx> for FromStrRadix10 {
9898

9999
/// Checks if a Ty is `String` or `&str`
100100
fn is_ty_stringish(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
101-
is_type_diagnostic_item(cx, ty, sym::string_type) || is_type_diagnostic_item(cx, ty, sym::str)
101+
is_type_diagnostic_item(cx, ty, sym::String) || is_type_diagnostic_item(cx, ty, sym::str)
102102
}

clippy_lints/src/functions/result_unit_err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn check_result_unit_err(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, item_span
4848
if !in_external_macro(cx.sess(), item_span);
4949
if let hir::FnRetTy::Return(ty) = decl.output;
5050
let ty = hir_ty_to_ty(cx.tcx, ty);
51-
if is_type_diagnostic_item(cx, ty, sym::result_type);
51+
if is_type_diagnostic_item(cx, ty, sym::Result);
5252
if let ty::Adt(_, substs) = ty.kind();
5353
let err_ty = substs.type_at(1);
5454
if err_ty.is_unit();

clippy_lints/src/future_not_send.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
7575
}
7676
}
7777
if is_future {
78-
let send_trait = cx.tcx.get_diagnostic_item(sym::send_trait).unwrap();
78+
let send_trait = cx.tcx.get_diagnostic_item(sym::Send).unwrap();
7979
let span = decl.output.span();
8080
let send_result = cx.tcx.infer_ctxt().enter(|infcx| {
8181
let cause = traits::ObligationCause::misc(span, hir_id);

clippy_lints/src/get_last_with_len.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<'tcx> LateLintPass<'tcx> for GetLastWithLen {
5858
// Argument 0 (the struct we're calling the method on) is a vector
5959
if let Some(struct_calling_on) = args.get(0);
6060
let struct_ty = cx.typeck_results().expr_ty(struct_calling_on);
61-
if is_type_diagnostic_item(cx, struct_ty, sym::vec_type);
61+
if is_type_diagnostic_item(cx, struct_ty, sym::Vec);
6262

6363
// Argument to "get" is a subtraction
6464
if let Some(get_index_arg) = args.get(1);

clippy_lints/src/if_let_mutex.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_hir::{Expr, ExprKind};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_middle::hir::map::Map;
1010
use rustc_session::{declare_lint_pass, declare_tool_lint};
11+
use rustc_span::sym;
1112

1213
declare_clippy_lint! {
1314
/// ### What it does
@@ -141,7 +142,7 @@ fn is_mutex_lock_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Opt
141142
if let ExprKind::MethodCall(path, _span, [self_arg, ..], _) = &expr.kind;
142143
if path.ident.as_str() == "lock";
143144
let ty = cx.typeck_results().expr_ty(self_arg);
144-
if is_type_diagnostic_item(cx, ty, sym!(mutex_type));
145+
if is_type_diagnostic_item(cx, ty, sym::Mutex);
145146
then {
146147
Some(self_arg)
147148
} else {

clippy_lints/src/implicit_hasher.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ impl<'tcx> ImplicitHasherType<'tcx> {
233233

234234
let ty = hir_ty_to_ty(cx.tcx, hir_ty);
235235

236-
if is_type_diagnostic_item(cx, ty, sym::hashmap_type) && params_len == 2 {
236+
if is_type_diagnostic_item(cx, ty, sym::HashMap) && params_len == 2 {
237237
Some(ImplicitHasherType::HashMap(
238238
hir_ty.span,
239239
ty,
240240
snippet(cx, params[0].span, "K"),
241241
snippet(cx, params[1].span, "V"),
242242
))
243-
} else if is_type_diagnostic_item(cx, ty, sym::hashset_type) && params_len == 1 {
243+
} else if is_type_diagnostic_item(cx, ty, sym::HashSet) && params_len == 1 {
244244
Some(ImplicitHasherType::HashSet(
245245
hir_ty.span,
246246
ty,
@@ -355,7 +355,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 't
355355
return;
356356
}
357357

358-
if self.cx.tcx.is_diagnostic_item(sym::hashmap_type, ty_did) {
358+
if self.cx.tcx.is_diagnostic_item(sym::HashMap, ty_did) {
359359
if method.ident.name == sym::new {
360360
self.suggestions
361361
.insert(e.span, "HashMap::default()".to_string());
@@ -368,7 +368,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 't
368368
),
369369
);
370370
}
371-
} else if self.cx.tcx.is_diagnostic_item(sym::hashset_type, ty_did) {
371+
} else if self.cx.tcx.is_diagnostic_item(sym::HashSet, ty_did) {
372372
if method.ident.name == sym::new {
373373
self.suggestions
374374
.insert(e.span, "HashSet::default()".to_string());

clippy_lints/src/infinite_iter.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ const INFINITE_COLLECTORS: &[Symbol] = &[
210210
sym::BinaryHeap,
211211
sym::BTreeMap,
212212
sym::BTreeSet,
213-
sym::hashmap_type,
214-
sym::hashset_type,
213+
sym::HashMap,
214+
sym::HashSet,
215215
sym::LinkedList,
216-
sym::vec_type,
217-
sym::vecdeque_type,
216+
sym::Vec,
217+
sym::VecDeque,
218218
];
219219

220220
fn complete_infinite_iter(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {

clippy_lints/src/inherent_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use clippy_utils::diagnostics::span_lint_and_note;
44
use clippy_utils::{in_macro, is_lint_allowed};
55
use rustc_data_structures::fx::FxHashMap;
6-
use rustc_hir::{def_id::LocalDefId, Crate, Item, ItemKind, Node};
6+
use rustc_hir::{def_id::LocalDefId, Item, ItemKind, Node};
77
use rustc_lint::{LateContext, LateLintPass};
88
use rustc_session::{declare_lint_pass, declare_tool_lint};
99
use rustc_span::Span;
@@ -44,7 +44,7 @@ declare_clippy_lint! {
4444
declare_lint_pass!(MultipleInherentImpl => [MULTIPLE_INHERENT_IMPL]);
4545

4646
impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
47-
fn check_crate_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Crate<'_>) {
47+
fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
4848
// Map from a type to it's first impl block. Needed to distinguish generic arguments.
4949
// e.g. `Foo<Bar>` and `Foo<Baz>`
5050
let mut type_map = FxHashMap::default();

clippy_lints/src/inherent_to_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'tcx> LateLintPass<'tcx> for InherentToString {
111111
if impl_item.generics.params.is_empty();
112112

113113
// Check if return type is String
114-
if is_type_diagnostic_item(cx, return_ty(cx, impl_item.hir_id()), sym::string_type);
114+
if is_type_diagnostic_item(cx, return_ty(cx, impl_item.hir_id()), sym::String);
115115

116116
// Filters instances of to_string which are required by a trait
117117
if trait_ref_of_method(cx, impl_item.hir_id()).is_none();

clippy_lints/src/len_zero.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ enum LenOutput<'tcx> {
245245
fn parse_len_output(cx: &LateContext<'_>, sig: FnSig<'tcx>) -> Option<LenOutput<'tcx>> {
246246
match *sig.output().kind() {
247247
ty::Int(_) | ty::Uint(_) => Some(LenOutput::Integral),
248-
ty::Adt(adt, subs) if cx.tcx.is_diagnostic_item(sym::option_type, adt.did) => {
248+
ty::Adt(adt, subs) if cx.tcx.is_diagnostic_item(sym::Option, adt.did) => {
249249
subs.type_at(0).is_integral().then(|| LenOutput::Option(adt.did))
250250
},
251-
ty::Adt(adt, subs) if cx.tcx.is_diagnostic_item(sym::result_type, adt.did) => subs
251+
ty::Adt(adt, subs) if cx.tcx.is_diagnostic_item(sym::Result, adt.did) => subs
252252
.type_at(0)
253253
.is_integral()
254254
.then(|| LenOutput::Result(adt.did, subs.type_at(1))),

clippy_lints/src/loops/explicit_iter_loop.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ fn is_ref_iterable_type(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
5454
// will allow further borrows afterwards
5555
let ty = cx.typeck_results().expr_ty(e);
5656
is_iterable_array(ty, cx) ||
57-
is_type_diagnostic_item(cx, ty, sym::vec_type) ||
57+
is_type_diagnostic_item(cx, ty, sym::Vec) ||
5858
is_type_diagnostic_item(cx, ty, sym::LinkedList) ||
59-
is_type_diagnostic_item(cx, ty, sym::hashmap_type) ||
60-
is_type_diagnostic_item(cx, ty, sym::hashset_type) ||
61-
is_type_diagnostic_item(cx, ty, sym::vecdeque_type) ||
59+
is_type_diagnostic_item(cx, ty, sym::HashMap) ||
60+
is_type_diagnostic_item(cx, ty, sym::HashSet) ||
61+
is_type_diagnostic_item(cx, ty, sym::VecDeque) ||
6262
is_type_diagnostic_item(cx, ty, sym::BinaryHeap) ||
6363
is_type_diagnostic_item(cx, ty, sym::BTreeMap) ||
6464
is_type_diagnostic_item(cx, ty, sym::BTreeSet)

clippy_lints/src/loops/for_kv_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, arg: &'tcx
3333
_ => arg,
3434
};
3535

36-
if is_type_diagnostic_item(cx, ty, sym::hashmap_type) || is_type_diagnostic_item(cx, ty, sym::BTreeMap) {
36+
if is_type_diagnostic_item(cx, ty, sym::HashMap) || is_type_diagnostic_item(cx, ty, sym::BTreeMap) {
3737
span_lint_and_then(
3838
cx,
3939
FOR_KV_MAP,

clippy_lints/src/loops/for_loops_over_fallibles.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::symbol::sym;
99
/// Checks for `for` loops over `Option`s and `Result`s.
1010
pub(super) fn check(cx: &LateContext<'_>, pat: &Pat<'_>, arg: &Expr<'_>) {
1111
let ty = cx.typeck_results().expr_ty(arg);
12-
if is_type_diagnostic_item(cx, ty, sym::option_type) {
12+
if is_type_diagnostic_item(cx, ty, sym::Option) {
1313
span_lint_and_help(
1414
cx,
1515
FOR_LOOPS_OVER_FALLIBLES,
@@ -26,7 +26,7 @@ pub(super) fn check(cx: &LateContext<'_>, pat: &Pat<'_>, arg: &Expr<'_>) {
2626
snippet(cx, arg.span, "_")
2727
),
2828
);
29-
} else if is_type_diagnostic_item(cx, ty, sym::result_type) {
29+
} else if is_type_diagnostic_item(cx, ty, sym::Result) {
3030
span_lint_and_help(
3131
cx,
3232
FOR_LOOPS_OVER_FALLIBLES,

clippy_lints/src/loops/manual_memcpy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fn is_slice_like<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'_>) -> bool {
329329
_ => false,
330330
};
331331

332-
is_slice || is_type_diagnostic_item(cx, ty, sym::vec_type) || is_type_diagnostic_item(cx, ty, sym::vecdeque_type)
332+
is_slice || is_type_diagnostic_item(cx, ty, sym::Vec) || is_type_diagnostic_item(cx, ty, sym::VecDeque)
333333
}
334334

335335
fn fetch_cloned_expr<'tcx>(expr: &'tcx Expr<'tcx>) -> &'tcx Expr<'tcx> {

0 commit comments

Comments
 (0)