mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 17:22:19 +00:00
- Don't suggest braces unnecessarily for numeric literals - Use verbose suggestion - Tweak messages ``` error[E0747]: type provided when a constant was expected --> $DIR/suggest_const_for_array.rs:6:15 | LL | example::<[usize; 3]>(); | ^^^^^^^^^^ array type provided where a `usize` was expected | help: you might have meant to use the array's length's value | LL - example::<[usize; 3]>(); LL + example::<3>(); | ```
14 lines
418 B
Rust
14 lines
418 B
Rust
//@revisions: min_generic_const_args generic_const_args regular
|
|
#![crate_type = "lib"]
|
|
#![cfg_attr(min_generic_const_args, feature(min_generic_const_args))]
|
|
#![cfg_attr(generic_const_args, feature(min_generic_const_args))]
|
|
|
|
fn example<const N: usize>() {}
|
|
|
|
fn other() {
|
|
example::<[usize; 3]>();
|
|
//~^ ERROR type provided when a const
|
|
example::<[usize; 4 + 5]>();
|
|
//~^ ERROR type provided when a const
|
|
}
|