Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select the 2018 language edition #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Select the 2018 language edition #33

wants to merge 1 commit into from

Conversation

myrrlyn
Copy link

@myrrlyn myrrlyn commented Mar 4, 2020

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

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.
@anweiss
Copy link

anweiss commented Apr 15, 2020

+1

@jonhoo
Copy link

jonhoo commented Jun 21, 2020

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
Copy link

jonhoo commented Jun 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants