commit
d9fb15c4b1
20 changed files with 32 additions and 43 deletions
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,21 @@ use clippy_config::Conf;
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
|
|||
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".
|
||||
|
|
|
|||
|
|
@ -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_session;
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use rustc_ast::PatKind::*;
|
|||
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 rustc_span::DUMMY_SP;
|
|||
use std::boxed::Box;
|
||||
use std::cell::Cell;
|
||||
use std::mem;
|
||||
use thin_vec::{ThinVec, thin_vec};
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// ### What it does
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:
|
|||
|
||||
<!-- begin autogenerated nightly -->
|
||||
```
|
||||
nightly-2025-10-06
|
||||
nightly-2025-10-16
|
||||
```
|
||||
<!-- end autogenerated nightly -->
|
||||
|
||||
|
|
|
|||
|
|
@ -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 @@ impl<'tcx> ConstEvalCtxt<'tcx> {
|
|||
| 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
|
||||
|
|
|
|||
|
|
@ -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_mir_dataflow;
|
|||
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_abi::Integer;
|
|||
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};
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ use crate::sym;
|
|||
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};
|
||||
|
||||
|
|
|
|||
|
|
@ -131,11 +131,6 @@ path_macros! {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -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<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>
|
|||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ generate! {
|
|||
collapsible_if,
|
||||
collect,
|
||||
const_ptr,
|
||||
consts,
|
||||
contains,
|
||||
copied,
|
||||
copy_from,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#![warn(clippy::needless_match)]
|
||||
#![allow(clippy::manual_map)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
#![allow(unused)]
|
||||
#[derive(Clone, Copy)]
|
||||
enum Simple {
|
||||
A,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#![warn(clippy::needless_match)]
|
||||
#![allow(clippy::manual_map)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
#![allow(unused)]
|
||||
#[derive(Clone, Copy)]
|
||||
enum Simple {
|
||||
A,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue