Closed
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
Area: const generics (parameters and arguments)Category: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(const_generics)]`Relevant to the compiler team, which will review and decide on the PR/issue.