static-assertions icon indicating copy to clipboard operation
static-assertions copied to clipboard

Select the 2018 language edition

Open myrrlyn opened this issue 5 years ago • 3 comments

The use of the ? macro operator, for zero-or-one selection, is only available in the 2018 edition of the language. Without the edition key set in the manifest, Rust compiles the crate in the 2015 syntax version, and rejects the macros.

Observation

1.1.0 fails to compile on my machine, with the following error:

error: expected `*` or `+`
  --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823\static_assertions-1.1.0/src/assert_cfg.rs:41:35
   |
41 |     ($($cfg:meta)+, $msg:expr $(,)?) => {
   |                                   ^
   |
   = note: `?` is not a macro repetition operator in the 2015 edition, but is accepted in the 2018 edition

myrrlyn avatar Mar 04 '20 21:03 myrrlyn

+1

anweiss avatar Apr 15 '20 17:04 anweiss

I'm not sure why, but this is also now starting to show up in downstream crates. Don't know if that's a recent development. Any particular reason not to land this @nvzqz ?

jonhoo avatar Jun 21 '20 17:06 jonhoo

Ah, it fails only on rust 1.36.0 and below it seems.

jonhoo avatar Jun 21 '20 17:06 jonhoo