-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Trait upcasting shadows (trait object) deref coercion #89190
Copy link
Copy link
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-trait_upcasting`#![feature(trait_upcasting)]``#![feature(trait_upcasting)]`P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-trait_upcasting`#![feature(trait_upcasting)]``#![feature(trait_upcasting)]`P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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