Don't elaborate non-obligations into obligations#109641
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 27, 2023
Merged
Don't elaborate non-obligations into obligations#109641bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Collaborator
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
oli-obk
reviewed
Mar 26, 2023
Contributor
Collaborator
Collaborator
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 27, 2023
…-obl, r=oli-obk Don't elaborate non-obligations into obligations It's suspicious to elaborate a `PolyTraitRef` or `Predicate` into an `Obligation`, since the former does not have a param-env associated with it, but the latter does. This is a footgun that, while not being misused *currently* in the compiler, easily could be misused by someone less familiar with the elaborator's inner workings. This PR just changes the API -- ideally, the elaborator wouldn't even have to deal with obligations if we're not elaborating obligations, but that would require a bit more abstraction than I could be bothered with today.
lcnr
reviewed
Mar 27, 2023
| @@ -1912,14 +1912,13 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> { | |||
| // Check elaborated bounds. | |||
| let implied_obligations = traits::elaborate_predicates_with_span(tcx, predicates_with_span); | |||
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 27, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#97506 (Stabilize `nonnull_slice_from_raw_parts`) - rust-lang#98651 (Follow C-RW-VALUE in std::io::Cursor example) - rust-lang#102742 (Remove unnecessary raw pointer in __rust_start_panic arg) - rust-lang#109587 (Use an IndexVec to debug fingerprints.) - rust-lang#109613 (fix type suggestions in match arms) - rust-lang#109633 (Fix "Directly go to item in search if there is only one result" setting) - rust-lang#109635 (debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of) - rust-lang#109641 (Don't elaborate non-obligations into obligations) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
It's suspicious to elaborate a
PolyTraitReforPredicateinto anObligation, since the former does not have a param-env associated with it, but the latter does. This is a footgun that, while not being misused currently in the compiler, easily could be misused by someone less familiar with the elaborator's inner workings.This PR just changes the API -- ideally, the elaborator wouldn't even have to deal with obligations if we're not elaborating obligations, but that would require a bit more abstraction than I could be bothered with today.