-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug
Description
minimization:
trait T {}
fn dyn_t(d: &dyn T) {}
fn main() {
struct A;
impl T for A {}
let a = A;
let b = {
struct B;
impl T for B {}
B
};
dyn_t(&a);
dyn_t(&b);
// ^^ type-mismatch: expected &dyn T, found &B
}
this is minimized from code that prost generates: https://github.com/tokio-rs/prost/blob/34d0e2b309a1c8fa33871ccd8404573dc3b81b15/prost-derive/src/field/scalar.rs#L220 -> https://github.com/tokio-rs/prost/blob/34d0e2b309a1c8fa33871ccd8404573dc3b81b15/prost-derive/src/field/mod.rs#L149
rust-analyzer version: 0.4.1453-standalone
rustc version: rustc 1.66.1 (90743e729 2023-01-10)
Metadata
Metadata
Assignees
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug