Closed
Description
I've encountered an issue with the private_in_public
lint (#34537). If I create a #[bench]
function that has the same name as an extern crate
, then rustc claims that "extern crate foo
is private".
Here's a minimal example that reproduces this bug:
// ducks.rs
#![feature(test)]
extern crate test;
extern crate geese;
#[bench]
fn geese(_: &mut test::Bencher) {}
geese.rs
is an empty file.
$ rustc geese.rs --crate-type rlib
$ rustc ducks.rs --test --extern geese=libgeese.rlib
warning: extern crate `geese` is private, and cannot be reexported (error E0364), consider declaring with `pub`, #[warn(private_in_public)] on by default
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
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.)
Metadata
Metadata
Assignees
Labels
No labels