Generic trait implementation not consistently recognized by the compiler #85671
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I am trying to get the following to work:
I expected to see this happen:
The line 28 of the method
failing
should compile, as it it callsas_ref_a
to build aA(&[T])
type, which implementAsSlice
for allT
. When callingas_ref_a
on that value, the compiler should recognize thatA(&[T])
is indeedAsSlice
.Instead this happened:
The second call to
as_ref_a
does not recognize thatA&[T]
implementsAsSlice
, and fails to compile.Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: