Skip to content

Commit 11d7080

Browse files
committed
m1
1 parent 5745868 commit 11d7080

File tree

150 files changed

+116
-30
lines changed

Some content is hidden

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

150 files changed

+116
-30
lines changed

clippy_lints/src/ineffective_open_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::method_call;
1+
use super::method_call;
22
use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::peel_blocks;
44
use declare_clippy_lint::declare_clippy_lint;

clippy_lints/src/methods/chars_next_cmp.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

clippy_lints/src/methods/chars_next_cmp_with_unwrap.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

clippy_lints_methods/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "clippy_lints_methods"
3+
version = "0.1.89"
4+
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
5+
repository = "https://github.com/rust-lang/rust-clippy"
6+
readme = "../README.md"
7+
license = "MIT OR Apache-2.0"
8+
keywords = ["clippy", "lint", "plugin"]
9+
edition = "2024"
10+
11+
[dependencies]
12+
# arrayvec = { version = "0.7", default-features = false }
13+
# cargo_metadata = "0.18"
14+
clippy_config = { path = "../clippy_config" }
15+
clippy_utils = { path = "../clippy_utils" }
16+
# itertools = "0.12"
17+
# quine-mc_cluskey = "0.2"
18+
# regex-syntax = "0.8"
19+
# serde = { version = "1.0", features = ["derive"] }
20+
# toml = "0.7.3"
21+
# unicode-normalization = "0.1"
22+
# unicode-script = { version = "0.5", default-features = false }
23+
# semver = "1.0"
24+
# url = "2.2"
25+
26+
[package.metadata.rust-analyzer]
27+
# This crate uses #[feature(rustc_private)]
28+
rustc_private = true

clippy_lints/src/methods/bytes_nth.rs renamed to clippy_lints_methods/src/bytes_nth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_errors::Applicability;
55
use rustc_hir::{Expr, LangItem};
66
use rustc_lint::LateContext;
77

8-
use crate::methods::method_call;
8+
use super::method_call;
99

1010
use super::BYTES_NTH;
1111

