about summary refs log tree commit diff
path: root/clippy_utils/src/ty
AgeCommit message (Collapse)AuthorLines
2025-02-20Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-5/+29
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-2/+2
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-11`declare_interior_mutable_const`, `borrow_interior_mutable_const`: resolve ↵Alejandra González-0/+4
`<T as Trait>::AssocT` projections (#14125) changelog: [`declare_interior_mutable_const`, `borrow_interior_mutable_const`]: resolve `<T as Trait>::AssocT` projections --- This came up during https://github.com/rust-lang/rust/pull/130543 where we have `<T as AtomicPrimitive>::Assoc = AtomicT` instead of just `AtomicT` and clippy failed to resolve that properly. This really needs a review, because - I don't know if `try_normalize_erasing_regions` is the right thing to call here. - I'm not sure if I peel off the correct amount of `ValTree::Branch` layers (I think I do). Also, shouldn't this lint's infrastructure rely on `Freeze` trait (https://github.com/rust-lang/rust/issues/121675) instead of hardcoding a list of known-to-be-interior-mutable types? --- Previously filed this in the main rust repo (https://github.com/rust-lang/rust/pull/136369), was asked to do it here instead (https://github.com/rust-lang/rust/pull/136369#issuecomment-2628527774).
2025-02-07clippy: directly use rustc_abi instead of reexportsJubilee Young-1/+1
2025-02-07Handle more cases in `is_normalizable` (#13833)llogiq-5/+11
By assuming that a recursive type is normalizable within the deeper calls to `is_normalizable_helper()`, more cases can be handled by this function. In order to fix stack overflows, a recursion limit has also been added for recursive generic type instantiations. Fix #9798 Fix #10508 Fix #11915 changelog: [`large_enum_variant`]: more precise detection of variants with large size differences
2025-02-06Skip `use_self` inside macro expansions of a `impl Self` block (#13128)Alex Macleod-0/+14
changelog: [`use_self`] Skip if inside macro expansions of a `impl Self` block Fixes #13092. r? Alexendoo
2025-02-06Pulicize `clippy_utils::ty::ty_from_hir_ty`Lzu Tao-0/+14
And use it in the next commit to avoid ICE.
2025-02-01Resolve projections during internal mutability analysisPavel Grigorenko-0/+4
2025-01-29Rollup merge of #135902 - compiler-errors:item-non-self-bound-in-new-solver, ↵León Orell Valerian Liehr-3/+3
r=lcnr Do not consider child bound assumptions for rigid alias r? lcnr See first commit for the important details. For second commit, I also stacked a somewhat opinionated name change, though I can separate that if needed. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/149
2025-01-28Make item self/non-self bound naming less whackMichael Goulet-3/+3
2025-01-28Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into ↵Philipp Krones-2/+13
clippy-subtree-update
2025-01-28Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-2/+13
2025-01-23`visit_x_unambig`Boxy-1/+1
2025-01-23The clipper :3cBoxy-7/+8
2025-01-19Apply `unnecessary_semicolon` to Clippy sourcesSamuel Tardieu-2/+2
2025-01-18Handle more cases in `is_normalizable`Samuel Tardieu-5/+11
By assuming that a recursive type is normalizable within the deeper calls to `is_normalizable_helper()`, more cases can be handled by this function. In order to fix stack overflows, a recursion limit has also been added for recursive generic type instantiations.
2025-01-10New lint: manual_ok_errSamuel Tardieu-0/+11
2024-12-26Merge commit '609cd310be44677ae31d452a17b0f8207e1abfe1' into ↵Philipp Krones-0/+1343
clippy-subtree-update
2024-12-26Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-0/+1343
2024-12-23Fix `has_iter_method` documentationSamuel Tardieu-1/+1
2024-12-15Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-0/+1343
2024-11-29refactor(utils): move top-level files to `mod.rs` when applicableBD103-0/+1343
2024-11-07Merge commit 'f712eb5cdccd121d0569af12f20e6a0fabe4364d' into ↵Philipp Krones-3/+3
clippy-subtree-update
2024-11-07Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-3/+3
2024-10-24Remove associated type based effects logicMichael Goulet-12/+2
2024-10-03Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into ↵Philipp Krones-1/+1
clippy-subtree-update
2024-09-25Fix `clippy_lints` and `clippy_utils`Samuel Moelius-1/+1
2024-09-24Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into ↵Philipp Krones-2/+2
clippy-subtree-update
2024-09-22FormattingPhilipp Krones-2/+2
2024-07-25Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into ↵Philipp Krones-1/+1
clippy-subtree-update
2024-06-13Merge commit '3e5a02b13b1244545454752c6629b767522a44b1' into ↵Philipp Krones-2/+12
clippy-subtree-update
2024-05-19Add and use generics.is_empty() and generics.is_own_empty, rather than using ↵Santiago Pastorino-1/+1
generics' attributes
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-3/+3
2024-04-18Merge commit 'ca3b393750ee8d870bf3215dcf6509cafa5c0445' into ↵Philipp Krones-1/+1
clippy-subtree-update
2024-03-22Rename `hir::Node::Local` into `hir::Node::LetStmt`Guillaume Gomez-1/+1
2024-02-10hir: Remove `hir::Map::{opt_parent_id,parent_id,get_parent,find_parent}`Vadim Petrochenkov-1/+1
2024-01-11Merge commit '26ac6aab023393c94edf42f38f6ad31196009643'Philipp Krones-3/+3
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-13/+12
2023-11-25Appease the clippyMichael Goulet-1/+1
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-1/+3
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-1/+1
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+1
2023-09-25Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyupPhilipp Krones-7/+7
2023-09-22fix clippy errors (ignore effects in certainty)Deadbeef-2/+3
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-1/+1
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-1/+1
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-1/+1
2023-08-04Improve spans for indexing expressionsNilstrieb-1/+1
Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.
2023-07-31Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyupPhilipp Krones-0/+442