-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Stabilize RFC3324 dyn upcasting coercion #118133
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
2afd567
to
d72a9ea
Compare
The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
d72a9ea
to
ebb3064
Compare
This comment has been minimized.
This comment has been minimized.
ebb3064
to
966e930
Compare
Should we keep the |
Sure, if those impls don't do what the user expects we should tell them. What about this diagnostic change? - warning: `dyn Foo<'_>` implements `Deref` with supertrait `Bar<'_>` as target
+ warning: `dyn Foo<'_>` implements `Deref` with supertrait `Bar<'_>` as target is shadowed by coercion
--> $DIR/migrate-lint-deny-regions.rs:8:1
|
LL | impl<'a> Deref for dyn Foo<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | type Target = dyn Bar<'a>;
| -------------------------- target type is set here
|
- = warning: this will change its meaning in a future release!
- = note: for more information, see issue #89460 <https://github.com/rust-lang/rust/issues/89460>
+ = help: consider removing this implementation in favour for the implicit coercion |
maybe something like - warning: `dyn Foo<'_>` implements `Deref` with supertrait `Bar<'_>` as target
+ warning: this `Deref` implementation is covered by the implicit super-trait coercion
--> $DIR/migrate-lint-deny-regions.rs:8:1
|
LL | impl<'a> Deref for dyn Foo<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | type Target = dyn Bar<'a>;
| -------------------------- target type is set here
|
- = warning: this will change its meaning in a future release!
- = note: for more information, see issue #89460 <https://github.com/rust-lang/rust/issues/89460>
+ = help: consider removing this implementation or replacing it with a method instead something like this maybe? 🤔 |
966e930
to
e9d6d3a
Compare
Done. I've restored the lint, removed the future incompatibility mark and changed the diagnostic output as discussed. |
e9d6d3a
to
10b9a2b
Compare
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.
@bors delegate+ |
✌️ @Urgau, you can now approve this pull request! If @WaffleLapkin told you to " |
Aka trait_upcasting feature. And also adjust the `deref_into_dyn_supertrait` lint.
10b9a2b
to
4c2d6de
Compare
|
…affleLapkin Stabilize RFC3324 dyn upcasting coercion This PR stabilize the `trait_upcasting` feature, aka rust-lang/rfcs#3324. The FCP was completed here: rust-lang#65991 (comment). ~~And also remove the `deref_into_dyn_supertrait` lint which is now handled by dyn upcasting coercion.~~ Heavily inspired by rust-lang#101718 Fixes rust-lang#65991
☀️ Test successful - checks-actions |
@rustbot label +relnotes |
Finished benchmarking commit (6d2b84b): 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)ResultsThis 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.
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: 675.017s -> 675.132s (0.02%) |
Hi, thanks for this! |
Because when this PR landed on the 22 of November we were already in track for 1.76. |
Thank you for the explanation! |
…abilization, r=lcnr Revert stabilization of trait_upcasting feature Reverts rust-lang#118133 This reverts commit 6d2b84b, reversing changes made to 73bc121. The feature has a soundness bug: * rust-lang#120222 It is unclear to me whether we'll actually want to destabilize, but I thought it was still prudent to open the PR for easy destabilization once we get there.
…abilization, r=lcnr Revert stabilization of trait_upcasting feature Reverts rust-lang#118133 This reverts commit 6d2b84b, reversing changes made to 73bc121. The feature has a soundness bug: * rust-lang#120222 It is unclear to me whether we'll actually want to destabilize, but I thought it was still prudent to open the PR for easy destabilization once we get there.
Rollup merge of rust-lang#120233 - oli-obk:revert_trait_obj_upcast_stabilization, r=lcnr Revert stabilization of trait_upcasting feature Reverts rust-lang#118133 This reverts commit 6d2b84b, reversing changes made to 73bc121. The feature has a soundness bug: * rust-lang#120222 It is unclear to me whether we'll actually want to destabilize, but I thought it was still prudent to open the PR for easy destabilization once we get there.
This PR stabilize the
trait_upcasting
feature, aka rust-lang/rfcs#3324.The FCP was completed here: #65991 (comment).
And also remove thederef_into_dyn_supertrait
lint which is now handled by dyn upcasting coercion.Heavily inspired by #101718
Fixes #65991