clippy_lints/src/methods/chars_cmp.rs renamed to clippy_lints_methods/src/chars_cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::ty;
99
/// Wrapper fn for `CHARS_NEXT_CMP` and `CHARS_LAST_CMP` lints.
1010
pub(super) fn check(
1111
cx: &LateContext<'_>,
12-
info: &crate::methods::BinaryExprInfo<'_>,
12+
info: &super::BinaryExprInfo<'_>,
1313
chain_methods: &[&str],
1414
lint: &'static Lint,
1515
suggest: &str,

clippy_lints/src/methods/chars_cmp_with_unwrap.rs renamed to clippy_lints_methods/src/chars_cmp_with_unwrap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_lint::{LateContext, Lint};
99
/// Wrapper fn for `CHARS_NEXT_CMP` and `CHARS_LAST_CMP` lints with `unwrap()`.
1010
pub(super) fn check(
1111
cx: &LateContext<'_>,
12-
info: &crate::methods::BinaryExprInfo<'_>,
12+
info: &super::BinaryExprInfo<'_>,
1313
chain_methods: &[&str],
1414
lint: &'static Lint,
1515
suggest: &str,

clippy_lints/src/methods/chars_last_cmp.rs renamed to clippy_lints_methods/src/chars_last_cmp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::methods::chars_cmp;
1+
use super::chars_cmp;
22
use rustc_lint::LateContext;
33

44
use super::CHARS_LAST_CMP;
55

66
/// Checks for the `CHARS_LAST_CMP` lint.
7-
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
7+
pub(super) fn check(cx: &LateContext<'_>, info: &super::BinaryExprInfo<'_>) -> bool {
88
if chars_cmp::check(cx, info, &["chars", "last"], CHARS_LAST_CMP, "ends_with") {
99
true
1010
} else {

clippy_lints/src/methods/chars_last_cmp_with_unwrap.rs renamed to clippy_lints_methods/src/chars_last_cmp_with_unwrap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::methods::chars_cmp_with_unwrap;
1+
use super::chars_cmp_with_unwrap;
22
use rustc_lint::LateContext;
33

44
use super::CHARS_LAST_CMP;
55

66
/// Checks for the `CHARS_LAST_CMP` lint with `unwrap()`.
7-
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
7+
pub(super) fn check(cx: &LateContext<'_>, info: &super::BinaryExprInfo<'_>) -> bool {
88
if chars_cmp_with_unwrap::check(cx, info, &["chars", "last", "unwrap"], CHARS_LAST_CMP, "ends_with") {
99
true
1010
} else {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use rustc_lint::LateContext;
2+
3+
use super::CHARS_NEXT_CMP;
4+
5+
/// Checks for the `CHARS_NEXT_CMP` lint.
6+
pub(super) fn check(cx: &LateContext<'_>, info: &super::BinaryExprInfo<'_>) -> bool {
7+
super::chars_cmp::check(cx, info, &["chars", "next"], CHARS_NEXT_CMP, "starts_with")
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use rustc_lint::LateContext;
2+
3+
use super::CHARS_NEXT_CMP;
4+
5+
/// Checks for the `CHARS_NEXT_CMP` lint with `unwrap()`.
6+
pub(super) fn check(cx: &LateContext<'_>, info: &super::BinaryExprInfo<'_>) -> bool {
7+
super::chars_cmp_with_unwrap::check(cx, info, &["chars", "next", "unwrap"], CHARS_NEXT_CMP, "starts_with")
8+
}

clippy_lints/src/methods/drain_collect.rs renamed to clippy_lints_methods/src/drain_collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::DRAIN_COLLECT;
1+
use super::DRAIN_COLLECT;
22
use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::source::snippet;
44
use clippy_utils::ty::is_type_lang_item;

clippy_lints/src/methods/iter_cloned_collect.rs renamed to clippy_lints_methods/src/iter_cloned_collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::utils::derefs_to_slice;
1+
use super::utils::derefs_to_slice;
22
use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::ty::{get_iterator_item_ty, is_type_diagnostic_item};
44
use rustc_errors::Applicability;

clippy_lints/src/methods/mod.rs renamed to clippy_lints_methods/src/lib.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
// #![feature(array_windows)]
2+
// #![feature(box_patterns)]
3+
// #![feature(macro_metavar_expr_concat)]
4+
// #![feature(f128)]
5+
// #![feature(f16)]
6+
// #![feature(if_let_guard)]
7+
// #![feature(iter_intersperse)]
8+
// #![feature(iter_partition_in_place)]
9+
// #![feature(never_type)]
10+
// #![feature(round_char_boundary)]
11+
#![feature(rustc_private)]
12+
// #![feature(stmt_expr_attributes)]
13+
// #![feature(unwrap_infallible)]
14+
#![allow(
15+
clippy::missing_docs_in_private_items,
16+
clippy::must_use_candidate,
17+
rustc::diagnostic_outside_of_impl,
18+
rustc::untranslatable_diagnostic,
19+
clippy::literal_string_with_formatting_args
20+
)]
21+
#![warn(
22+
trivial_casts,
23+
trivial_numeric_casts,
24+
rust_2018_idioms,
25+
unused_lifetimes,
26+
unused_qualifications,
27+
rustc::internal
28+
)]
29+
30+
// FIXME: switch to something more ergonomic here, once available.
31+
// (Currently there is no way to opt into sysroot crates without `extern crate`.)
32+
// extern crate pulldown_cmark;
33+
// extern crate rustc_abi;
34+
// extern crate rustc_arena;
35+
// extern crate rustc_ast;
36+
// extern crate rustc_ast_pretty;
37+
// extern crate rustc_attr_parsing;
38+
// extern crate rustc_data_structures;
39+
extern crate rustc_driver;
40+
extern crate rustc_errors;
41+
extern crate rustc_hir;
42+
// extern crate rustc_hir_analysis;
43+
// extern crate rustc_hir_pretty;
44+
// extern crate rustc_hir_typeck;
45+
// extern crate rustc_index;
46+
// extern crate rustc_infer;
47+
// extern crate rustc_lexer;
48+
extern crate rustc_lint;
49+
extern crate rustc_middle;
50+
// extern crate rustc_parse;
51+
// extern crate rustc_parse_format;
52+
// extern crate rustc_resolve;
53+
// extern crate rustc_session;
54+
extern crate rustc_span;
55+
// extern crate rustc_target;
56+
// extern crate rustc_trait_selection;
57+
// extern crate thin_vec;
58+
159
mod bind_instead_of_map;
260
mod bytecount;
361
mod bytes_count_to_len;

clippy_lints/src/methods/map_with_unused_argument_over_ranges.rs renamed to clippy_lints_methods/src/map_with_unused_argument_over_ranges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES;
1+
use super::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES;
22
use clippy_utils::diagnostics::span_lint_and_then;
33
use clippy_utils::msrvs::{self, Msrv};
44
use clippy_utils::source::snippet_with_applicability;

clippy_lints/src/methods/single_char_add_str.rs renamed to clippy_lints_methods/src/single_char_add_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::{single_char_insert_string, single_char_push_string};
1+
use super::{single_char_insert_string, single_char_push_string};
22
use rustc_hir as hir;
33
use rustc_lint::LateContext;
44
use rustc_span::sym;

clippy_lints/src/methods/type_id_on_box.rs renamed to clippy_lints_methods/src/type_id_on_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::TYPE_ID_ON_BOX;
1+
use super::TYPE_ID_ON_BOX;
22
use clippy_utils::diagnostics::span_lint_and_then;
33
use clippy_utils::source::snippet;
44
use rustc_errors::Applicability;
File renamed without changes.

clippy_lints/src/methods/wrong_self_convention.rs renamed to clippy_lints_methods/src/wrong_self_convention.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::methods::SelfKind;
1+
use super::SelfKind;
22
use clippy_utils::diagnostics::span_lint_and_help;
33
use clippy_utils::ty::is_copy;
44
use rustc_lint::LateContext;

0 commit comments

Comments
 (0)