-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`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
This code ran in the latest nightly(2019-11-19) in the playground does not compile:
#![feature(const_generics)]
trait FieldType<const NAME: &'static str> {
type FieldType;
}
impl<T> FieldType<"0"> for (T,) {
type FieldType = T;
}
fn main() {
let _: <(Vec<u32>,) as FieldType<"0">>::FieldType = vec![100];
}And it prints this error message
error[E0277]: the trait bound `(std::vec::Vec<u32>,): FieldType<"0">` is not satisfied
--> src/main.rs:12:12
|
12 | let _: <(Vec<u32>,) as FieldType<"0">>::FieldType = vec![100];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FieldType<"0">` is not implemented for `(std::vec::Vec<u32>,)`
|
= help: the following implementations were found:
<(T,) as FieldType<"0">>
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`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.