about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-04-04AsyncDestructor: replace fields with impl_didMaja Kądziołka-4/+2
The future and ctor fields aren't actually used, and the way they are extracted is obviously wrong – swapping the order of the items in the source code will give wrong results. Instead, store just the LocalDefId of the impl, which is enough for the only use of this data.
2025-04-03add `TypingMode::Borrowck`lcnr-7/+30
2025-04-02Fetch the destructor constness lazilyOli Scherer-2/+0
2025-03-31Fix invalid linktiif-2/+2
2025-03-26Remove `kw::Empty` uses from `rustc_middle`.Nicholas Nethercote-1/+1
There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks.
2025-03-19Rollup merge of #138001 - meithecatte:privately-uninhabited, r=NadrierilMatthias Krüger-1/+12
mir_build: consider privacy when checking for irrefutable patterns This PR fixes #137999. Note that, since this makes the compiler reject code that was previously accepted, it will probably need a crater run. I include a commit that factors out a common code pattern into a helper function, purely because the fact that this was repeated all over the place was bothering me. Let me know if I should split that into a separate PR instead.
2025-03-18Remove existing AFIDT implementationMichael Goulet-1/+0
2025-03-15Auto merge of #138532 - matthiaskrgr:rollup-mgcynqu, r=matthiaskrgrbors-1/+2
Rollup of 5 pull requests Successful merges: - #138283 (Enforce type of const param correctly in MIR typeck) - #138439 (feat: check ARG_MAX on Unix platforms) - #138502 (resolve: Avoid some unstable iteration) - #138514 (Remove fake borrows of refs that are converted into non-refs in `MakeByMoveBody`) - #138524 (Mark myself as unavailable for reviews temporarily) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-15Move codec module back into middleMichael Goulet-2/+3
2025-03-15Fold visit into tyMichael Goulet-5/+5
2025-03-15Squash fold into tyMichael Goulet-2/+2
2025-03-14resolve: Avoid some unstable iterationVadim Petrochenkov-1/+2
2025-03-12Rollup merge of #137504 - nnethercote:remove-Map-4, r=ZalatharManish Goregaokar-3/+3
Move methods from Map to TyCtxt, part 4. A follow-up to https://github.com/rust-lang/rust/pull/137350. r? ```@Zalathar```
2025-03-12Move methods from `Map` to `TyCtxt`, part 4.Nicholas Nethercote-3/+3
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
2025-03-10Remove AdtFlags::IS_ANONYMOUS and Copy/Clone condition for anonymous ADTMichael Goulet-1/+1
2025-03-09Rollup merge of #138160 - jdonszelmann:move-find-attr2, r=oli-obkMatthias Krüger-3/+4
depend more on attr_data_structures and move find_attr! there r? ``@oli-obk`` This should be an easy one. It just moves some imports around. This is necessary for other changes that I'm working on not to have import cycles. However, it's an easy one to just merge on its own.
2025-03-09Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, ↵Matthias Krüger-3/+3
r=compiler-errors compiler: Use `size_of` from the prelude instead of imported Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler. These functions were added to all preludes in Rust 1.80. r? ``@compiler-errors``
2025-03-09Rollup merge of #136968 - oli-obk:bye-bye, r=compiler-errorsMatthias Krüger-46/+1
Turn order dependent trait objects future incompat warning into a hard error fixes #56484 r? ``@ghost`` will FCP when we have a crater result
2025-03-07compiler: Use size_of from the prelude instead of importedThalia Archibald-3/+3
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-03-07depend more on attr_data_structures and move find_attr! thereJana Dönszelmann-3/+4
2025-03-07Add helper methods checking for "#[non_exhaustive] that's active"Maja Kądziołka-1/+12
A check for `#[non_exhaustive]` is often done in combination with checking whether the type is local to the crate, in a variety of ways. Create a helper method and standardize on it as the way to check for this.
2025-03-01Rollup merge of #137800 - BoxyUwU:param_env_docs, r=compiler-errorsMatthias Krüger-6/+0
Remove `ParamEnv::without_caller_bounds` This doesn't really do anything that `ParamEnv::empty` doesn't do nowadays as `ParamEnv` *only* stores caller bounds since other information has been moved out into `TypingMode` r? ```@compiler-errors``` ```@lcnr```
2025-02-26Remove `ParamEnv::without_caller_bounds`Boxy-6/+0
2025-02-26Print out destructorMichael Goulet-0/+1
2025-02-26Rollup merge of #137529 - klensy:unused3, r=lcnrLeón Orell Valerian Liehr-7/+1
remove few unused args
2025-02-25remove unused field from VariantDef::new and convert debug to instrumentklensy-7/+1
2025-02-24Auto merge of #135726 - jdonszelmann:attr-parsing, r=oli-obkbors-7/+21
New attribute parsing infrastructure Another step in the plan outlined in https://github.com/rust-lang/rust/issues/131229 introduces infrastructure for structured parsers for attributes, as well as converting a couple of complex attributes to have such structured parsers. This PR may prove too large to review. I left some of my own comments to guide it a little. Some general notes: - The first commit is basically standalone. It just preps some mostly unrelated sources for the rest of the PR to work. It might not have enormous merit on its own, but not negative merit either. Could be merged alone, but also doesn't make the review a whole lot easier. (but it's only +274 -209) - The second commit is the one that introduces new infrastructure. It's the important one to review. - The 3rd commit uses the new infrastructure showing how some of the more complex attributes can be parsed using it. Theoretically can be split up, though the parsers in this commit are the ones that really test the new infrastructure and show that it all works. - The 4th commit fixes up rustdoc and clippy. In the previous 2 they didn't compile yet while the compiler does. Separated them out to separate concerns and make the rest more palatable. - The 5th commit blesses some test outputs. Sometimes that's just because a diagnostic happens slightly earlier than before, which I'd say is acceptable. Sometimes a diagnostic is now only emitted once where it would've been twice before (yay! fixed some bugs). One test I actually moved from crashes to fixed, because it simply doesn't crash anymore. That's why this PR Closes #132391. I think most choices I made here are generally reasonable, but let me know if you disagree anywhere. - The 6th commit adds a derive to pretty print attributes - The 7th removes smir apis for attributes, for the time being. The api will at some point be replaced by one based on `rustc_ast_data_structures::AttributeKind` In general, a lot of the additions here are comments. I've found it very important to document new things in the 2nd commit well so other people can start using it. Closes #132391 Closes #136717
2025-02-24Introduce new-style attribute parsers for several attributesJana Dönszelmann-7/+21
note: compiler compiles but librustdoc and clippy don't
2025-02-24Fix some `use` items that import more than necessary.Nicholas Nethercote-1/+1
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-6/+3
2025-02-21convert all_macro_rules from hashmap to hashsetklensy-1/+1
2025-02-20Turn order dependent trait objects future incompat warning into a hard errorOli Scherer-46/+1
2025-02-19Make fewer crates depend on rustc_ast_irMichael Goulet-2/+1
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-1/+1
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-17Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgrbors-2/+1
Rollup of 7 pull requests Successful merges: - #137095 (Replace some u64 hashes with Hash64) - #137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - #137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - #137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - #137125 (Re-add missing empty lines in the releases notes) - #137145 (use add-core-stubs / minicore for a few more tests) - #137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-17Move `rustc_middle::limits` to `rustc_interface`.Nicholas Nethercote-1/+0
It's always good to make `rustc_middle` smaller. `rustc_interface` is the best destination, because it's the only crate that calls `get_recursive_limit`.
2025-02-15Replace some u64 hashes with Hash64Ben Kimock-2/+1
2025-02-13intern valtreesLukas Markeffsky-1/+2
2025-02-03reword pattern migration diagnostic to make sense in all editionsdianne-1/+1
This aligns the main error message a bit more with the phrasing in the Edition Guide and provides a bit more information on the labels to (hopefully!) aid in understanding.
2025-01-30introduce `ty::Value`Lukas Markeffsky-1/+1
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2025-01-27Use identifiers in diagnostics more oftenMichael Goulet-0/+9
2025-01-18Get rid of `ToPolyTraitRef`Michael Goulet-2/+1
2025-01-14Add hir::HeaderSafety to make follow up commits simplerOli Scherer-0/+1
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-11/+1
2025-01-08Implement const Destruct in old solverMichael Goulet-2/+2
2024-12-19Auto merge of #133961 - lcnr:borrowck-cleanup, r=jackh726bors-1/+2
cleanup region handling: add `LateParamRegionKind` The second commit is to enable a split between `BoundRegionKind` and `LateParamRegionKind`, by avoiding `BoundRegionKind` where it isn't necessary. The third comment then adds `LateParamRegionKind` to avoid having the same late-param region for separate bound regions. This fixes #124021. r? `@compiler-errors`
2024-12-18update new solver candidate assemblylcnr-1/+1
2024-12-18introduce `LateParamRegionKind`lcnr-1/+2
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-1/+1