Closed
Description
I tried this code:
#![feature(const_generics)]
const L: usize = 3;
fn main() {
let p = Printer {};
p.print();
}
trait Print<const N: usize> {
fn print(&self) -> usize {
3
}
}
struct Printer {}
impl Print<L> for Printer {}
I expected to see this happen: no dead_code
warning is emitted.
Instead, this happened:
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> src/main.rs:1:12
|
1 | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
warning: constant item is never used: `L`
--> src/main.rs:3:1
|
3 | const L: usize = 3;
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Finished dev [unoptimized + debuginfo] target(s) in 0.70s
Running `target/debug/playground`