-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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
The following code
pub trait HasLength {
const LENGTH: usize;
}
fn foo<T: Copy + HasLength>(x: T) -> [T; T::LENGTH] { [x; T::LENGTH] }
results in an error “error[E0599]: no associated item named LENGTH
found for type T
in the current scope”. Which is not true, it just doesn’t work in arrays yet (see #29646). The error message should reflect that.
durka, CryZe, quininer, Enet4, mitchmindtree and 16 more
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.