/src/test/compile-fail/extfmt-non-literal2.rs

http://github.com/jruderman/rust · Rust · 8 lines · 3 code · 1 blank · 4 comment · 0 complexity · 714f1c865ee52ceeaf8c04e37a57b138 MD5 · raw file

  1. // error-pattern: literal
  2. fn main() {
  3. // #fmt's first argument must be a literal. Hopefully this
  4. // restriction can be eased eventually to just require a
  5. // compile-time constant.
  6. let x = fmt!{20};
  7. }