-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Frivolous private_in_public lint when shadowing an imported crate using #[bench] #36768
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is already fixed on nightly, but you have to enable new import resolution rules for the fix to have effect:
|
@petrochenkov Thanks for the tip. But I do wonder what we can do to make this warning less confusing. |
cc @jseyfried |
I think there are two issues here. First, this doesn't compile at all with #[test] fn foo() {}
mod foo {} //< This causes the test harness's `use` of `foo` to be a hard re-export error. This will be fixed by Second, this emits #[test] fn foo() {}
extern crate foo {} //< This causes the test harness's `use` of `foo` to be a `PRIVATE_IN_PUBLIC` warning. This will not be fixed by |
With |
…_errors, r=nrc Avoid re-export errors in the generated test harness Fixes rust-lang#36768. r? @nrc
I've encountered an issue with the
private_in_public
lint (#34537). If I create a#[bench]
function that has the same name as anextern crate
, then rustc claims that "extern cratefoo
is private".Here's a minimal example that reproduces this bug:
geese.rs
is an empty file.The warning disappears if I either (a) rename the bench function, or (b) remove the
#[bench]
attribute.Using
rustc 1.13.0-nightly (4f9812a59 2016-09-21)
, installed on Arch Linux x64 via rustup. (The official nightly hasn't been updated for a while, which is why my version is out of date. Apologies if the issue has already been fixed.)The text was updated successfully, but these errors were encountered: