stop special-casing 'static in evaluation#102472
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 28, 2023
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This was referenced Oct 3, 2022
notriddle
added a commit
to notriddle/rust
that referenced
this pull request
Oct 21, 2022
…, r=jackh726 make `order_dependent_trait_objects` show up in future-breakage reports tried to change it to a hard error in rust-lang#102474 but breaking the more than 1000 dependents of `traitobject` doesn't feel great 😅 This lint has existed since more than 3 years now and the way this is currently implemented is buggy and will break with rust-lang#102472. imo we should upgrade it to also report for dependencies and maybe also backport this to beta. Then after maybe 2-3 stable versions I would like to finally convert this lint to a hard error.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 21, 2022
…, r=jackh726 make `order_dependent_trait_objects` show up in future-breakage reports tried to change it to a hard error in rust-lang#102474 but breaking the more than 1000 dependents of `traitobject` doesn't feel great 😅 This lint has existed since more than 3 years now and the way this is currently implemented is buggy and will break with rust-lang#102472. imo we should upgrade it to also report for dependencies and maybe also backport this to beta. Then after maybe 2-3 stable versions I would like to finally convert this lint to a hard error.
Collaborator
|
☔ The latest upstream changes (presumably #103375) made this pull request unmergeable. Please resolve the merge conflicts. |
Collaborator
|
☔ The latest upstream changes (presumably #104758) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
|
@rustbot label: -T-compiler +T-types |
Contributor
Member
|
@lcnr what's the status of this? |
Member
|
Given this only changes unstable marker trait behavior, fine to land with open issue referenced in known bug |
Collaborator
|
Could not assign reviewer from: |
Member
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 28, 2023
Rollup of 8 pull requests Successful merges: - rust-lang#91793 (socket ancillary data implementation for FreeBSD (from 13 and above).) - rust-lang#92284 (Change advance(_back)_by to return the remainder instead of the number of processed elements) - rust-lang#102472 (stop special-casing `'static` in evaluation) - rust-lang#108480 (Use Rayon's TLV directly) - rust-lang#109321 (Erase impl regions when checking for impossible to eagerly monomorphize items) - rust-lang#109470 (Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds`) - rust-lang#109562 (Update ar_archive_writer to 0.1.3) - rust-lang#109629 (remove obsolete `givens` from regionck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Member
|
For triage purposes: from the results in the rollup where this PR landed, and the results in a revert. @rustbot label: +perf-regression |
traviscross
added a commit
to traviscross/rust
that referenced
this pull request
Mar 14, 2026
The `TypeOutlives` handler in `evaluate_predicate_recursively` checks whether a type in a `T: 'a` predicate has free regions, bound regions, or inference variables -- and if so, returns `EvaluatedToOkModuloRegions` rather than `EvaluatedToOk`. The comment says "no free lifetimes or generic parameters", but the code checked `has_non_region_infer()` twice instead of checking `has_non_region_param()` for the second condition. This meant that `TypeOutlives(T, 'static)` where `T` is a type parameter returned `EvaluatedToOk` -- claiming the result holds unconditionally -- when the correct answer is `EvaluatedToOkModuloRegions`. The distinction matters during marker trait winnowing in `prefer_lhs_over_victim`, which uses `must_apply_considering_regions()` (true only for `EvaluatedToOk`) to decide whether one overlapping impl beats another. With the bug, a `T: 'static`-bounded impl appeared equally strong as an unrestricted impl, making the winner depend on source order. This caused spurious E0310 errors when the more-constrained impl happened to appear after the less-constrained one. Fixes rust-lang#109481. This same symptom was originally filed as rust-lang#84917 and fixed in PR rust-lang#88139. Then PR rust-lang#102472 rewrote the `TypeOutlives` handler, introducing the duplicate `has_non_region_infer()` and losing the param check, regressing this. Shortly after, rust-lang#109481 was filed. It noted the connection to rust-lang#102472 -- that it was only relevant after it -- but apparently no one noticed the duplicate condition.
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.
fixes #102360
I have no idea whether this actually removed all places where
'staticmatters. Without canonicalization it's very easy to accidentally rely on'staticagain. Blocked on changing theorder_dependent_trait_objectsfuture-compat lint to a hard errorr? @nikomatsakis