Skip to content

rustfmt no longer builds after rust-lang/rust#69659 #72232

Closed

Description

@rust-highfive

Hello, this is your friendly neighborhood mergebot.
After merging PR #69659, I observed that the tool rustfmt no longer builds.
A follow-up PR to the repository https://github.com/rust-lang/rustfmt is needed to fix the fallout.

cc @CAD97, do you think you would have time to do the follow-up work?
If so, that would be great!

And nominating for compiler team prioritization.

Activity

  1. CAD97 commented on May 15, 2020

    @CAD97
    Contributor

    This is probably rustfmt's use of librustc_index, which implements the step trait. I don't see any direct usage that would cause the breakage.

  2. CAD97 commented on May 15, 2020

    @CAD97
    Contributor

    rustfmt was already broken on the latest rustc-ap version, so I'm not exactly sure why my PR is implicated rather than #71555.

  3. topecongiro commented on May 16, 2020

    @topecongiro
    Contributor

    I believe the breakage is due to #72001, which requires us to set the env var CFG_RELEASE_CHANNEL during the build.

  4. cuviper commented on May 20, 2020

    @cuviper
    Member

    FWIW, I just tried on commit 0271499, which is the parent to #69659's merge commit ed084b0, and rustfmt built fine. The errors I see later are in rustc-ap-rustc_index and rustc-ap-rustc_span, lots of "... is not a member of trait std::iter::Step".

    Could well be that the other mentioned PRs would also cause problems though.

  5. CAD97 commented on May 20, 2020

    @CAD97
    Contributor

    @cuviper we've already patched rustfmt for the other problems (rust-lang/rustfmt#4184, rust-lang/rustfmt#4188), what remains is just propagating changes IIUC.

  6. ctaggart commented on May 23, 2020

    @ctaggart
    Contributor

    I just tried updating to latest rustfmt from master. I'm not sure if it because I'm targeting wasm32-unkonwn-unknown, but will look into it. It happens on a normal cargo build. Here are the errors I'm seeing:

       Compiling rustc-ap-rustc_span v659.0.0
    error[E0407]: method `forward_checked` is not a member of trait `std::iter::Step`
      --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:11:1
       |
    11 | / rustc_index::newtype_index! {
    12 | |     pub struct CrateId {
    13 | |         ENCODABLE = custom
    14 | |     }
    15 | | }
       | |_^ not a member of trait `std::iter::Step`
       |
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0407]: method `backward_checked` is not a member of trait `std::iter::Step`
      --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:11:1
       |
    11 | / rustc_index::newtype_index! {
    12 | |     pub struct CrateId {
    13 | |         ENCODABLE = custom
    14 | |     }
    15 | | }
       | |_^ not a member of trait `std::iter::Step`
       |
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0407]: method `forward_checked` is not a member of trait `std::iter::Step`
       --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:118:1
        |
    118 | / rustc_index::newtype_index! {
    119 | |     /// A DefIndex is an index into the hir-map for a crate, identifying a
    120 | |     /// particular definition. It should really be considered an interned
    121 | |     /// shorthand for a particular DefPath.
    ...   |
    128 | |     }
    129 | | }
        | |_^ not a member of trait `std::iter::Step`
        |
        = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0407]: method `backward_checked` is not a member of trait `std::iter::Step`
       --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:118:1
        |
    118 | / rustc_index::newtype_index! {
    119 | |     /// A DefIndex is an index into the hir-map for a crate, identifying a
    120 | |     /// particular definition. It should really be considered an interned
    121 | |     /// shorthand for a particular DefPath.
    ...   |
    128 | |     }
    129 | | }
        | |_^ not a member of trait `std::iter::Step`
        |
        = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0407]: method `forward_checked` is not a member of trait `std::iter::Step`
        --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/symbol.rs:1034:1
         |
    1034 | / rustc_index::newtype_index! {
    1035 | |     pub struct SymbolIndex { .. }
    1036 | | }
         | |_^ not a member of trait `std::iter::Step`
         |
         = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0407]: method `backward_checked` is not a member of trait `std::iter::Step`
        --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/symbol.rs:1034:1
         |
    1034 | / rustc_index::newtype_index! {
    1035 | |     pub struct SymbolIndex { .. }
    1036 | | }
         | |_^ not a member of trait `std::iter::Step`
         |
         = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0199]: implementing the trait `std::iter::Step` is not unsafe
      --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:11:1
       |
    11 | / rustc_index::newtype_index! {
    12 | |     pub struct CrateId {
    13 | |         ENCODABLE = custom
    14 | |     }
    15 | | }
       | |_^
       |
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0199]: implementing the trait `std::iter::Step` is not unsafe
       --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/def_id.rs:118:1
        |
    118 | / rustc_index::newtype_index! {
    119 | |     /// A DefIndex is an index into the hir-map for a crate, identifying a
    120 | |     /// particular definition. It should really be considered an interned
    121 | |     /// shorthand for a particular DefPath.
    ...   |
    128 | |     }
    129 | | }
        | |_^
        |
        = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0199]: implementing the trait `std::iter::Step` is not unsafe
        --> /Users/cameron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-659.0.0/symbol.rs:1034:1
         |
    1034 | / rustc_index::newtype_index! {
    1035 | |     pub struct SymbolIndex { .. }
    1036 | | }
         | |_^
         |
         = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error: aborting due to 9 previous errors
    
  7. calebcartwright commented on May 24, 2020

    @calebcartwright
    Member

    @ctaggart - which nightly are you using? Based on the output it seems like you're probably using an older one (IIRC you'll need rustc 1.45.0-nightly (d79f1bd31 2020-05-17) if not newer)

  8. ctaggart commented on May 24, 2020

    @ctaggart
    Contributor

    @calebcartwright, yes, that was my issue. It works now on rustc 1.45.0-nightly (8970e8bcf 2020-05-23).

    It was not working on:

    rustc --version
    rustc 1.45.0-nightly (a74d1862d 2020-05-14)
    

    Oh, I see. Looks like rustfmt-preview has not build for a while:

    Camerons-MacBook-Pro:ts2rsapp cameron$ rustup update
    info: syncing channel updates for 'stable-x86_64-apple-darwin'
    info: syncing channel updates for 'nightly-x86_64-apple-darwin'
    info: latest update on 2020-05-24, rust version 1.45.0-nightly (8970e8bcf 2020-05-23)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-23-x86_64-apple-darwin'
    info: latest update on 2020-05-23, rust version 1.45.0-nightly (215f2d329 2020-05-22)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-22-x86_64-apple-darwin'
    info: latest update on 2020-05-22, rust version 1.45.0-nightly (9310e3bd4 2020-05-21)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-21-x86_64-apple-darwin'
    info: latest update on 2020-05-21, rust version 1.45.0-nightly (0aa6751c1 2020-05-20)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-20-x86_64-apple-darwin'
    info: latest update on 2020-05-20, rust version 1.45.0-nightly (3a7dfda40 2020-05-19)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-19-x86_64-apple-darwin'
    info: latest update on 2020-05-19, rust version 1.45.0-nightly (d8878868c 2020-05-18)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-18-x86_64-apple-darwin'
    info: latest update on 2020-05-18, rust version 1.45.0-nightly (d79f1bd31 2020-05-17)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-17-x86_64-apple-darwin'
    info: latest update on 2020-05-17, rust version 1.45.0-nightly (dd927a5b0 2020-05-16)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-16-x86_64-apple-darwin'
    info: latest update on 2020-05-16, rust version 1.45.0-nightly (ed084b0b8 2020-05-15)
    info: skipping nightly which is missing installed component 'rustfmt-preview'
    info: syncing channel updates for 'nightly-2020-05-15-x86_64-apple-darwin'
    info: checking for self-updates
    
    rustup component remove rustfmt-preview
    rustup update
    
  9. added a commit that references this issue on Jun 4, 2020
    fcc0e8f
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.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions