-
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
casting variable with type &Unsized
to &dyn Trait
incorrectly says that the variable is unsized.
#111406
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
HKalbasi
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 9, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 11, 2023
…r=b-naber Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. rust-lang#111406.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 11, 2023
…r=b-naber Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. rust-lang#111406.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 11, 2023
…r=b-naber Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. rust-lang#111406.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
May 11, 2023
…r=b-naber Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. rust-lang#111406.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
May 13, 2023
…r=b-naber Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. rust-lang#111406.
I can see how this pointer could have been especially misleading, given
Maybe if it instead said:
but that might risk being too much repetition of similar-but-distinct terms ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
No response
Rationale and extra context
This error confused me as it was in a context that I thought the type of
x
is actually[u8]
, but it was&[u8]
and the problem was aboutdyn
cast.Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: