Make dyn* casts into a coercion, allow dyn* upcasting#101832
Make dyn* casts into a coercion, allow dyn* upcasting#101832bors merged 4 commits intorust-lang:masterfrom
dyn* casts into a coercion, allow dyn* upcasting#101832Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
eholk
left a comment
There was a problem hiding this comment.
Looks good to me. I added a few questions and suggestions, but feel free to accept the suggestions or not and r=me.
|
☔ The latest upstream changes (presumably #101858) made this pull request unmergeable. Please resolve the merge conflicts. |
aed5815 to
86ce082
Compare
86ce082 to
8c7e836
Compare
| } | ||
| } | ||
|
|
||
| // Returns the vtable pointer type of a `dyn` or `dyn*` type |
There was a problem hiding this comment.
This will need to be implemented in cg_clif too.
|
Looks good to me, thanks! @bors r+ |
…holk Make `dyn*` casts into a coercion, allow `dyn*` upcasting I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways. 1. Make `dyn*` into a coercion instead of a cast 2. Enable `dyn*` upcasting since we basically get it for free 3. Simplify some of the cast checking code since we're using the coercion path now r? `@eholk` but feel free to reassign cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (b15e2c1): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
Footnotes |
|
Implemented in cg_clif as of bjorn3/rustc_codegen_cranelift@342bac9. |
I know that
dyn*is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways.dyn*into a coercion instead of a castdyn*upcasting since we basically get it for freer? @eholk but feel free to reassign
cc @nikomatsakis and @tmandry who might care about making
dyn*casts into a coercion