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

Mention 2015 edition in "note: ? is not a macro repetition operator" errors #58050

Closed
SimonSapin opened this issue Feb 1, 2019 · 2 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@SimonSapin
Copy link
Contributor

Example error message:

error: expected `*` or `+`
   --> src/libcore/macros.rs:767:41
    |
767 |             impl $( <$( $lifetime ),+> )? Fn<(&'a str,)> for $Name {
    |                                         ^
    |
    = note: `?` is not a macro repetition operator

But it is! I couldn’t figure it out without asking on IRC what’s going on. It is a repetition operator… but not in the 2015 edition. Switching to 2018 would make this error go away.

The error message should mention this.

@SimonSapin SimonSapin added the A-diagnostics Area: Messages for errors, warnings, and lints label Feb 1, 2019
@estebank
Copy link
Contributor

estebank commented Feb 1, 2019

Mentoring notes:

There are three notes in https://github.com/rust-lang/rust/blob/master/src/libsyntax/ext/tt/quoted.rs that need to be updated to read

`?` is not a macro repetition operator in the 2015 edition, but accepted in the 2018 edition

After doing the code change you need to run ./x.py test src/test/ui --stage 1 --bless to update the stderr output files. The Forge has many extra resources to read, particularly useful is "How to build and run".

@estebank estebank added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Feb 1, 2019
Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019
Fix for issue  rust-lang#58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue rust-lang#58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019
Fix for issue  rust-lang#58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue rust-lang#58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019
Fix for issue  rust-lang#58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue rust-lang#58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019
Fix for issue  rust-lang#58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue rust-lang#58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019
Fix for issue  rust-lang#58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue rust-lang#58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
bors added a commit that referenced this issue Feb 27, 2019
Rollup of 14 pull requests

Successful merges:

 - #58075 (Fix for issue  #58050)
 - #58627 (rustdoc: move collapse and unindent docs passes earlier)
 - #58630 (Make `visit_clobber` panic-safe.)
 - #58678 (Deny `async fn` in 2015 edition)
 - #58680 (Fix an indexing error when using `x.py help`)
 - #58703 (Fix copy-pasted typo for read_string return value)
 - #58744 (Update dlmalloc to 0.1.3)
 - #58746 (std: docs: Disable running several Stdio doctests)
 - #58748 (update scoped_tls to 1.0)
 - #58749 (Reduce Repetitions of (n << amt) >> amt)
 - #58752 (Update string_cache_codegen to 0.4.2)
 - #58755 (Clarify `rotate_{left,right}` docs)
 - #58757 (Normalize the type Self resolves to in an impl)
 - #58761 (Add tracking issue for the unwind attribute)

Failed merges:

r? @ghost
@polybuildr
Copy link
Contributor

It looks like this was fixed in PR #58075 and merged by bors. Should this issue be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

3 participants