-
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
Trait upcasting shadows (trait object) deref coercion #89190
Comments
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-high |
Bisection: searched nightlies: from nightly-2020-01-01 to nightly-2021-09-23 bisected with cargo-bisect-rustc v0.6.0Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2020-01-01 |
There is a Zulip thread that discusses this issue. Tagging this with T-lang since this is a change in semantics. @rustbot label +A-traits +F-trait_upcasting +T-lang +T-compiler |
I'm reverting the workaround here as I'm done with debugging for the time being. This code currently trips a beta regression. See <rust-lang/rust#89190>.
I'm not sure what the proper procedure is in this case, but I just noticed this hit stable in 1.56.0 (without the lint appearing beforehand) and broke my crate 😬 I'll work around it on my end, since I need this to continue work on a downstream crate. |
…ref coercion](rust-lang/rust#89190) hitting stable before its fix
Hmm, it seems that the fix didn't get backported to 1.56. Does 1.57-beta work? |
@nbdd0121 It does indeed: https://play.rust-lang.org/?version=beta&mode=debug&edition=2018&gist=0d7f48d15e1aa249d953fa7d5b6cc2f9
The playground uses |
Code
I tried this code:
I expected to see this happen: This should probably continue to compile as before, unless proven to be equivalent.
Instead, this happened: The detection for #65991 seems to be a little too aggressive, so it's flagging the coercion as feature-gated in beta even though a deref coercion is available:
Playground: https://play.rust-lang.org/?version=beta&mode=debug&edition=2018&gist=0d7f48d15e1aa249d953fa7d5b6cc2f9
Version it worked on
It most recently worked on: 1.55.0
rustc +stable --version --verbose
:Version with regression
rustc +beta --version --verbose
:Backtrace
(not applicable)
@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
The text was updated successfully, but these errors were encountered: