≈ the.bay.news

"type const" syntax error with gca_const_items feature?

The Rust Programming Language Forum
"type const" syntax error with gca_const_items feature?
Hello, I am not sure if I'm doing something wrong or this is a bug to be reported, but this is the situation: The following code on its own (as expected) does not compile: trait Trait { const N: usize; fn foo() -> [u8; Self::N]; } The error message suggests adding the generic_const_exprs feature or gca_const_items (which I assume is a new feature, I have not heard of it before). After using gca_const_items, the compiler suggestion is this: | 5 | fn foo() -> [u8; Self::N]; | ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.