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

missing_fragment_specifier hard error #76605

Closed
pietroalbini opened this issue Sep 11, 2020 · 14 comments · Fixed by #80296
Closed

missing_fragment_specifier hard error #76605

pietroalbini opened this issue Sep 11, 2020 · 14 comments · Fixed by #80296
Assignees
Labels
A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Milestone

Comments

@pietroalbini
Copy link
Member

In the beta run for Rust 1.47 the release team discovered that #75516 is breaking more than 475 crates or git repositories currently compiling, across at least the following crates:

  • js-sys
  • clap
  • time-macros-impl

cc @petrochenkov @matklad @rust-lang/release

@pietroalbini pietroalbini added A-parser Area: The parsing of Rust source code to an AST regression-from-stable-to-beta Performance or correctness regression from stable to beta. C-bug Category: This is a bug. labels Sep 11, 2020
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 11, 2020
@pietroalbini pietroalbini added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 11, 2020
@pietroalbini
Copy link
Member Author

Personally I think that's too much breakage to land, even though it was a deprecation warning since 2017.

@LeSeulArtichaut LeSeulArtichaut removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 11, 2020
@petrochenkov
Copy link
Contributor

I agree that it's not an acceptable breakage, although I suspect that most of it happens due to committed Cargo.locks.
I think we can add a hack accepting a missing fragment specifier for the 2-3 specific crates responsible for majority of the breakage, like it was done in #73345.
(In a more local way than before #75516, without Option<NonterminalKind> in MetaVarDecl, and without missing_fragment_specifiers in session.)

@Mark-Simulacrum
Copy link
Member

We could also make it a hard warning rather than error for all crates, but I'm not sure if that's better. It also doesn't need session state.

@tmandry
Copy link
Member

tmandry commented Sep 12, 2020

To expand a bit: cargo hides warnings generated by your dependencies, so crate owners don't feel the pain of depending on these old versions. I believe it passes -Awarnings to rustc, but otherwise passes through the output unchanged. If we had a warning that printed in spite of -Awarnings it would encourage people to update their deps.

I assume that is what is meant by "hard warning"?

@jyn514 jyn514 added the T-release Relevant to the release subteam, which will review and decide on the PR/issue. label Oct 2, 2020
@Mark-Simulacrum
Copy link
Member

I've posted a revert to current beta (#77456) but we still need to fix this on master. Moving milestone to 1.48, though.

@Mark-Simulacrum Mark-Simulacrum added this to the 1.48.0 milestone Oct 2, 2020
@Aaron1011
Copy link
Member

I think this is another case where #71249 would help (see #75534)

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 3, 2020
…oalbini

[beta] Revert "Promote missing_fragment_specifier to hard error rust-lang#75516"

This reverts "Promote missing_fragment_specifier to hard error rust-lang#75516" on just beta. I would like us to explore a more principled fix, perhaps along the lines `@petrochenkov` suggested in rust-lang#76605, on master when we have more time to test it but I don't want us shipping the breakage in the meantime. I don't personally feel comfortable immediately backporting anything more than a revert here.

cc `@matklad`
@petrochenkov petrochenkov self-assigned this Oct 3, 2020
@petrochenkov
Copy link
Contributor

I'll try to address this on nightly until the next release (the revert has landed on beta only #77456).

@XAMPPRocky XAMPPRocky pinned this issue Oct 3, 2020
@XAMPPRocky XAMPPRocky unpinned this issue Oct 3, 2020
@pietroalbini pietroalbini added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Oct 4, 2020
@pietroalbini
Copy link
Member Author

Changed this to a nightly regression (so 1.48 regression) since we reverted the change on beta.

@jhpratt
Copy link
Member

jhpratt commented Oct 20, 2020

What needs to change in time-macros-impl? There's no warnings currently emitted by any of my code, as verified in CI. I certainly would have run across it at some point while developing otherwise.

In the future though, a friendly ping would be appreciated 🙂

@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.48.0, 1.49.0 Nov 6, 2020
@Mark-Simulacrum Mark-Simulacrum changed the title missing_fragment_specifier hard error in Rust 1.47 missing_fragment_specifier hard error Nov 6, 2020
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Nov 6, 2020

Assigning to @estebank to change the lint on nightly to a hard warning, which should both prevent hard errors (and as such regressions) and still avoid global state.

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 7, 2020
…chenkov

[beta] Revert "Promote missing_fragment_specifier to hard error rust-lang#75516"

This reverts "Promote missing_fragment_specifier to hard error rust-lang#75516" on just beta. I would like us to explore a more principled fix, perhaps along the lines `@petrochenkov` suggested in rust-lang#76605, on master when we have more time to test it but I don't want us shipping the breakage in the meantime. I don't personally feel comfortable immediately backporting anything more than a revert here.

cc `@matklad`

This matches rust-lang#77456 for 1.47 but targets 1.48 (current beta) instead.

r? `@petrochenkov`
@petrochenkov
Copy link
Contributor

petrochenkov commented Nov 10, 2020

So, I assumed that $i without a "fragment specifier" would behave like some actual fragment specifier, e.g. tt, but apparently it doesn't and it always produces an error on attempt to match, so the Option in MetaVarDecl is necessary and the logic cannot be simplified.

@estebank
Copy link
Contributor

@petrochenkov does that mean we need to revert #75516 in master too (and potentially on the upcoming beta)?

@petrochenkov
Copy link
Contributor

I think we need to revert on master and then do any other work starting from that state.

@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Dec 10, 2020
@Mark-Simulacrum
Copy link
Member

#75516 does not seem to revert cleanly on current beta (1.49). @estebank @petrochenkov could one of you prepare a revert PR targeting beta? (I agree we should also revert on master)

@Mark-Simulacrum Mark-Simulacrum added the P-critical Critical priority label Dec 11, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 22, 2020
…ulacrum

Revert "Promote missing_fragment_specifier to hard error" rust-lang#75516

Revert of rust-lang#75516 per rust-lang#76605.

r? `@Mark-Simulacrum`

Note: I only reverted the two commits in rust-lang#75516 which made the lint a hard error. I did not revert the other two commits in the PR as they seemed fine to leave IMO (commits 84fcd0d and eb4d6b5).
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 22, 2020
…_specifier_hard_error, r=Mark-Simulacrum

Revert missing fragment specifier hard error

Closes rust-lang#76605

Reopens rust-lang#40107

r? `@Mark-Simulacrum`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
…_specifier_hard_error, r=Mark-Simulacrum

Revert missing fragment specifier hard error

Closes rust-lang#76605

Reopens rust-lang#40107

r? `@Mark-Simulacrum`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
…_specifier_hard_error, r=Mark-Simulacrum

Revert missing fragment specifier hard error

Closes rust-lang#76605

Reopens rust-lang#40107

r? ``@Mark-Simulacrum``
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
…_specifier_hard_error, r=Mark-Simulacrum

Revert missing fragment specifier hard error

Closes rust-lang#76605

Reopens rust-lang#40107

r? ```@Mark-Simulacrum```
@bors bors closed this as completed in 1832bdd Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.