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

Update ? repetition disambiguation. #49719

Merged
merged 2 commits into from
Apr 16, 2018
Merged

Update ? repetition disambiguation. #49719

merged 2 commits into from
Apr 16, 2018

Conversation

mark-i-m
Copy link
Member

@mark-i-m mark-i-m commented Apr 6, 2018

Do not merge (yet)

This is a test implementation of some ideas from discussion in #48075 . This PR

  • disallows ? repetition from taking a separator, since the separator is never used.
  • disallows the use of ? as a separator. This allows patterns like $(a)?+ to match + and a+ rather than a?a?a. This is a breaking change, but maybe that's ok? Perhaps a crater run is the right approach?

cc @durka @alexreg @nikomatsakis

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 6, 2018

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Resolving deltas: 100% (612410/612410), completed with 4868 local objects.
---
[00:00:44] configure: rust.quiet-tests     := True
---
[00:39:37] ..........................................................................i.........................
[00:39:43] .................i..................................................................................
---
[00:40:18] ..................................................F...........................................i.....
[00:40:25] ....................................................................i...............................
---
[00:40:46] 1 error: `?` macro repetition does not allow a separator
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:29:10
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:22:10
[00:40:46] 3    |
[00:40:46] 4 LL |     ($(a),?) => {} //~ ERROR `?` macro repetition does not allow a separator
[00:40:46] 5    |          ^
[00:40:46]
[00:40:46] 6
[00:40:46] 7 error: no rules expected the token `?`
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:43:11
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:36:11
[00:40:46] 9    |
[00:40:46] 10 LL |     foo!(a?a?a); //~ ERROR no rules expected the token `?`
[00:40:46] 11    |           ^
[00:40:46]
[00:40:46] 12
[00:40:46] 13 error: no rules expected the token `?`
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:44:11
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:37:11
[00:40:46] 15    |
[00:40:46] 16 LL |     foo!(a?a); //~ ERROR no rules expected the token `?`
[00:40:46] 17    |           ^
[00:40:46]
[00:40:46] 18
[00:40:46] 19 error: no rules expected the token `?`
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:45:11
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:38:11
[00:40:46] 21    |
[00:40:46] 22 LL |     foo!(a?); //~ ERROR no rules expected the token `?`
[00:40:46] 23    |           ^
[00:40:46]
[00:40:46] 24
[00:40:46] 25 error: unexpected end of macro invocation
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:46:5
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:39:5
[00:40:46] 27    |
[00:40:46] 28 LL |     barplus!(); //~ ERROR unexpected end of macro invocation
[00:40:46] 29    |     ^^^^^^^^^^^
[00:40:46]
[00:40:46] 30
[00:40:46] 31 error: unexpected end of macro invocation
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:47:5
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:40:5
[00:40:46] 33    |
[00:40:46] 34 LL |     barstar!(); //~ ERROR unexpected end of macro invocation
[00:40:46] 35    |     ^^^^^^^^^^^
[00:40:46]
[00:40:46] 36
[00:40:46] 37 error: no rules expected the token `?`
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:48:15
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:41:15
[00:40:46] 39    |
[00:40:46] 40 LL |     barplus!(a?); //~ ERROR no rules expected the token `?`
[00:40:46] 41    |               ^
[00:40:46]
[00:40:46] 42
[00:40:46] 43 error: unexpected end of macro invocation
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:49:14
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:42:14
[00:40:46] 45    |
[00:40:46] 46 LL |     barplus!(a); //~ ERROR unexpected end of macro invocation
[00:40:46] 47    |              ^
[00:40:46]
[00:40:46] 48
[00:40:46] 49 error: no rules expected the token `?`
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:50:15
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:43:15
[00:40:46] 51    |
[00:40:46] 52 LL |     barstar!(a?); //~ ERROR no rules expected the token `?`
[00:40:46] 53    |               ^
[00:40:46]
[00:40:46] 54
[00:40:46] 55 error: unexpected end of macro invocation
[00:40:46] -   --> $DIR/macro-at-most-once-rep-ambig.rs:51:14
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:44:14
[00:40:46] 57    |
[00:40:46] 58 LL |     barstar!(a); //~ ERROR unexpected end of macro invocation
[00:40:46] 59    |              ^
[00:40:46]
[00:40:46] 60
[00:40:46] - error: aborting due to 10 previous errors
[00:40:46] + error: unexpected end of macro invocation
[00:40:46] +   --> $DIR/macro-at-most-once-rep-ambig.rs:47:14
[00:40:46] +    |
[00:40:46] + LL |     barplus!(a); // ok
[00:40:46] +    |              ^
---
[00:40:46] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'macros/macro-at-most-once-rep-ambig.rs'
[00:40:46]
[00:40:46] error: 1 errors occurred comparing output.
[00:40:46] status: exit code: 101
[00:40:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-ambig.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-ambig.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:40:46] {"message":"`?` macro repetition does not allow a separator","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":780,"byte_end":781,"line_start":22,"line_end":22,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":"    ($(a),?) => {} //~ ERROR `?` macro repetition does not allow a separator","highlight_start":10,"highlight_end":11}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: `?` macro repetition does not allow a separator\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:22:10\n   |\nLL |     ($(a),?) => {} //~ ERROR `?` macro repetition does not allow a separator\n   |          ^\n\n"}
[00:40:46] {"message":"no rules expected the token `?`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1025,"byte_end":1026,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"    foo!(a?a?a); //~ ERROR no rules expected the token `?`","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `?`\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:36:11\n   |\nLL |     foo!(a?a?a); //~ ERROR no rules expected the token `?`\n   |           ^\n\n"}
[00:40:46] {"message":"no rules expected the token `?`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1084,"byte_end":1085,"line_start":37,"line_end":37,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"    foo!(a?a); //~ ERROR no rules expected the token `?`","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `?`\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:37:11\n   |\nLL |     foo!(a?a); //~ ERROR no rules expected the token `?`\n   |           ^\n\n"}
[00:40:46] {"message":"no rules expected the token `?`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1141,"byte_end":1142,"line_start":38,"line_end":38,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"    foo!(a?); //~ ERROR no rules expected the token `?`","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `?`\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:38:11\n   |\nLL |     foo!(a?); //~ ERROR no rules expected the token `?`\n   |           ^\n\n"}
[00:40:46] {"message":"unexpected end of macro invocation","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1191,"byte_end":1202,"line_start":39,"line_end":39,"column_start":5,"column_end":16,"is_primary":true,"text":[{"text":"    barplus!(); //~ ERROR unexpected end of macro invocation","highlight_start":5,"highlight_end":16}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: unexpected end of macro invocation\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:39:5\n   |\nLL |     barplus!(); //~ ERROR unexpected end of macro invocation\n   |     ^^^^^^^^^^^\n\n"}
[00:40:46] {"message":"unexpected end of macro invocation","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1252,"byte_end":1263,"line_start":40,"line_end":40,"column_start":5,"column_end":16,"is_primary":true,"text":[{"text":"    barstar!(); //~ ERROR unexpected end of macro invocation","highlight_start":5,"highlight_end":16}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: unexpected end of macro invocation\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:40:5\n   |\nLL |     barstar!(); //~ ERROR unexpected end of macro invocation\n   |     ^^^^^^^^^^^\n\n"}
[00:40:46] {"message":"no rules expected the token `?`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1323,"byte_end":1324,"line_start":41,"line_end":41,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":"    barplus!(a?); //~ ERROR no rules expected the token `?`","highlight_start":15,"highlight_end":16}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `?`\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:41:15\n   |\nLL |     barplus!(a?); //~ ERROR no rules expected the token `?`\n   |               ^\n\n"}
[00:40:46] {"message":"unexpected end of macro invocation","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs","byte_start":1382,"byte_end":1383,"line_start":42,"line_end":42,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"    barplus!(a); //~ ERROR unexpected end of macro invocation","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: unexpected end of macro invocation\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:42:14\n   |\nLL |     barplus!(a); //~ ERROR unexpected end of macro invocation\n   |              ^\n\n"}
[00:40:46] {"message":"no rules expected the token `?`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-at-most-once-rep-ted_replacement":null,"expansion":null}],"children":[],"rendered":"error: unexpected end of macro invocation\n  --> /checkout/src/test/ui/macros/macro-at-most-once-rep-ambig.rs:47:14\n   |\nLL |     barplus!(a); // ok\n   |              ^\n\n"}
[00:40:46] {"message":"aborting due to 11 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 11 previous errors\n\n"}
---
[00:40:46] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:40:46] expected success, got: exit code: 101
[00:40:46]
[00:40:46]
[00:40:46] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:40:46] Build completed unsuccessfully in 0:02:18
[00:40:46] Makefile:58: recipe for target 'check' failed
[00:40:46] make: *** [check] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:084a03fa:start=1522980977446315829,finish=1522980977453955318,duration=7639489
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0f49c4f8
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0f49c4f8:start=1522980977460915259,finish=1522980977468588665,duration=7673406
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:19721a36
$ dmesg | grep -i kill
[   10.700008] init: failsafe main process (1093) killed by TERM signal

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

@clarfonthey
Copy link
Contributor

I was going to say that disallowing ? as a separator seems weird, but then I tried:

macro_rules! test {
    ($($t: ident)**) => {
        println!("{}", stringify!($($t)**));
    }
}

fn main() {
    let (a, b, c) = (1, 2, 3);
    println!("{}", test!(a * b * c));
}

Which yields a very weird error. Using ? doesn't seem to do so.

@alexreg
Copy link
Contributor

alexreg commented Apr 6, 2018

@clarcharr Not weird at all, actually. :-) Since allowing * or + as separators would lead to ambiguous parsing, they're disallowed. $($t:ident)** is thus interpreted as $($t: ident)* (no separator) followed by the literal *, which means that's the appropriate error.

@clarfonthey
Copy link
Contributor

@alexreg I agree, but the error in no way indicates that the separator is disallowed. It simply parses expecting a b c * instead of a * b * c.

In hindsight, this makes a lot of sense, but the errors could definitely be improved. I agree that disallowing ? makes the most sense here.

@alexreg
Copy link
Contributor

alexreg commented Apr 6, 2018

@clarcharr Hmm. I see your point, but I still think the error message is essentially good as-is. Maybe what we need is a note attached to the existing error message when a match fails and it detects * or + following a Kleene op.

@kennytm
Copy link
Member

kennytm commented Apr 7, 2018

@bors try

Please schedule a check-only crater run.

@bors
Copy link
Contributor

bors commented Apr 7, 2018

⌛ Trying commit 54bba4c with merge f5d618a...

bors added a commit that referenced this pull request Apr 7, 2018
Update `?` repetition disambiguation.

**Do not merge** (yet)

This is a test implementation of some ideas from discussion in #48075 . This PR
- disallows `?` repetition from taking a separator, since the separator is never used.
- disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach?

cc @durka @alexreg @nikomatsakis
@kennytm kennytm added S-waiting-on-crater Status: Waiting on a crater run to be completed. relnotes Marks issues that should be documented in the release notes of the next release. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 7, 2018
@bors
Copy link
Contributor

bors commented Apr 7, 2018

☀️ Test successful - status-travis
State: approved= try=True

@mark-i-m
Copy link
Member Author

mark-i-m commented Apr 7, 2018

@kennytm

Please schedule a check-only crater run.

How do I do that?

@kennytm
Copy link
Member

kennytm commented Apr 7, 2018

@mark-i-m That's only a message to the people who run the crater 😅

@Mark-Simulacrum
Copy link
Member

A check-only crater run has been commenced; ETA is somewhat unknown but probably less than 5 days.

@Mark-Simulacrum
Copy link
Member

Crater results are at: http://cargobomb-reports.s3.amazonaws.com/pr-49719/index.html. These results show 0 regressions; crater is green. Note that Crater does not test crates on Windows.

(interested observers: Crater is a tool for testing the impact of changes on the crates.io ecosystem. You can find out more at the repo if you're curious)

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Apr 15, 2018
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 15, 2018

📌 Commit 54bba4c has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2018
@bors
Copy link
Contributor

bors commented Apr 16, 2018

⌛ Testing commit 54bba4c with merge d6ba1b9...

bors added a commit that referenced this pull request Apr 16, 2018
Update `?` repetition disambiguation.

**Do not merge** (yet)

This is a test implementation of some ideas from discussion in #48075 . This PR
- disallows `?` repetition from taking a separator, since the separator is never used.
- disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach?

cc @durka @alexreg @nikomatsakis
@pietroalbini pietroalbini added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 3, 2018
@pietroalbini
Copy link
Member

Personally I'd prefer if we implement this as a deprecation warning so we can change the behavior in a future edition instead of risking to break existing behavior. We shouldn't break things without warning if there is not a big reason to do that (such as fixing soundness holes).

@oli-obk
Copy link
Contributor

oli-obk commented Jun 3, 2018

Clippy broke. I think I fixed it with some feature gate.

@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 3, 2018

Oh, hmm... That's good to know... Maybe the edition would be the best way to turn this on...

@alexreg
Copy link
Contributor

alexreg commented Jun 4, 2018

@mark-i-m How do editions work? Would this feature only be enabled for Rust 2018 code then?

@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 4, 2018

I think that would lead to the least confusion. We would warn now and then make it a hard error in the new edition. Then we could stabilize the feature some time in the 2018 edition...

Some other options are

  • accept the breaking change and stabilize this whenever we want.
  • rollback the breaking change. Keep the weird behavior we had before and switch to the new behavior (of this PR) after the edition. Stabilize when we want, even though the behavior will subtly change.

Both of these alternatives seem less good than just waiting a few months and deprecating the old behavior...

@alexreg
Copy link
Contributor

alexreg commented Jun 4, 2018

I’m not against this. Sounds fair.

@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 4, 2018

I opened #51336 as a potential fix in the case we decide to roll this back for the 2015 edition without a feature gate.

@nikomatsakis
Copy link
Contributor

Regardless of whether we should change the behavior here, I don't feel like this PR followed proper procedure. There should have been an official decision (with a FCP) before we merged this. I don't recall any such decision, am I forgetting something?

Thanks @mark-i-m for opening #51336

@nikomatsakis
Copy link
Contributor

I think my preference would be that we do the following:

  • Revert this PR straight up.
  • Consider separately the question of whether to change the behavior in the new edition:
    • if we are going to do so, we need to have a migration lint that detects the problem in the old edition. Ideally, we would migrate the macro as well, but I think right now we have no "simple way" to express the old semantics. This might be a problem we need to address.
    • Point is, I do not think we are ready to do the full effects of [WIP] undo #49719 for rust 2015 with feature flag #51336 at this point.

@mark-i-m would you be up for preparing a "straight" revert PR to give us time to revisit this question?

@nikomatsakis
Copy link
Contributor

(I filed #51416 to track a revert; we should still discuss the right thing to do afterwards. I personally like the idea of phasing this in with the new edition.)

kennytm pushed a commit to kennytm/rust that referenced this pull request Jun 7, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jun 7, 2018
…tsakis

Revert rust-lang#49719

This also needs to be backported into beta.

Fixes rust-lang#51416.
r? @nikomatsakis
bors added a commit that referenced this pull request Jun 7, 2018
Rollup of 9 pull requests

Successful merges:

 - #51186 (Remove two redundant .nll.stderr files)
 - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.)
 - #51368 (Fix the use of closures within #[panic_implementation])
 - #51380 (Remove dependency on fmt_macros from typeck)
 - #51389 (rustdoc: Fix missing stability and src links for inlined external macros)
 - #51399 (NLL performance boost)
 - #51407 (Update RLS and Rustfmt)
 - #51417 (Revert #49719)
 - #51420 (Tries to address the recent network issues)

Failed merges:
bors pushed a commit that referenced this pull request Jun 9, 2018
This reverts commit d6ba1b9, reversing
changes made to 8de5353.
bors added a commit that referenced this pull request Jun 9, 2018
[beta] Rollup backports

Merged and accepted:

* #51417: Revert #49719
* #51283: Deny #[cfg] and #[cfg_attr] on generic parameters
* #51328: Do not promote union field accesses

r? @ghost
@petrochenkov
Copy link
Contributor

My rule of thumb is that if it's something useful long-term and has <5 crates.io regressions then we should do it.
I agree this was a process mistake and the PR needed an FCP (I was probably in hurry and somehow forgot about it).

@petrochenkov petrochenkov mentioned this pull request Jun 9, 2018
@alexreg
Copy link
Contributor

alexreg commented Jun 9, 2018

@petrochenkov No worries. I agree with your thinking. We need to re-implement this patch for the 2018 edition at least, I think.

@mark-i-m
Copy link
Member Author

Request for comments/FCP on newest implementation: #51934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.