-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subst -> instantiate #116144
subst -> instantiate #116144
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
r? @oli-obk |
@@ -619,7 +619,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { | |||
// programs, so we need to use delay_span_bug here. See #82126. | |||
self.infcx.tcx.sess.delay_span_bug( | |||
hir_arg.span(), | |||
format!("unmatched subst and hir arg: found {kind:?} vs {hir_arg:?}"), | |||
format!("unmatched arg and hir arg: found {kind:?} vs {hir_arg:?}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"arg and hir arg" -- maybe "generic param and hir arg"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, it is a ty::GenericArg
and a hir generic arg, the ty generic arg could be something like 3 which is not a param 🤔 the comment is somewhat :/ rn though
@@ -427,7 +427,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ { | |||
let bound_vars = tcx.late_bound_vars(binding.hir_id); | |||
ty::Binder::bind_with_vars(subst_output, bound_vars) | |||
} else { | |||
// Include substitutions for generic parameters of associated types | |||
// Include instantiations of the generic parameters of associated types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this comment doesn't make sense.
@@ -569,7 +569,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { | |||
) -> Result<T, ErrorHandled> { | |||
frame | |||
.instance | |||
.try_subst_mir_and_normalize_erasing_regions( | |||
.try_instantiate_mir_and_normalize_erasing_regions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I found the previous term much clearer (it's a generic function and we are substituting in concrete values)... but I guess that ship has sailed so it probably makes sense to make this consistent.
The function this is in is called subst_from_frame_and_normalize_erasing_regions
. So do you suggest that should be renamed to instantiate_from_frame_and_normalize_erasing_regions
or so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function this is in is called
subst_from_frame_and_normalize_erasing_regions
. So do you suggest that should be renamed toinstantiate_from_frame_and_normalize_erasing_regions
or so?
yeah, it does feel a bit verbose though 😅 🤷
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
@bors r+ |
subst -> instantiate continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116099 (Add regression test for issue rust-lang#79865) - rust-lang#116102 (Correct codegen of `ConstValue::Indirect` scalar and scalar pair) - rust-lang#116131 (Rename `cold_path` to `outline`) - rust-lang#116144 (subst -> instantiate) - rust-lang#116151 (Fix typo in rustdoc unstable features doc) - rust-lang#116153 (Update books) - rust-lang#116162 (Gate and validate `#[rustc_safe_intrinsic]`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116099 (Add regression test for issue rust-lang#79865) - rust-lang#116102 (Correct codegen of `ConstValue::Indirect` scalar and scalar pair) - rust-lang#116131 (Rename `cold_path` to `outline`) - rust-lang#116144 (subst -> instantiate) - rust-lang#116151 (Fix typo in rustdoc unstable features doc) - rust-lang#116153 (Update books) - rust-lang#116162 (Gate and validate `#[rustc_safe_intrinsic]`) r? `@ghost` `@rustbot` modify labels: rollup
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (5ae769f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 633.132s -> 631.857s (-0.20%) |
subst -> instantiate continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
continues #110793, there are still quite a few uses of
subst
andsubstitute
, but changing them all in the same PR was a bit too much, so I've stopped here for now.