Repository navigation
Conversation
In summary, rename various things & update a lot of comments.
1. Rename some types, fns that have "clause" in their name to contain
"outlives clause" instead. While we are in a module called `outlives`,
it's not immediately obvious & it certainly doesn't imply that all of
these things only represent / act on outlives-clauses.
Requested by Boxy.
2. Both `global_inferred_outlives` and `explicit_map` store a "global"
mapping from each crate-local item to a set of outlives-clauses
collected so far (one containing the inferred ones, the other the
explicit ones). So name both consistently: `global_inferred_clauses`
and `global_explicit_clauses`, respectively.
Similarly for their types which are now prefixed with `Global`.
3. Remove a bunch of really obvious & distracting comments.
4. Reduce rightward drift in the `ty::Dynamic` match arm by using an
if-let guard.
5. Deduplicate code shared between ADTs & CTAs in `inferred_outlives_of`
6. `bug!()` in a `GenericArgKind::Const(_)` branch which we know is
currently unreachable and which should explode if that were to change.
7. Rename `CrateClausesMap` to `CrateInferredOutlivesClausesMap`.
The type is public & lives in `rustc_middle` since
`inferred_outlives_crate` is a query. Considering that, its name is
way too general.
Moreover, remove all of its docs. This type can only be constructed
via query `inferred_outlives_crate` (well, and via the provider) which
has good docs already that also warn about the fact that query
`inferred_outlives_of` should always be used instead.
8. Remove comment "Typically there won't be many of these [explicit
outlives clauses], except in older code where they were mandatory" is
unnecessary and factually incorrect since there are various places
where we don't imply (early-bound) outlives-bounds.
9. Re. comment "Visit all the crates [...]" and "[...] we walk the crates
again [...]" is no longer correct: We only (re)visit the items in the
local crate; the inferred outlives clauses for cross-crate items have
already been computed and stored in the relevant crate metadata files.
10. Fix the example given in `check_explicit_clauses`'s docs, it has
several issues: Struct `Outer` gets used as a trait bound, it uses
`...: 'static` bounds and states they get processed but as a matter
of fact we don't process static bounds, we specifically only infer
clauses where the LHS is early-bound!
11. Various minor code tweaks.
Member
Author
|
@bors try parent=33295d734447c7a2c22c44190f11bce6164a035a @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 18, 2026
…<try> [perf-only] "[STACKED] GCI: Imply outlives-bounds on free (generic) const items" without the supposed fastpath
This comment has been minimized.
This comment has been minimized.
Contributor
This comment has been minimized.
This comment has been minimized.
fmease
force-pushed
the
gci-impl-without-supposed-fastpath
branch
from
October 18, 2026 12:50
7680043 to
a09f21f
Compare
Collaborator
|
Finished benchmarking commit (5de1deb): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 3.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.9%, secondary -4.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.147s -> 490.382s (0.46%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-auditing https://github.com/rust-lang/rust/pull/143029/changes#r2868932065 with the added context of #143029 (comment) / #143029 (comment).
Gonna compare the perf results from this PR against the ones requested here: #143029 (comment).
(No LLM was or will be used by me during the entire creation process of this PR)