about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2024-07-08Auto merge of #127421 - cjgillot:cache-iter, r=fmeasebors-8/+26
Cache hir_owner_nodes in ParentHirIterator. Lint level computation may traverse deep HIR trees using that iterator. This calls `hir_owner_nodes` many times for the same HIR owner, which is wasterful. This PR caches the value to allow a more efficient iteration scheme. r? ghost for perf
2024-07-07Fix conflicts after rebaseMaybe Lapkin-1/+1
- r-l/r 126784 - r-l/r 127113 - r-l/miri 3562
2024-07-07Get rid of the redundant elaboration in middleMichael Goulet-94/+10
2024-07-07Uplift elaborationMichael Goulet-6/+118
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-4/+68
2024-07-07Uplift trait_ref_is_knowable and friendsMichael Goulet-0/+12
2024-07-07Add fundamental to trait defMichael Goulet-1/+6
2024-07-07iter_identity is a better nameMichael Goulet-1/+1
2024-07-06Rollup merge of #127405 - ↵Michael Goulet-12/+2
compiler-errors:uplift-predicate-emitting-relation, r=lcnr uplift `PredicateEmittingRelation` Small follow-up to #127333 r? lcnr
2024-07-06Remove walk_shallowMichael Goulet-17/+0
2024-07-06Uplift push_outlives_componentsMichael Goulet-0/+7
2024-07-06Uplift PredicateEmittingRelation firstMichael Goulet-12/+2
2024-07-06Cache hir_owner_nodes in ParentHirIterator.Camille GILLOT-8/+26
2024-07-05Rollup merge of #127352 - Zalathar:coverage-info, r=oli-obkGuillaume Gomez-17/+32
coverage: Rename `mir::coverage::BranchInfo` to `CoverageInfoHi` This opens the door to collecting and storing coverage information that is unrelated to branch coverage or MC/DC, during MIR building. There is no change to the output of coverage instrumentation, but one deliberate change is that functions now *always* have an attached `CoverageInfoHi` (if coverage is enabled and they are eligible), even if they didn't collect any interesting branch information. --- `@rustbot` label +A-code-coverage
2024-07-05Rollup merge of #124290 - klensy:dep-format, r=jieyouxuGuillaume Gomez-3/+3
DependencyList: removed outdated comment Comment was outdated. Didn't updated description, as `Linkage` enum have descriptive names. Also added fixme about moving this file to rustc_metadata.
2024-07-05Tweak how the extra newline is printed after coverage infoZalathar-2/+7
2024-07-05coverage: Rename `mir::coverage::BranchInfo` to `CoverageInfoHi`Zalathar-15/+25
This opens the door to collecting and storing coverage information that is unrelated to branch coverage or MC/DC.
2024-07-04Auto merge of #123781 - RalfJung:miri-fn-identity, r=oli-obkbors-26/+53
Miri function identity hack: account for possible inlining Having a non-lifetime generic is not the only reason a function can be duplicated. Another possibility is that the function may be eligible for cross-crate inlining. So also take into account the inlining attribute in this Miri hack for function pointer identity. That said, `cross_crate_inlinable` will still sometimes return true even for `inline(never)` functions: - when they are `DefKind::Ctor(..) | DefKind::Closure` -- I assume those cannot be `InlineAttr::Never` anyway? - when `cross_crate_inline_threshold == InliningThreshold::Always` so maybe this is still not quite the right criterion to use for function pointer identity.
2024-07-04Auto merge of #127288 - lqd:typelen-cache, r=compiler-errorsbors-3/+16
cache type sizes in type-size limit visitor This is basically https://github.com/rust-lang/rust/pull/125507#issuecomment-2206813779 as lcnr can't open the PR now. Locally it reduces the `itertools` regression by quite a bit, to "only +50%" compared to nightly (that includes overhead from the local lack of artifact post-processing, and is just a data point to compare to the 10-20x timings without the cache). ```console Benchmark 1: cargo +stage1 build --release Time (mean ± σ): 2.721 s ± 0.009 s [User: 2.446 s, System: 0.325 s] Range (min … max): 2.710 s … 2.738 s 10 runs Benchmark 2: cargo +nightly build --release Time (mean ± σ): 1.784 s ± 0.005 s [User: 1.540 s, System: 0.279 s] Range (min … max): 1.778 s … 1.792 s 10 runs Summary cargo +nightly build --release ran 1.52 ± 0.01 times faster than cargo +stage1 build --release ``` On master, it's from 34s to the 2.7s above. r? compiler-errors
2024-07-04Align the changes to the lang decisionMaybe Lapkin-0/+8
2024-07-03Rollup merge of #127294 - ldm0:ldm_coroutine2, r=lcnrMatthias Krüger-1/+5
Less magic number for corountine
2024-07-04Less magic number for corountineLiu Dingming-1/+5
2024-07-03cache type sizes in type-size limit visitorRémy Rakic-3/+16
2024-07-03Add `constness` to `TraitDef`Deadbeef-1/+9
2024-07-03Rollup merge of #127145 - compiler-errors:as_lang_item, r=lcnrMatthias Krüger-45/+68
Add `as_lang_item` to `LanguageItems`, new trait solver Add `as_lang_item` which turns `DefId` into a `TraitSolverLangItem` in the new trait solver, so we can turn the large chain of if statements in `assemble_builtin_impl_candidates` into a match instead. r? lcnr
2024-07-03Auto merge of #125507 - compiler-errors:type-length-limit, r=lcnrbors-80/+219
Re-implement a type-size based limit r? lcnr This PR reintroduces the type length limit added in #37789, which was accidentally made practically useless by the caching changes to `Ty::walk` in #72412, which caused the `walk` function to no longer walk over identical elements. Hitting this length limit is not fatal unless we are in codegen -- so it shouldn't affect passes like the mir inliner which creates potentially very large types (which we observed, for example, when the new trait solver compiles `itertools` in `--release` mode). This also increases the type length limit from `1048576 == 2 ** 20` to `2 ** 24`, which covers all of the code that can be reached with craterbot-check. Individual crates can increase the length limit further if desired. Perf regression is mild and I think we should accept it -- reinstating this limit is important for the new trait solver and to make sure we don't accidentally hit more type-size related regressions in the future. Fixes #125460
2024-07-03Auto merge of #123720 - amandasystems:dyn-enable-refactor, r=nikomatsakisbors-0/+3
Rewrite handling of universe-leaking placeholder regions into outlives constraints This commit prepares for Polonius by moving handling of leak check/universe errors out of the inference step by rewriting any universe error into an outlives-static constraint. This variant is a work in progress but seems to pass most tests. Note that a few debug assertions no longer hold; a few extra eyes on those changes are appreciated!
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-8/+20
2024-07-02Make fn traits into first-class TraitSolverLangItems to avoid needing ↵Michael Goulet-9/+7
fn_trait_kind_from_def_id
2024-07-02add TyCtxt::as_lang_item, use in new solverMichael Goulet-37/+62
2024-07-02Fix spansMichael Goulet-7/+14
2024-07-02Re-implement a type-size based limitMichael Goulet-11/+125
2024-07-02Give Instance::expect_resolve a spanMichael Goulet-5/+7
2024-07-02Miscellaneous renamingMichael Goulet-60/+64
2024-07-02Miri function identity hack: account for possible inliningRalf Jung-26/+53
2024-07-02Rollup merge of #127230 - hattizai:patch01, r=saethlinMatthias Krüger-1/+1
chore: remove duplicate words remove duplicate words in comments to improve readability.
2024-07-02Rollup merge of #127224 - tgross35:pretty-print-exhaustive, r=RalfJungMatthias Krüger-16/+18
Make `FloatTy` checks exhaustive in pretty print This should prevent the default fallback if we add more float types in the future.
2024-07-02Rollup merge of #127146 - compiler-errors:fast-reject, r=lcnrMatthias Krüger-388/+4
Uplift fast rejection to new solver Self explanatory. r? lcnr
2024-07-02chore: remove duplicate wordshattizai-1/+1
2024-07-01Make `FloatTy` checks exhaustive in pretty printTrevor Gross-16/+18
This should prevent the default fallback if we add more float types in the future.
2024-07-01Handle universe leaks by rewriting the constraint graphAmanda Stjerna-0/+3
This version is a squash-rebased version of a series of exiermental commits, since large parts of them were broken out into PR #125069. It explicitly handles universe violations in higher-kinded outlives constraints by adding extra outlives static constraints.
2024-06-30Uplift fast rejection to new solverMichael Goulet-388/+4
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-4/+30
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-29Rollup merge of #127045 - compiler-errors:explicit, r=oli-obkMatthias Krüger-56/+30
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated Rename: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
2024-06-28address review commentsDeadbeef-2/+2
2024-06-28Implement `Min` trait in new solverDeadbeef-0/+5
2024-06-28implement new effects desugaringDeadbeef-4/+25
2024-06-28Rollup merge of #124741 - nebulark:patchable-function-entries-pr, ↵Matthias Krüger-0/+27
r=estebank,workingjubilee patchable-function-entry: Add unstable compiler flag and attribute Tracking issue: #123115 Add the -Z patchable-function-entry compiler flag and the #[patchable_function_entry(prefix_nops = m, entry_nops = n)] attribute. Rebased and adjusted the canditate implementation to match changes in the RFC.
2024-06-27supertrait_def_ids was already implemented in middleMichael Goulet-37/+3
2024-06-27supertrait_def_idsMichael Goulet-3/+2