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

Fallout from expansion of redundant import checking #121708

Open
tmandry opened this issue Feb 27, 2024 · 41 comments
Open

Fallout from expansion of redundant import checking #121708

tmandry opened this issue Feb 27, 2024 · 41 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-lang-radar Items that are on lang's radar and will need eventual work or consideration. L-redundant_imports Lint: redundant_imports S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@tmandry
Copy link
Member

tmandry commented Feb 27, 2024

I've noticed there is a lot of fallout from the changes in #117772 expanding redundant import checking. See discussion and backlinks on that issue as well as #118692 for some evidence.

I have a theory that redundant imports should be split out into their own lint group (this was discussed in the past), and that in the future as a matter of policy, disruptive expansions like this should come with a machine-applicable fix to make rollout smoother.

For now, I'm opening this issue to collect data and feedback that I want to use to inform future policy discussions around lint expansions.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 27, 2024
@tmandry
Copy link
Member Author

tmandry commented Feb 27, 2024

FYI @surechen @petrochenkov - Not trying to single you out here, but I would like your input. This is a problem I've noticed in past lint expansions, and it seems useful to focus discussion around a concrete incidence.

@jieyouxu jieyouxu added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically labels Feb 27, 2024
@tmandry

This comment was marked as duplicate.

@craterbot

This comment was marked as outdated.

@tmandry
Copy link
Member Author

tmandry commented Feb 27, 2024

I'm interested to see what kind of numbers crater can give us.

@craterbot run name=redundant-imports start=master#6f726205a1b7992537ddec96c83f2b054b03e04f+rustflags=-Dunused-imports end=master#8b21296b5db6d5724d6b8440dcf459fa82fd88b5+rustflags=-Dunused-imports crates=top-1000 mode=check-only p=2

@craterbot
Copy link
Collaborator

👌 Experiment redundant-imports created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added the S-waiting-on-crater Status: Waiting on a crater run to be completed. label Feb 27, 2024
@tmandry
Copy link
Member Author

tmandry commented Feb 27, 2024

Now I see that the only p=1 in the queue has a similar number of crates to build, so let's use the same priority.

@craterbot name=redundant-imports p=1

@craterbot
Copy link
Collaborator

📝 Configuration of the redundant-imports experiment changed.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@surechen
Copy link
Contributor

surechen commented Feb 28, 2024

FYI @surechen @petrochenkov - Not trying to single you out here, but I would like your input. This is a problem I've noticed in past lint expansions, and it seems useful to focus discussion around a concrete incidence.

Hi, thank you for starting the discussion.

As a newbie to compilers, this PR was originally intended to address a smaller scope issue #117448, detecting redundant imports which should only be imported by prelude, petrochenkov provided a lot of help in the comments. I very much recognized his comment: #117772 (comment) and asked for help, so he patiently guided me to develop this PR. So my views here may not be professional enough and can only represent my own.

I think Rust's powerful detection capabilities make me more confident in the code I develop. In my mind, ideally, the compiler can help me find all problems, so stricter checking of redundant imports will not cause too much trouble, but it will help me.

Of course, if some lints will invalidate a large amount of existing code, it will really increase my burden, so if the community has some future policies or some measures to make the changes smoother, then I will appreciate it very much, and I will also be very happy to participate in the discussion or do some development.

@Robbepop
Copy link
Contributor

Hi, today I noticed that this is causing a lot of trouble for my crates in the Wasmi workspace, particularly the wasmi_core crate. I mistakenly thought this was a clippy issue first and reported it there and got rerouted to this issue fortunately. For the sake of providing my use case that causes issues with the expanded import checking I will copy what I wrote in the clippy bug report below.

Summary

For my crate wasmi_core in https://github.com/wasmi-labs/wasmi/tree/master/crates/core I see the following warnings when running clippy rustc on nightly channel:

warning: the item `Box` is imported redundantly
   --> crates/wasmi/src/store.rs:32:5
    |
32  | use alloc::boxed::Box;
    |     ^^^^^^^^^^^^^^^^^
    |
   ::: /Users/robin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
    |
125 |     pub use super::v1::*;
    |             --------- the item `Box` is already defined here

Many more warnings pop up, but they all are very similar to the one above.
This import is required for proper no_std builds.

