Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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
}

0 commit comments

Comments
 (0)