I tried this code:
trait Test<T: ?Sized> {}
impl<T: ?Sized, U: ?Sized> Test<U> for T {}
fn foo() -> impl Test<(str, str)> {
()
}
fn main() {
foo();
}
I expected to see this happen: Compile error, (str, str) is not well-formed
Instead, this happened: Compiles and runs successfully
Meta
rustc --version --verbose:
rustc 1.71.0-nightly (1a6ae3d69 2023-04-27)
binary: rustc
commit-hash: 1a6ae3d692cfb52b21d0f45ba50b659486e53d6c
commit-date: 2023-04-27
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2
@rustbot label +A-impl-trait +T-types
I tried this code:
I expected to see this happen: Compile error,
(str, str)is not well-formedInstead, this happened: Compiles and runs successfully
Meta
rustc --version --verbose:@rustbot label +A-impl-trait +T-types