In lib.rs we do:

#[cfg(not(feature = "std"))]
extern crate alloc;

Thus alloc is always available as crate root import.

Lint Name

unused_imports

Reproducer

Version

rustc 1.78.0-nightly (ef324565d 2024-02-27)
binary: rustc
commit-hash: ef324565d071c6d7e2477a195648549e33d6a465
commit-date: 2024-02-27
host: aarch64-apple-darwin
release: 1.78.0-nightly
LLVM version: 18.1.0

@tmandry tmandry added the I-lang-nominated Nominated for discussion during a lang team meeting. label Feb 28, 2024
@craterbot
Copy link
Collaborator

🚧 Experiment redundant-imports is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment redundant-imports is completed!
📊 295 regressed and 0 fixed (1000 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Feb 28, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 29, 2024
@kayabaNerve
Copy link

kayabaNerve commented Mar 2, 2024

My repository, which aims to support no-std when possible, explicitly imports many items within the std prelude. I effectively have to disable this lint or add tens to >100 of cfg statements, which makes no-std dev much more annoying.

EDIT: I cannot disable this without disabling unused import checks entirely, which I now understand ('moving to its own lint group' wasn't immediately clear to me). This is a blocker for me to update and really unfortunate.

@petrochenkov
Copy link
Contributor

In general, the new lint logic does exactly the same thing as all other existing unused lints - it detects some code (imports in this case) that can be removed, while not taking cfgs into account.

The only difference is that most other unused lints, including unused_imports, always existed, but this subset is added just recently.
So other unused code was timely removed and crates using conditional compilation, including no_std, invented some idioms for deailing with it, but with the new subset there's no such adaptation.

@petrochenkov
Copy link
Contributor

@surechen
If you are still interested in doing something in rustc you could fix some of #121708 (comment).

@petrochenkov
Copy link
Contributor

petrochenkov commented Mar 2, 2024

Note, that redundant imports specifically was previously reported by rustc as a part of unused_imports, but only in a minority of contexts (imports in blocks, introduced in #58805 in 2019), redundant imports in modules weren't reported.

cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 13, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 13, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 14, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 14, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin pushed a commit to brave/brave-core that referenced this issue Jan 14, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin added a commit to brave/brave-core that referenced this issue Jan 14, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin pushed a commit to brave/brave-core that referenced this issue Jan 14, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin added a commit to brave/brave-core that referenced this issue Jan 14, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin pushed a commit to brave/brave-core that referenced this issue Jan 14, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin added a commit to brave/brave-core that referenced this issue Jan 14, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 15, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 15, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 16, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 16, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin pushed a commit to brave/brave-core that referenced this issue Jan 17, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin added a commit to brave/brave-core that referenced this issue Jan 17, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 17, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 17, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 20, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 20, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 21, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 21, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 23, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 23, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Jan 24, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
cdesouza-chromium pushed a commit to brave/brave-core that referenced this issue Jan 24, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
@traviscross traviscross added I-lang-radar Items that are on lang's radar and will need eventual work or consideration. and removed I-lang-nominated Nominated for discussion during a lang team meeting. labels Jan 26, 2025
mkarolin pushed a commit to brave/brave-core that referenced this issue Jan 27, 2025
This warning is now enabled for all chromium code, and it has been
triggered with some of the zcash code.

Additionally, this change has to correct a lot of the formatting for
that file, which seems to have changed considerably.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
mkarolin added a commit to brave/brave-core that referenced this issue Jan 27, 2025
error: unused import: `Hashable`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\merkle_tree.rs:7:14
  |
7 |     Address, Hashable, Level, MerklePath, Position,
  |              ^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `Write`
 --> ../../brave/components/brave_wallet/browser/zcash/rust/librustzcash/src/zcash_primitives/src\transaction\mod.rs:4:27
  |
4 | use std::io::{self, Read, Write};
  |                           ^^^^^

Chromium change:

https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec

commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    points out that new linting scenarios have been moved into a separate
    lint.  Thanks to this, we no longer need to globally disable this lint
    in Chromium (some narrower exclusions still need to apply).

    Bug: chromium:326247202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-lang-radar Items that are on lang's radar and will need eventual work or consideration. L-redundant_imports Lint: redundant_imports S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests