diff --git a/clippy_lints/src/doc/broken_link.rs b/clippy_lints/src/doc/broken_link.rs index 8878fa9180fe..2fa41d83915a 100644 --- a/clippy_lints/src/doc/broken_link.rs +++ b/clippy_lints/src/doc/broken_link.rs @@ -1,6 +1,6 @@ use clippy_utils::diagnostics::span_lint; -use pulldown_cmark::BrokenLink as PullDownBrokenLink; use rustc_lint::LateContext; +use rustc_resolve::rustdoc::pulldown_cmark::BrokenLink as PullDownBrokenLink; use rustc_resolve::rustdoc::{DocFragment, source_span_for_markdown_range}; use rustc_span::{BytePos, Pos, Span}; diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs index 8fe3bc9e379f..2a3fb8294611 100644 --- a/clippy_lints/src/doc/mod.rs +++ b/clippy_lints/src/doc/mod.rs @@ -4,19 +4,21 @@ use clippy_utils::attrs::is_doc_hidden; use clippy_utils::diagnostics::{span_lint, span_lint_and_help, span_lint_and_then}; use clippy_utils::{is_entrypoint_fn, is_trait_impl_item}; -use pulldown_cmark::Event::{ - Code, DisplayMath, End, FootnoteReference, HardBreak, Html, InlineHtml, InlineMath, Rule, SoftBreak, Start, - TaskListMarker, Text, -}; -use pulldown_cmark::Tag::{BlockQuote, CodeBlock, FootnoteDefinition, Heading, Item, Link, Paragraph}; -use pulldown_cmark::{BrokenLink, CodeBlockKind, CowStr, Options, TagEnd}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; use rustc_hir::{Attribute, ImplItemKind, ItemKind, Node, Safety, TraitItemKind}; use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext}; +use rustc_resolve::rustdoc::pulldown_cmark::Event::{ + Code, DisplayMath, End, FootnoteReference, HardBreak, Html, InlineHtml, InlineMath, Rule, SoftBreak, Start, + TaskListMarker, Text, +}; +use rustc_resolve::rustdoc::pulldown_cmark::Tag::{ + BlockQuote, CodeBlock, FootnoteDefinition, Heading, Item, Link, Paragraph, +}; +use rustc_resolve::rustdoc::pulldown_cmark::{BrokenLink, CodeBlockKind, CowStr, Options, TagEnd}; use rustc_resolve::rustdoc::{ - DocFragment, add_doc_fragment, attrs_to_doc_fragments, main_body_opts, source_span_for_markdown_range, - span_of_fragments, + DocFragment, add_doc_fragment, attrs_to_doc_fragments, main_body_opts, pulldown_cmark, + source_span_for_markdown_range, span_of_fragments, }; use rustc_session::impl_lint_pass; use rustc_span::Span; diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs index 596047977a9b..221107ba4b93 100644 --- a/clippy_lints/src/future_not_send.rs +++ b/clippy_lints/src/future_not_send.rs @@ -90,7 +90,7 @@ fn check_fn( let ocx = ObligationCtxt::new_with_diagnostics(&infcx); let cause = traits::ObligationCause::misc(span, fn_def_id); ocx.register_bound(cause, cx.param_env, ret_ty, send_trait); - let send_errors = ocx.select_all_or_error(); + let send_errors = ocx.evaluate_obligations_error_on_ambiguity(); // Allow errors that try to prove `Send` for types that "mention" a generic parameter at the "top // level". diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 41702ae9fb97..a4ad9424b3eb 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -27,9 +27,6 @@ rustc::internal )] -// FIXME: switch to something more ergonomic here, once available. -// (Currently there is no way to opt into sysroot crates without `extern crate`.) -extern crate pulldown_cmark; extern crate rustc_abi; extern crate rustc_arena; extern crate rustc_ast; @@ -53,8 +50,6 @@ extern crate rustc_span; extern crate rustc_target; extern crate rustc_trait_selection; -extern crate smallvec; -extern crate thin_vec; #[macro_use] extern crate clippy_utils; diff --git a/clippy_lints/src/methods/ip_constant.rs b/clippy_lints/src/methods/ip_constant.rs index bf602811009a..d5e4dac5e452 100644 --- a/clippy_lints/src/methods/ip_constant.rs +++ b/clippy_lints/src/methods/ip_constant.rs @@ -1,10 +1,10 @@ use clippy_utils::consts::{ConstEvalCtxt, Constant}; use clippy_utils::diagnostics::span_lint_and_then; +use rustc_data_structures::smallvec::SmallVec; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, QPath, TyKind}; use rustc_lint::LateContext; use rustc_span::sym; -use smallvec::SmallVec; use super::IP_CONSTANT; diff --git a/clippy_lints/src/unnested_or_patterns.rs b/clippy_lints/src/unnested_or_patterns.rs index f3410c98973f..568544ad5cf1 100644 --- a/clippy_lints/src/unnested_or_patterns.rs +++ b/clippy_lints/src/unnested_or_patterns.rs @@ -9,6 +9,7 @@ use rustc_ast::mut_visit::*; use rustc_ast::{self as ast, DUMMY_NODE_ID, Mutability, Pat, PatKind}; use rustc_ast_pretty::pprust; +use rustc_data_structures::thin_vec::{ThinVec, thin_vec}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_session::impl_lint_pass; @@ -17,7 +18,6 @@ use std::boxed::Box; use std::cell::Cell; use std::mem; -use thin_vec::{ThinVec, thin_vec}; declare_clippy_lint! { /// ### What it does diff --git a/clippy_utils/README.md b/clippy_utils/README.md index 1f678a6a29f0..9d12b46b9546 100644 --- a/clippy_utils/README.md +++ b/clippy_utils/README.md @@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain: ``` -nightly-2025-10-06 +nightly-2025-10-16 ``` diff --git a/clippy_utils/src/consts.rs b/clippy_utils/src/consts.rs index 6e2cabd5e61b..7b8c7f3f0d6b 100644 --- a/clippy_utils/src/consts.rs +++ b/clippy_utils/src/consts.rs @@ -4,8 +4,9 @@ //! executable MIR bodies, so we have to do this instead. #![expect(clippy::float_cmp)] +use crate::res::MaybeDef; use crate::source::{SpanRangeExt, walk_span_to_context}; -use crate::{clip, is_direct_expn_of, paths, sext, sym, unsext}; +use crate::{clip, is_direct_expn_of, sext, sym, unsext}; use rustc_abi::Size; use rustc_apfloat::Float; @@ -805,10 +806,10 @@ fn fetch_path(&self, qpath: &QPath<'_>, id: HirId) -> Option { | sym::i128_legacy_const_max ) ) || self.tcx.opt_parent(did).is_some_and(|parent| { - paths::F16_CONSTS.matches(&self.tcx, parent) - || paths::F32_CONSTS.matches(&self.tcx, parent) - || paths::F64_CONSTS.matches(&self.tcx, parent) - || paths::F128_CONSTS.matches(&self.tcx, parent) + parent.is_diag_item(&self.tcx, sym::f16_consts_mod) + || parent.is_diag_item(&self.tcx, sym::f32_consts_mod) + || parent.is_diag_item(&self.tcx, sym::f64_consts_mod) + || parent.is_diag_item(&self.tcx, sym::f128_consts_mod) })) => { did diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 8250104b0ca2..c8943523e179 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -25,7 +25,6 @@ // FIXME: switch to something more ergonomic here, once available. // (Currently there is no way to opt into sysroot crates without `extern crate`.) -extern crate indexmap; extern crate rustc_abi; extern crate rustc_ast; extern crate rustc_attr_parsing; @@ -49,7 +48,6 @@ extern crate rustc_session; extern crate rustc_span; extern crate rustc_trait_selection; -extern crate smallvec; pub mod ast_utils; pub mod attrs; @@ -93,6 +91,7 @@ use rustc_ast::ast::{self, LitKind, RangeLimits}; use rustc_ast::join_path_syms; use rustc_data_structures::fx::FxHashMap; +use rustc_data_structures::indexmap; use rustc_data_structures::packed::Pu128; use rustc_data_structures::unhash::UnindexMap; use rustc_hir::LangItem::{OptionNone, OptionSome, ResultErr, ResultOk}; diff --git a/clippy_utils/src/msrvs.rs b/clippy_utils/src/msrvs.rs index 62041fc631c0..86d17a8231d5 100644 --- a/clippy_utils/src/msrvs.rs +++ b/clippy_utils/src/msrvs.rs @@ -2,12 +2,12 @@ use rustc_ast::Attribute; use rustc_ast::attr::AttributeExt; use rustc_attr_parsing::parse_version; +use rustc_data_structures::smallvec::SmallVec; use rustc_hir::RustcVersion; use rustc_lint::LateContext; use rustc_session::Session; use rustc_span::Symbol; use serde::Deserialize; -use smallvec::SmallVec; use std::iter::once; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/clippy_utils/src/paths.rs b/clippy_utils/src/paths.rs index b6832b384d4a..8aa663163caf 100644 --- a/clippy_utils/src/paths.rs +++ b/clippy_utils/src/paths.rs @@ -131,11 +131,6 @@ macro_rules! $name { macro_path: PathNS::Macro, } -pub static F16_CONSTS: PathLookup = type_path!(core::f16::consts); -pub static F32_CONSTS: PathLookup = type_path!(core::f32::consts); -pub static F64_CONSTS: PathLookup = type_path!(core::f64::consts); -pub static F128_CONSTS: PathLookup = type_path!(core::f128::consts); - // Paths in external crates pub static FUTURES_IO_ASYNCREADEXT: PathLookup = type_path!(futures_util::AsyncReadExt); pub static FUTURES_IO_ASYNCWRITEEXT: PathLookup = type_path!(futures_util::AsyncWriteExt); diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index cc98fac45c7c..7722bebdbbe0 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -232,9 +232,7 @@ fn check_statement<'tcx>( StatementKind::FakeRead(box (_, place)) => check_place(cx, *place, span, body, msrv), // just an assignment - StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => { - check_place(cx, **place, span, body, msrv) - }, + StatementKind::SetDiscriminant { place, .. } => check_place(cx, **place, span, body, msrv), StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => check_operand(cx, op, span, body, msrv), @@ -475,7 +473,7 @@ fn is_ty_const_destruct_unused<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Bod let ocx = ObligationCtxt::new(&infcx); ocx.register_obligations(impl_src.nested_obligations()); - ocx.select_all_or_error().is_empty() + ocx.evaluate_obligations_error_on_ambiguity().is_empty() } !ty.needs_drop(tcx, ConstCx::new(tcx, body).typing_env) diff --git a/clippy_utils/src/sym.rs b/clippy_utils/src/sym.rs index a14c783c2e93..8e8a80a6a9c9 100644 --- a/clippy_utils/src/sym.rs +++ b/clippy_utils/src/sym.rs @@ -120,7 +120,6 @@ macro_rules! generate { collapsible_if, collect, const_ptr, - consts, contains, copied, copy_from, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e936f5dc3b7a..d5d96448a97d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # begin autogenerated nightly -channel = "nightly-2025-10-06" +channel = "nightly-2025-10-16" # end autogenerated nightly components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] profile = "minimal" diff --git a/tests/ui/needless_match.fixed b/tests/ui/needless_match.fixed index 41acf44023f6..57273012a192 100644 --- a/tests/ui/needless_match.fixed +++ b/tests/ui/needless_match.fixed @@ -1,7 +1,7 @@ #![warn(clippy::needless_match)] #![allow(clippy::manual_map)] #![allow(dead_code)] - +#![allow(unused)] #[derive(Clone, Copy)] enum Simple { A, diff --git a/tests/ui/needless_match.rs b/tests/ui/needless_match.rs index 936653b961bb..3eb577868f2b 100644 --- a/tests/ui/needless_match.rs +++ b/tests/ui/needless_match.rs @@ -1,7 +1,7 @@ #![warn(clippy::needless_match)] #![allow(clippy::manual_map)] #![allow(dead_code)] - +#![allow(unused)] #[derive(Clone, Copy)] enum Simple { A, diff --git a/tests/ui/option_env_unwrap.stderr b/tests/ui/option_env_unwrap.stderr index bbcbfedb7882..c14a3ea23ff3 100644 --- a/tests/ui/option_env_unwrap.stderr +++ b/tests/ui/option_env_unwrap.stderr @@ -19,7 +19,7 @@ LL | let _ = option_env!("PATH").expect("environment variable PATH isn't set error: this will panic at run-time if the environment variable doesn't exist at compile-time --> tests/ui/option_env_unwrap.rs:14:13 | -LL | let _ = option_env!("__Y__do_not_use").unwrap(); // This test only works if you don't have a __Y__do_not_use env variable in your env... +LL | let _ = option_env!("__Y__do_not_use").unwrap(); // This test only works if you don't have a __Y__do_not_use env variable in you... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider using the `env!` macro instead diff --git a/tests/ui/too_long_first_doc_paragraph.stderr b/tests/ui/too_long_first_doc_paragraph.stderr index f3f182aa5422..949ada30dc97 100644 --- a/tests/ui/too_long_first_doc_paragraph.stderr +++ b/tests/ui/too_long_first_doc_paragraph.stderr @@ -42,7 +42,7 @@ LL | | /// gravida non lacinia at, rhoncus eu lacus. error: first doc comment paragraph is too long --> tests/ui/too_long_first_doc_paragraph.rs:65:1 | -LL | / /// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lore... +LL | / /// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetting industr... LL | | LL | | /// LL | | /// Here's a second paragraph. It would be preferable to put the details here. diff --git a/tests/ui/useless_conversion.fixed b/tests/ui/useless_conversion.fixed index ad30c94f3478..2942f64741e9 100644 --- a/tests/ui/useless_conversion.fixed +++ b/tests/ui/useless_conversion.fixed @@ -1,5 +1,5 @@ #![deny(clippy::useless_conversion)] -#![allow(clippy::needless_if, clippy::unnecessary_wraps)] +#![allow(clippy::needless_if, clippy::unnecessary_wraps, unused)] // FIXME(static_mut_refs): Do not allow `static_mut_refs` lint #![allow(static_mut_refs)] diff --git a/tests/ui/useless_conversion.rs b/tests/ui/useless_conversion.rs index 505afb340009..f2da414e9f65 100644 --- a/tests/ui/useless_conversion.rs +++ b/tests/ui/useless_conversion.rs @@ -1,5 +1,5 @@ #![deny(clippy::useless_conversion)] -#![allow(clippy::needless_if, clippy::unnecessary_wraps)] +#![allow(clippy::needless_if, clippy::unnecessary_wraps, unused)] // FIXME(static_mut_refs): Do not allow `static_mut_refs` lint #![allow(static_mut_refs)]