about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2023-03-08prefer universal from lower universeAli MJ Al-Nasrawy-1/+17
In case a variable is unified with two universal regions from different universes, use the one with the lower universe as it has a higher chance of being compatible with the variable.
2023-03-08address review commentAli MJ Al-Nasrawy-3/+16
2023-03-08Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholkbors-12/+18
Do not implement HashStable for HashSet (MCP 533) This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order. The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-6/+6
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-03-07Remove DropAndReplace terminatorGiacomo Pasini-64/+2
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-07Auto merge of #108691 - aliemjay:closure-subject, r=jackh726bors-12/+48
fix multiple issues when promoting type-test subject Multiple interdependent fixes. See linked issues for a short description of each. When Promoting a type-test `T: 'a` from within the closure back to its parent function, there are a couple pre-existing bugs and limitations. They were exposed by the recent changes to opaque types because the type-test subject (`T`) is no longer a simple ParamTy. Commit 1: Fixes #108635 Fixes #107426 Commit 2: Fixes #108639 Commit 3: Fixes #107516
2023-03-06Implement param_env for RPITITs assoc typeSantiago Pastorino-0/+1
2023-03-06Add is_impl_trait_in_traitSantiago Pastorino-0/+8
2023-03-06Place binder correctly for arbitrary trait bound suggestionMichael Goulet-2/+2
2023-03-06Add tcx::lower_impl_trait_in_trait_to_assoc_ty to avoid accessing through ↵Santiago Pastorino-0/+4
sess.opts.unstable_opts
2023-03-06Querify early_lint_checks.Camille GILLOT-0/+9
2023-03-06Querify registered_tools.Camille GILLOT-3/+7
2023-03-05Rollup merge of #108770 - GuillaumeGomez:improve-doc-and-naming, r=cjgillotMatthias Krüger-13/+20
Improve documentation and argument naming of some TyCtxt methods I got bit by this recently so better prevent others to end up the same as me.
2023-03-05Improve documentation and argument naming of some TyCtxt methodsGuillaume Gomez-13/+20
2023-03-05Auto merge of #108351 - petrochenkov:rmdit, r=cjgillotbors-44/+39
rustc_middle: Remove trait `DefIdTree` This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-04Auto merge of #108732 - Dylan-DPC:rollup-dy1l8sx, r=Dylan-DPCbors-3/+7
Rollup of 6 pull requests Successful merges: - #108298 (Fix ICE: check if snippet is `)`) - #108405 (Lazily compute crate name for consider_optimizing) - #108656 (Rustdoc search: Emit an error for unclosed generic) - #108660 (Remove ne implementations from strings) - #108669 (Allow checking whether a type allows being uninitialized) - #108727 (rustc_expand: make proc-macro derive error translatable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-04Rollup merge of #108669 - Nilstrieb:query-my-uninitness, r=compiler-errorsDylan DPC-1/+6
Allow checking whether a type allows being uninitialized This is useful for clippy ([rust-lang/clippy#10407](https://github.com/rust-lang/rust-clippy/issues/10407)) and for the future `MaybeUninit::assume_init` panics (#100423).
2023-03-04Rollup merge of #108405 - Nilstrieb:lazy-crate-name-optimization-fuel, ↵Dylan DPC-2/+1
r=WaffleLapkin Lazily compute crate name for consider_optimizing The extra query is unnecessary in the common case of not having fuel.
2023-03-04Auto merge of #108689 - compiler-errors:normalization-error-smaller, r=lcnrbors-3/+0
Remove `NormalizationError::ConstantKind` No longer in use by `TryNormalizeAfterErasingRegionsFolder` (as of #102355 / e8150fa60cc445de7a57db634deb0668880be593 it seems). It's making `LayoutError`, etc. kinda large -- that was noticed by `@zoxc.`
2023-03-04tweak ClosureOutlivesSubjectTyAli MJ Al-Nasrawy-7/+10
2023-03-04Place size limits on query keys and valuesJohn Kåre Alsaker-0/+30
2023-03-03Rollup merge of #108694 - est31:backticks_matchmaking_comments, r=NilstriebMatthias Krüger-10/+10
Match unmatched backticks in compiler/ comments r? ``@Nilstrieb`` as per [advice](https://github.com/rust-lang/rust/pull/108685#issuecomment-1453018499)
2023-03-03Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkovMatthias Krüger-1/+1
Match unmatched backticks in compiler/ Found with GNU grep: ``` grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```' ```
2023-03-03Rollup merge of #107981 - lcnr:canonicalization-uwu, r=compiler-errorsMatthias Krüger-7/+83
new solver: implement canonicalization and region constraints see the corresponding rustc-dev-guide chapter: https://rustc-dev-guide.rust-lang.org/solve/canonicalization.html r? ``@compiler-errors``
2023-03-03canonicalizationlcnr-7/+83
2023-03-03promote subject even if it has unnamed regionsAli MJ Al-Nasrawy-12/+45
Don't require a region to have an `external_name` in order to be promoted.
2023-03-03Match end user facing unmatched backticks in compiler/est31-1/+1
2023-03-03Match unmatched backticks in comments in compiler/est31-5/+5
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-5/+5
2023-03-03Remove NormalizationError::ConstantKindMichael Goulet-3/+0
2023-03-02Rollup merge of #108624 - Nilstrieb:move-it-up, r=WaffleLapkinMatthias Krüger-3/+3
Make `ExprKind` the first field in `thir::Expr` This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-02Rollup merge of #108022 - CraftSpider:align-bytes, r=oli-obkMatthias Krüger-28/+80
Support allocations with non-Box<[u8]> bytes This is prep work for allowing miri to support passing pointers to C code, which will require `Allocation`s to be correctly aligned. Currently, it just makes `Allocation` generic and plumbs the necessary changes through the right places. The follow-up to this will be adding a type in the miri interpreter which correctly aligns the bytes, using that for the Miri engine, then allowing Miri to pass pointers into these allocations to C calls. Based off of #100467, credit to ```@emarteca``` for the code
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-44/+39
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-02Allow checking whether a type allows being uninitializedNilstrieb-1/+6
This is useful for clippy and for the future `MaybeUninit::assume_init` panics.
2023-03-02Make `ExprKind` the first field in `thir::Expr`Nilstrieb-3/+3
This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-01FormatRune Tynan-8/+2
2023-03-01Make associated_item_def_ids for traits use an unstable option to also ↵Santiago Pastorino-0/+11
return associated types for RPITITs
2023-03-01Add opt_rpitit_info querySantiago Pastorino-0/+15
2023-03-01Remove last instances of HashSet in query result types.Michael Woerister-2/+2
2023-03-01Use UnordSet instead of FxHashSet for names_imported_by_glob_use query.Michael Woerister-3/+6
2023-03-01Use FxIndexSet instead of FxHashSet for asm_target_features query.Michael Woerister-2/+3
2023-03-01Use LocalDefIdSet/Map instead of FxHashSet/Map for ↵Michael Woerister-3/+5
live_symbols_and_ignored_derived_traits query.
2023-03-01Use LocalDefIdSet instead of FxHashSet for reachable_set query.Michael Woerister-2/+2
2023-03-01Use DefIdMap instead of FxHashMap for impl_item_implementor_ids query.Michael Woerister-1/+1
2023-03-01Auto merge of #108587 - matthiaskrgr:rollup-rw6po59, r=matthiaskrgrbors-9/+23
Rollup of 10 pull requests Successful merges: - #108376 (compiler/rustc_session: fix sysroot detection logic) - #108400 (add llvm cgu instructions stats to perf) - #108496 (fix #108495, postfix decrement and prefix decrement has no warning) - #108505 (Further unify validity intrinsics) - #108520 (Small cleanup to `one_bound_for_assoc_type`) - #108560 (Some `infer/mod.rs` cleanups) - #108563 (Make mailmap more correct) - #108564 (Fix `x clean` with specific paths) - #108571 (Add contains_key to SortedIndexMultiMap) - #108578 (Update Fuchsia platform team members) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-01Rollup merge of #108505 - Nilstrieb:further-unify-validity-intrinsics, ↵Matthias Krüger-9/+23
r=michaelwoerister Further unify validity intrinsics Also merges the inhabitedness check into the query to further unify the code paths. Depends on #108364
2023-02-28Make zeroed return an OptionRune Tynan-13/+8
2023-02-28Descriptive error when users try to combine RPITIT/AFIT with specializationMichael Goulet-0/+28
2023-02-27Auto merge of #108487 - cjgillot:no-typeck-mir, r=oli-obkbors-30/+77
Avoid invoking typeck from borrowck This PR attempts to reduce direct dependencies between typeck and MIR-related queries. The goal is to have all the information transit either through THIR or through dedicated queries that avoid depending on the whole `TypeckResults`. In a first commit, we store the type information that MIR building requires into THIR. This avoids edges between mir_built and typeck. In the second and third commit, we wrap informations around closures (upvars, kind origin and user-provided signature) to avoid borrowck depending on typeck information. There should be a single remaining borrowck -> typeck edge in the good path, due to inline consts.
2023-02-27Update MIR doc.Camille GILLOT-4/+0