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

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

Closed
rust-highfive opened this issue May 15, 2020 · 8 comments · Fixed by #72671
Closed

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

rust-highfive opened this issue May 15, 2020 · 8 comments · Fixed by #72671
Assignees
Labels
C-bug Category: This is a bug.

Comments

@rust-highfive
Copy link
Collaborator

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.

@CAD97
Copy link
Contributor

CAD97 commented May 15, 2020

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.

@CAD97
Copy link
Contributor

CAD97 commented May 15, 2020

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

@topecongiro
Copy link
Contributor

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

@cuviper
Copy link
Member

cuviper commented May 20, 2020

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.

@CAD97
Copy link
Contributor

CAD97 commented May 20, 2020

@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.

@ctaggart
Copy link
Contributor

ctaggart commented May 23, 2020

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

@calebcartwright
Copy link
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)

@ctaggart
Copy link
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

@bors bors closed this as completed in 96dd469 May 29, 2020
tesuji pushed a commit to tesuji/rustc that referenced this issue Jun 4, 2020
Update Clippy, RLS, and rustfmt

r? @Dylan-DPC

This makes Clippy test-pass again: 3089c3b

Otherwise this includes bugfixes and a few new lints.

Fixes rust-lang#72231
Fixes rust-lang#72232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants