Closed
Description
Code
#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
type Foo<T: Debug> = (impl Debug, usize);
fn foo<U: Debug>() -> Foo<U> {
(Vec::<U>::new(), 1234)
}
Current output
warning: bounds on generic parameters are not enforced in type aliases
--> src/main.rs:5:13
|
5 | type Foo<T: Debug> = (impl Debug, usize);
| ^^^^^
|
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
5 - type Foo<T: Debug> = (impl Debug, usize);
5 + type Foo<T> = (impl Debug, usize);
|
Desired output
No warning at all, I think, since the bound is actually checked; applying the suggestion yields code that does not compile.
Rationale and extra context
No response
Other cases
No response
Anything else?
No response