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

Can't build redpen #5

Open
FuzzyLitchi opened this issue Sep 12, 2023 · 5 comments
Open

Can't build redpen #5

FuzzyLitchi opened this issue Sep 12, 2023 · 5 comments

Comments

@FuzzyLitchi
Copy link

After running cargo +nightly-2023-09-04 install redpen-linter, it gives the following output

    Updating crates.io index
  Installing redpen-linter v0.2.0
    Updating crates.io index
   Compiling home v0.5.5
   Compiling redpen-linter v0.2.0
error[E0463]: can't find crate for `rustc_ast`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:11:1
   |
11 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_data_structures`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:12:1
   |
12 | extern crate rustc_data_structures;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_driver`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:13:1
   |
13 | extern crate rustc_driver;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_errors`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:14:1
   |
14 | extern crate rustc_errors;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_hir`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:15:1
   |
15 | extern crate rustc_hir;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_hir_typeck`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:16:1
   |
16 | extern crate rustc_hir_typeck;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_index`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:17:1
   |
17 | extern crate rustc_index;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_infer`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:18:1
   |
18 | extern crate rustc_infer;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_interface`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:19:1
   |
19 | extern crate rustc_interface;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_lint`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:20:1
   |
20 | extern crate rustc_lint;
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_macros`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:21:1
   |
21 | extern crate rustc_macros;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_middle`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:22:1
   |
22 | extern crate rustc_middle;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_mir_dataflow`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:23:1
   |
23 | extern crate rustc_mir_dataflow;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_monomorphize`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:24:1
   |
24 | extern crate rustc_monomorphize;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_serialize`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:25:1
   |
25 | extern crate rustc_serialize;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_session`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:26:1
   |
26 | extern crate rustc_session;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_span`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:27:1
   |
27 | extern crate rustc_span;
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_symbol_mangling`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:28:1
   |
28 | extern crate rustc_symbol_mangling;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_target`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:29:1
   |
29 | extern crate rustc_target;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_trait_selection`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:30:1
   |
30 | extern crate rustc_trait_selection;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `tracing`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:33:1
   |
33 | extern crate tracing;
   | ^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: cannot determine resolution for the macro `declare_tool_lint`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/disallow.rs:18:1
   |
18 | declare_tool_lint! {
   | ^^^^^^^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the macro `impl_lint_pass`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/disallow.rs:24:1
   |
24 | impl_lint_pass!(Disallow<'_> => [DISALLOW]);
   | ^^^^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the macro `declare_tool_lint`
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:154:1
    |
154 | declare_tool_lint! {
    | ^^^^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the macro `impl_lint_pass`
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:160:1
    |
160 | impl_lint_pass!(DontPanic<'_> => [DONT_PANIC]);
    | ^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error[E0425]: cannot find value `INCORRECT_ATTRIBUTE` in the crate root
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/attribute.rs:62:20
   |
62 |             crate::INCORRECT_ATTRIBUTE,
   |                    ^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0425]: cannot find value `INCORRECT_ATTRIBUTE` in the crate root
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/attribute.rs:266:24
    |
266 |                 crate::INCORRECT_ATTRIBUTE,
    |                        ^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0425]: cannot find value `INCORRECT_ATTRIBUTE` in the crate root
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/attribute.rs:282:28
    |
282 |                     crate::INCORRECT_ATTRIBUTE,
    |                            ^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0425]: cannot find value `DISALLOW` in this scope
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/disallow.rs:92:33
   |
92 | ...                   DISALLOW,
   |                       ^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DISALLOW` in this scope
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/disallow.rs:153:29
    |
153 | ...                   DISALLOW,
    |                       ^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DONT_PANIC` in this scope
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:426:21
    |
426 |                     DONT_PANIC,
    |                     ^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `INCORRECT_ATTRIBUTE` in this scope
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:90:18
   |
90 |                 &INCORRECT_ATTRIBUTE,
   |                  ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DISALLOW` in module `disallow`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:91:28
   |
91 |                 &disallow::DISALLOW,
   |                            ^^^^^^^^ not found in `disallow`

error[E0425]: cannot find value `DONT_PANIC` in module `panic_freedom`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:92:33
   |
92 |                 &panic_freedom::DONT_PANIC,
   |                                 ^^^^^^^^^^ not found in `panic_freedom`

@Erk-
Copy link

Erk- commented Sep 12, 2023

Is the "rustc-dev" component installed?

@FuzzyLitchi
Copy link
Author

oh it evens says so in the output... 🤦‍♀️

@FuzzyLitchi
Copy link
Author

FuzzyLitchi commented Sep 12, 2023

I ran rustup +nightly-2023-09-04 component add rust-src rustc-dev llvm-tools-preview and it has different errors now 🎉. Altough rustc-dev seems to be the only one actually required (?)

$ cargo +nightly-2023-09-04 install redpen-linter
    Updating crates.io index
  Installing redpen-linter v0.2.0
    Updating crates.io index
   Compiling home v0.5.5
   Compiling redpen-linter v0.2.0
error[E0433]: failed to resolve: could not find `InternalSubsts` in `ty`
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:60:24
   |
60 |         let args = ty::InternalSubsts::identity_for_item(self.tcx, def_id);
   |                        ^^^^^^^^^^^^^^ could not find `InternalSubsts` in `ty`

error[E0533]: expected unit struct, unit variant or constant, found struct variant `DefKind::TyAlias`
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:102:15
    |
102 |             | DefKind::TyAlias
    |               ^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant

error[E0599]: no variant or associated item named `ImplTraitPlaceholder` found for enum `DefKind` in the current scope
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:105:24
    |
105 |             | DefKind::ImplTraitPlaceholder
    |                        ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `DefKind`

error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
   --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/panic_freedom.rs:373:34
    |
373 |             hir::ExprKind::Index(_rcvr, _idx) => {
    |                                  ^^^^^  ^^^^ expected 3 fields, found 2
   --> /home/polly/.rustup/toolchains/nightly-2023-09-04-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_hir/src/hir.rs:2020:47
    |
    = note: tuple variant has 3 fields
    |
help: use `_` to explicitly ignore each field
    |
373 |             hir::ExprKind::Index(_rcvr, _idx, _) => {
    |                                             +++

error[E0599]: no method named `crate_types` found for reference `&Session` in the current scope
  --> /home/polly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redpen-linter-0.2.0/src/main.rs:83:18
   |
82 |               if sess
   |  ________________-
83 | |                 .crate_types()
   | |                 -^^^^^^^^^^^ method not found in `&Session`
   | |_________________|
   |

@FuzzyLitchi
Copy link
Author

cargo +nightly-2023-09-04 install --git https://github.com/estebank/redpen works

@estebank
Copy link
Owner

Oh, yes. Thank you for bringing this to my attention! I need to do a new release after moving from tracking 1.72 to tracking a specific nightly. The code in the repo should always be buildable. I'm currently at RustConf and reworking the reachability logic to support multiple lints (beyond panic access) in a more reasonable way and was waiting to have that done before doing a new release. I'll update this ticket once things are more stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants