Merged
Conversation
Collaborator
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. This PR changes Stable MIR cc @oli-obk, @celinval, @spastorino |
spastorino
requested changes
Aug 22, 2023
Member
There was a problem hiding this comment.
I'd implement this more like:
fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
use stable_mir::ty::Generics;
let params: Vec<_> = self.params.iter().map(|param| {
param.stable(tables)
}).collect();
let param_def_id_to_index = params.iter().map(|param| (param.def_id, param.index)).collect();
Generics {
parent: self.parent.map(|did| tables.generic_def(did)),
parent_count: self.parent_count,
params,
param_def_id_to_index,
has_self: self.has_self,
has_late_bound_regions: self.has_late_bound_regions.as_ref().map(|late_bound_regions| late_bound_regions.stable(tables)),
host_effect_index: self.host_effect_index,
}
}Then you can remove FxHashMap requirement, remove the rustc::potential_query_instability attribute and the dependency of rustc_data_structures. Would need to implement stable for Span and would need GenericDef to be Copy, just make all these Defs copy. Otherwise just call opaque directly for now.
spastorino
reviewed
Aug 22, 2023
Member
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 23, 2023
Rollup of 7 pull requests Successful merges: - rust-lang#114930 (Automatically add OS labels to std PRs) - rust-lang#115053 (docs: Add example, reference link for `type` keyword.) - rust-lang#115092 (Add generics_of to smir) - rust-lang#115096 (Add regression test for not `memcpy`ing padding bytes) - rust-lang#115100 (Add support for `ptr::write`s for the `invalid_reference_casting` lint) - rust-lang#115114 (Contents of reachable statics is reachable) - rust-lang#115122 (Fix clippy lint for identical `if`/`else` contraining `?` expressions) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 26, 2023
…-of, r=compiler-errors Add missing high-level stable_mir::generics_of fn We forgot to add this function in rust-lang#115092, as we have done on rust-lang#115084 and other high level APIs. At some point I think we should re-organize the structure of the code but this is what we have for now. r? `@compiler-errors` Would have assigned `@oli-obk` but he is still on vacations
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Aug 26, 2023
…mpiler-errors Add missing high-level stable_mir::generics_of fn We forgot to add this function in rust-lang/rust#115092, as we have done on rust-lang/rust#115084 and other high level APIs. At some point I think we should re-organize the structure of the code but this is what we have for now. r? `@compiler-errors` Would have assigned `@oli-obk` but he is still on vacations
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.
Continuing our covering of smir.
r? @spastorino