I expected impl …-in-binding to get elaborated to impl Sized + … unless … contains ?Sized because that's what we do for all other kinds of impl-Trait (APIT, RPIT(IT), TAIT, ATPIT). However, we don't seem to do that right now.
I expected the code below to fail but it compiled successfully:
#![feature(impl_trait_in_bindings)]
fn main() {
let _: &impl std::fmt::Debug = &[0u8][..];
}
The &impl std::fmt::Debug above should actually elaborate to &(impl std::fmt::Debug + Sized) and therefore the code should fail due to an unfulfilled [u8]: Sized obligation/goal.
As in other places, users need to actually write &(impl std::fmt::Debug + ?Sized) if they want the code above to work like on master.
I expected
impl …-in-binding to get elaborated toimpl Sized + …unless…contains?Sizedbecause that's what we do for all other kinds of impl-Trait (APIT, RPIT(IT), TAIT, ATPIT). However, we don't seem to do that right now.I expected the code below to fail but it compiled successfully:
The
&impl std::fmt::Debugabove should actually elaborate to&(impl std::fmt::Debug + Sized)and therefore the code should fail due to an unfulfilled[u8]: Sizedobligation/goal.As in other places, users need to actually write
&(impl std::fmt::Debug + ?Sized)if they want the code above to work like on master.