-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.