about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2023-11-22Auto merge of #118152 - matthiaskrgr:rollup-bqcck4w, r=matthiaskrgrbors-4/+17
Rollup of 5 pull requests Successful merges: - #117972 (Add VarDebugInfo to Stable MIR) - #118109 (rustdoc-search: simplify `checkPath` and `sortResults`) - #118110 (Document `DefiningAnchor` a bit more) - #118112 (Don't ICE when ambiguity is found when selecting `Index` implementation in typeck) - #118135 (Remove quotation from filename in stable_mir) Failed merges: - #118012 (Add support for global allocation in smir) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-21Rollup merge of #118110 - compiler-errors:defining-anchor, r=aliemjayMatthias Krüger-4/+17
Document `DefiningAnchor` a bit more r? types
2023-11-21Fix some unnecessary castsNilstrieb-3/+1
`x clippy compiler -Aclippy::all -Wclippy::unnecessary_cast --fix` with some manual review to ensure every fix is correct.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-62/+53
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-21Remove ClosureKind predicate kindMichael Goulet-12/+0
2023-11-21Uplift CanonicalVarInfo and friendsMichael Goulet-153/+46
2023-11-21Uplift BoundVarMichael Goulet-7/+2
2023-11-21Rollup merge of #118029 - saethlin:allocid-gc, r=RalfJungNilstrieb-7/+0
Expand Miri's BorTag GC to a Provenance GC As suggested in https://github.com/rust-lang/miri/issues/3080#issuecomment-1732505573 We previously solved memory growth issues associated with the Stacked Borrows and Tree Borrows runtimes with a GC. But of course we also have state accumulation associated with whole allocations elsewhere in the interpreter, and this PR starts tackling those. To do this, we expand the visitor for the GC so that it can visit a BorTag or an AllocId. Instead of collecting all live AllocIds into a single HashSet, we just collect from the Machine itself then go through an accessor `InterpCx::is_alloc_live` which checks a number of allocation data structures in the core interpreter. This avoids the overhead of all the inserts that collecting their keys would require. r? ``@RalfJung``
2023-11-21Rollup merge of #118121 - nnethercote:rustc_hir, r=compiler-errorsNilstrieb-16/+1
`rustc_hir` cleanups Just some improvements I found while looking at this code. r? `@WaffleLapkin`
2023-11-21Auto merge of #118107 - matthiaskrgr:rollup-k5bfkfr, r=matthiaskrgrbors-84/+23
Rollup of 8 pull requests Successful merges: - #117327 (Add documentation for some queries) - #117835 (Note about object lifetime defaults in does not live long enough error) - #117851 (Uplift `InferConst` to `rustc_type_ir`) - #117973 (test: Add test for async-move in 2015 Rust proc macro) - #117992 (Don't require intercrate mode for negative coherence) - #118010 (Typeck break expr even if break is illegal) - #118026 (Don't consider regions in `deref_into_dyn_supertrait` lint) - #118089 (intercrate_ambiguity_causes: handle self ty infer + reservation impls) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-20Document DefiningAnchor a bit moreMichael Goulet-4/+17
2023-11-20Rollup merge of #117851 - compiler-errors:uplift-infer-const, r=spastorinoMatthias Krüger-81/+5
Uplift `InferConst` to `rustc_type_ir` We need this in `rustc_type_ir` because the canonicalizer must understand the difference between a const vid and an effect vid. In that way, it's not an implementation detail of the representation of an infer const, but just part of the type ir. If we find out later on that it's better to leave the representation up to the consumer of `rustc_type_ir`, we could abstract `InferConst` (and probably `InferTy` as well) with some traits, but I don't see the benefit of that indirection currently.
2023-11-20Rollup merge of #117835 - Nilstrieb:note-object-lifetime-defaults, ↵Matthias Krüger-1/+5
r=compiler-errors Note about object lifetime defaults in does not live long enough error This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose. The implementation feels a bit questionable, I'm not sure whether there are better ways to do this. There probably are. fixes #117835 r? types
2023-11-20Rollup merge of #117327 - Nilstrieb:more-query-docs, r=compiler-errorsMatthias Krüger-2/+13
Add documentation for some queries
2023-11-20Store feature stability un-splitMichael Goulet-10/+4
2023-11-20Unify defined_lib_features and lib_features queriesMichael Goulet-9/+14
2023-11-20Uplift InferConst to rustc_type_irMichael Goulet-77/+2
2023-11-20Use InferTy from rustc_type_ir unconditionallyMichael Goulet-4/+3
2023-11-20Remove unused arena kinds in `rustc_hir` and `rustc_middle`.Nicholas Nethercote-16/+1
2023-11-19Rollup merge of #117832 - RalfJung:interpret-shift, r=cjgillotMichael Goulet-4/+4
interpret: simplify handling of shifts by no longer trying to handle signed and unsigned shift amounts in the same branch While we're at it, also update comments in codegen and MIR building related to shifts, and fix the overflow error printed by Miri on negative shift amounts.
2023-11-19Expand Miri's BorTag GC to a Provenance GCBen Kimock-7/+0
2023-11-19Add documentation for some queriesNilstrieb-2/+13
2023-11-17Rollup merge of #117549 - DaniPopes:more-copied, r=b-naberMatthias Krüger-1/+1
Use `copied` instead of manual `map`
2023-11-17Auto merge of #117944 - lcnr:region-refactor-uwu, r=BoxyUwUbors-9/+13
some additional region refactorings the commits are selfcontained ✨ r? `@BoxyUwU`
2023-11-17Auto merge of #117278 - lcnr:try-normalize-ty, r=compiler-errorsbors-0/+32
new solver normalization improvements cool beans At the core of this PR is a `try_normalize_ty` which stops for rigid aliases by using `commit_if_ok`. Reworks alias-relate to fully normalize both the lhs and rhs and then equate the resulting rigid (or inference) types. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/68 by avoiding the exponential blowup. Also supersedes #116369 by only defining opaque types if the hidden type is rigid. I removed the stability check in `EvalCtxt::evaluate_goal` due to https://github.com/rust-lang/trait-system-refactor-initiative/issues/75. While I personally have opinions on how to fix it, that still requires further t-types/`@nikomatsakis` buy-in, so I removed that for now. Once we've decided on our approach there, we can revert this commit. r? `@compiler-errors`
2023-11-17rename bound region instantiationlcnr-9/+13
- `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased` - `replace_late_bound_regions_X` -> `instantiate_bound_regions_X`
2023-11-17Rollup merge of #117963 - nnethercote:rustc_query_system, r=compiler-errorsTakayuki Maeda-2/+2
`rustc_query_system` cleanups Minor cleanups. r? `@compiler-errors`
2023-11-17Move `lint_store` from `GlobalCtxt` to `Session`.Nicholas Nethercote-10/+1
This was made possible by the removal of plugin support, which simplified lint store creation. This simplifies the places in rustc and rustdoc that call `describe_lints`, which are early on. The lint store is now built before those places, so they don't have to create their own lint store for temporary use, they can just use the main one.
2023-11-16Auto merge of #117956 - saethlin:provenance-gc-access, r=RalfJungbors-0/+7
Let Miri see the AllocId for all TyCtxt allocations Per https://github.com/rust-lang/miri/pull/3103#discussion_r1391589896 r? `@RalfJung`
2023-11-16Let Miri see the AllocId for all TyCtxt allocationsBen Kimock-0/+7
2023-11-16Reduce exposure of things.Nicholas Nethercote-2/+2
2023-11-15Re-format code with new rustfmtMark Rousskov-7/+7
2023-11-15Bump cfg(bootstrap)sMark Rousskov-4/+3
2023-11-15Auto merge of #117908 - lcnr:region-kind-rename, r=BoxyUwUbors-83/+88
finish `RegionKind` renaming second step of https://github.com/rust-lang/types-team/issues/95 continues the work from #117876. While working on this and I encountered a bunch of further cleanup which I'll either open a tracking issue for or will do in a separate PR: - rewrite the `RegionKind` docs, they still talk about `ReEmpty` and are generally out of date - rename `DescriptionCtx` to `DescriptionCtxt` - what is `CheckRegions::Bound`? - `collect_late_bound_regions` et al - `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`? - `EraseEarlyRegions` visitor should be removed, feels duplicate r? `@BoxyUwU`
2023-11-15Auto merge of #117359 - tmiasko:call-def, r=cjgillotbors-2/+17
Fix def-use check for call terminators Fixes #117331.
2023-11-14Fix def-use check for call terminatorsTomasz Miąsko-2/+17
2023-11-14Auto merge of #117849 - compiler-errors:cycle, r=cjgillotbors-8/+7
make `LayoutError::Cycle` carry `ErrorGuaranteed` Addresses a FIXME, and also I think it's wise for error variants to carry their `ErrorGuaranteed` -- makes it easier to use that `ErrorGuaranteed` for creating, e.g. `TyKind::Error` and other error kinds. Splitting out from #117703.
2023-11-14review + fix CIlcnr-1/+1
2023-11-14finish `RegionKind` renamelcnr-83/+88
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13Auto merge of #117887 - matthiaskrgr:rollup-rgur03f, r=matthiaskrgrbors-4/+4
Rollup of 4 pull requests Successful merges: - #114224 (rustc_llvm: Link to libkstat on Solaris/SPARC) - #117695 (Reorder checks to make sure potential missing expect on Option/Result…) - #117870 (`fn args_ref_X` to `fn args_X`) - #117879 (tests: update check for inferred nneg on zext) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-13Rollup merge of #117870 - lcnr:rename-args_ref, r=compiler-errorsMatthias Krüger-4/+4
`fn args_ref_X` to `fn args_X`
2023-11-13Auto merge of #116866 - slanterns:inspect-stabilize, r=BurntSushibors-1/+0
Stabilize `result_option_inspect` This PR stabilizes `result_option_inspect`: ```rust // core::option impl Option<T> { pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self; } // core::result impl Result<T, E> { pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self; pub fn inspect_err<F: FnOnce(&E)>(self, f: F) -> Self; } ``` <br> Tracking issue: https://github.com/rust-lang/rust/issues/91345. Implementation PR: https://github.com/rust-lang/rust/pull/91346. Closes https://github.com/rust-lang/rust/issues/91345.
2023-11-13update type flagslcnr-10/+10
- `HAS_RE_LATE_BOUND` -> `HAS_RE_BOUND` - `HAS_TY_LATE_BOUND` -> `HAS_TY_BOUND` - `HAS_CT_LATE_BOUND` -> `HAS_CT_BOUND` - `HAS_LATE_BOUND` -> `HAS_BOUND_VARS` - `fn has_late_bound_regions` -> `fn has_bound_regions` - `fnhas_non_region_late_bound` -> `fn has_non_region_bound_vars` - `fn has_late_bound_vars` -> `fn has_bound_vars`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-66/+55
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-13args~~_ref~~_may_unifylcnr-4/+4
2023-11-12make LayoutError::Cycle carry ErrorGuaranteedMichael Goulet-8/+7
2023-11-12Note about object lifetime defaults in does not live long enough errorNilstrieb-1/+5
This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose.
2023-11-12interpret: simplify handling of shifts by no longer trying to handle signed ↵Ralf Jung-4/+4
and unsigned shift amounts in the same branch
2023-11-11Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnaybors-2/+1
Add `std::hash::{DefaultHasher, RandomState}` exports (needs FCP) This implements rust-lang/libs-team#267 to move the libstd hasher types to `std::hash` where they belong, instead of `std::collections::hash_map`. <details><summary>The below no longer applies, but is kept for clarity.</summary> This is a small refactor for #27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API. I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of `std::hash`, but for now, they're at least separated out from the collections code in a way that will make moving that around easier. I decided to simply copy the rustdoc for `std::hash` from `core::hash` since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred. </details>
2023-11-09rework alias-relate to `norm(lhs) == norm(rhs)`lcnr-0/+22