Skip to content

Crates using placement syntax behind a cfg broken #50832

Closed
@pietroalbini

Description

@pietroalbini
Member

Some crates were using <- behind a feature flag, so they worked on stable even if the placement syntax was nightly-only. After removing it though they fail to compile even on stable with a syntax error, because <- is not recognized anymore.

Activity

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
on May 17, 2018
added this to the 1.27 milestone on May 17, 2018
kennytm

kennytm commented on May 17, 2018

@kennytm
Member

It is already fixed in mbox 0.5.0 and 0.4.4.

nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

Oh, that's annoying. We should patch rayon-hash.

petrochenkov

petrochenkov commented on May 17, 2018

@petrochenkov
Contributor

This is not the first time this is happening, removal of impl Trait for .. {} caused same consequences (see #46480).
We should probably continue parsing <- and report the error later in AST validation.

nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

Discussed in the @rust-lang/compiler meeting. I think we reached this consensus:

  • in this case, yes, we should do as @petrochenkov suggests: keep parsing, error in AST validation
  • if in the future, if it happens that we want to repurpose the syntax, we deal with it then: best of course is to use an edition for it, but maybe by then there no longer exist crates using it
  • going forward, it would be ideal if we could do some kind of "pre-cfg / expansion" feature check to try and avoid this in the future; that may or may not be feasible though, and we couldn't do it retroactively for all existing things anyway
nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

Some discussion of the final at or around here in the IRC logs

https://botbot.me/mozilla/rustc/2018-05-17/?msg=100165163&page=3

nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

triage: P-high

nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

Would anyone have time to whip up a change to the parser?

cc @rust-lang/compiler @aidanhs

nikomatsakis

nikomatsakis commented on May 17, 2018

@nikomatsakis
Contributor

For reference, the PR that reverted the syntax was #48333

18 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @cuviper@kennytm@nikomatsakis@estebank@pietroalbini

      Issue actions

        Crates using placement syntax behind a cfg broken · Issue #50832 · rust-lang/rust