Skip to content

Commit fd464d5

Browse files
authored
Merge pull request rust-lang#4492 from rust-lang/rustup-2025-07-25
Automatic Rustup
2 parents c8a04ec + fb33cd1 commit fd464d5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

clippy_lints/src/macro_use.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ use rustc_hir::{self as hir, AmbigArg};
77
use rustc_lint::{LateContext, LateLintPass, LintContext};
88
use rustc_session::impl_lint_pass;
99
use rustc_span::edition::Edition;
10-
use rustc_span::{Span, sym};
10+
use rustc_span::{Span};
1111
use std::collections::BTreeMap;
12+
use rustc_attr_data_structures::{AttributeKind, find_attr};
1213

1314
declare_clippy_lint! {
1415
/// ### What it does
@@ -99,15 +100,14 @@ impl LateLintPass<'_> for MacroUseImports {
99100
&& let hir::ItemKind::Use(path, _kind) = &item.kind
100101
&& let hir_id = item.hir_id()
101102
&& let attrs = cx.tcx.hir_attrs(hir_id)
102-
&& let Some(mac_attr) = attrs.iter().find(|attr| attr.has_name(sym::macro_use))
103+
&& let Some(mac_attr_span) = find_attr!(attrs, AttributeKind::MacroUse {span, ..} => *span)
103104
&& let Some(Res::Def(DefKind::Mod, id)) = path.res.type_ns
104105
&& !id.is_local()
105106
{
106107
for kid in cx.tcx.module_children(id) {
107108
if let Res::Def(DefKind::Macro(_mac_type), mac_id) = kid.res {
108-
let span = mac_attr.span();
109109
let def_path = cx.tcx.def_path_str(mac_id);
110-
self.imports.push((def_path, span, hir_id));
110+
self.imports.push((def_path, mac_attr_span, hir_id));
111111
}
112112
}
113113
} else if item.span.from_expansion() {

clippy_lints/src/non_copy_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl<'tcx> NonCopyConst<'tcx> {
338338
tcx: TyCtxt<'tcx>,
339339
typing_env: TypingEnv<'tcx>,
340340
ty: Ty<'tcx>,
341-
val: ConstValue<'tcx>,
341+
val: ConstValue,
342342
) -> Result<bool, ()> {
343343
let ty = tcx.try_normalize_erasing_regions(typing_env, ty).unwrap_or(ty);
344344
match self.is_ty_freeze(tcx, typing_env, ty) {
@@ -477,7 +477,7 @@ impl<'tcx> NonCopyConst<'tcx> {
477477
typing_env: TypingEnv<'tcx>,
478478
typeck: &'tcx TypeckResults<'tcx>,
479479
mut src_expr: &'tcx Expr<'tcx>,
480-
mut val: ConstValue<'tcx>,
480+
mut val: ConstValue,
481481
) -> Result<Option<BorrowSource<'tcx>>, ()> {
482482
let mut parents = tcx.hir_parent_iter(src_expr.hir_id);
483483
let mut ty = typeck.expr_ty(src_expr);

clippy_lints/src/unused_trait_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedTraitNames {
6565
&& ident.name != kw::Underscore
6666
// Only check traits
6767
&& let Some(Res::Def(DefKind::Trait, _)) = path.res.type_ns
68-
&& cx.tcx.maybe_unused_trait_imports(()).contains(&item.owner_id.def_id)
68+
&& cx.tcx.resolutions(()).maybe_unused_trait_imports.contains(&item.owner_id.def_id)
6969
// Only check this import if it is visible to its module only (no pub, pub(crate), ...)
7070
&& let module = cx.tcx.parent_module_from_def_id(item.owner_id.def_id)
7171
&& cx.tcx.visibility(item.owner_id.def_id) == Visibility::Restricted(module.to_def_id())

tests/ui/checked_unwrap/simple_conditionals.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ error: creating a shared reference to mutable static
328328
LL | if X.is_some() {
329329
| ^^^^^^^^^^^ shared reference to mutable static
330330
|
331-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
331+
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
332332
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
333333
= note: `#[deny(static_mut_refs)]` on by default
334334

0 commit comments

Comments
 (0)