Closed
Description
Compiling playground v0.0.1 (file:///playground)
error[E0283]: type annotations required: cannot resolve `_: Foo`
--> src/main.rs:12:14
|
12 | take_debug(Foo::BAR);
| ^^^^^^^^
|
= note: required by `Foo::BAR`
error: aborting due to previous error
use std::fmt;
trait Foo {
const BAR: u8 = 32;
}
fn take_debug<F: fmt::Debug>(f: F) {
println!("{:?}", f);
}
fn main() {
// error
take_debug(Foo::BAR);
}
https://play.rust-lang.org/?gist=b8610b4b6fa35a3c913434e43f18de1c&version=nightly
https://play.rust-lang.org/?gist=fb75d70964d26c4ce1f75ae98895edec&version=nightly
$ rustc --version
rustc 1.22.0-nightly (eba374fb2 2017-09-11)