Skip to content

Commit d60214c

Browse files
committed
Clippy fixes, rename stuff to match RFC
1 parent 12f9b79 commit d60214c

File tree

9 files changed

+32
-13
lines changed

9 files changed

+32
-13
lines changed

src/librustc/lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ declare_lint! {
126126
}
127127

128128
declare_lint! {
129-
pub LEAKED_PRIVATE_DEPENDENCY,
129+
pub EXTERNAL_PRIVATE_DEPENDENCY,
130130
Warn,
131131
"public interface leaks type from a private dependency"
132132
}
@@ -411,7 +411,7 @@ impl LintPass for HardwiredLints {
411411
TRIVIAL_CASTS,
412412
TRIVIAL_NUMERIC_CASTS,
413413
PRIVATE_IN_PUBLIC,
414-
LEAKED_PRIVATE_DEPENDENCY,
414+
EXTERNAL_PRIVATE_DEPENDENCY,
415415
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
416416
INVALID_TYPE_PARAM_DEFAULT,
417417
CONST_ERR,

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ pub fn build_session_options_and_crate_config(
19281928
let mut extern_public: FxHashSet<String> = matches.opt_strs("extern-public").
19291929
iter().cloned().collect();
19301930

1931-
// TODO - come up with a better way of handling this
1931+
// FIXME - come up with a better way of handling this
19321932
extern_public.insert("core".to_string());
19331933
extern_public.insert("std".to_string());
19341934

src/librustc_lint/builtin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,5 +1883,3 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
18831883
}
18841884

18851885
}
1886-
1887-

src/librustc_lint/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
230230
edition: None,
231231
},
232232
FutureIncompatibleInfo {
233-
id: LintId::of(LEAKED_PRIVATE_DEPENDENCY),
233+
id: LintId::of(EXTERNAL_PRIVATE_DEPENDENCY),
234234
reference: "issue #44663 <https://github.com/rust-lang/rust/issues/44663>",
235235
edition: None,
236236
},

src/librustc_privacy/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> {
14961496

14971497
fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display) -> bool {
14981498
if self.leaks_private_dep(def_id) {
1499-
self.tcx.lint_node(lint::builtin::LEAKED_PRIVATE_DEPENDENCY,
1499+
self.tcx.lint_node(lint::builtin::EXTERNAL_PRIVATE_DEPENDENCY,
15001500
self.item_id,
15011501
self.span,
15021502
&format!("{} `{}` from private dependency '{}' in public \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct PubType;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This test is different from other feature gate tests.
2+
// Instead of checking that an error occurs without the feature gate,
3+
// it checks that *no* errors/warnings occurs without the feature gate.
4+
// This is due to the fact that 'public_private_dependencies' just enables
5+
// a lint, so disabling it shouldn't cause any code to stop compiling.
6+
7+
// run-pass
8+
// aux-build:pub_dep.rs
9+
10+
// Without ![feature(public_private_dependencies)],
11+
// this should do nothing/
12+
#![deny(external_private_dependency)]
13+
14+
extern crate pub_dep;
15+
16+
pub struct Foo {
17+
pub field: pub_dep::PubType
18+
}
19+
20+
fn main() {}

src/test/ui/privacy/pub-priv-dep/pub-priv1.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:pub_dep.rs
33
// compile-flags: --extern-public=pub_dep
44
#![feature(public_private_dependencies)]
5-
#![deny(leaked_private_dependency)]
5+
#![deny(external_private_dependency)]
66

77
// This crate is a private dependency
88
extern crate priv_dep;
@@ -20,15 +20,15 @@ struct PrivateType {
2020

2121
pub struct PublicType {
2222
pub field: OtherType,
23-
//~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface [leaked_private_dependency]
23+
//~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
2424
//~| WARNING this was previously accepted
2525
priv_field: OtherType, // Private field - this is fine
2626
pub other_field: PubType // Type from public dependency - this is fine
2727
}
2828

2929
impl PublicType {
3030
pub fn pub_fn(param: OtherType) {}
31-
//~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface [leaked_private_dependency]
31+
//~^ ERROR type `priv_dep::OtherType` from private dependency 'priv_dep' in public interface
3232
//~| WARNING this was previously accepted
3333

3434
fn priv_fn(param: OtherType) {}
@@ -37,7 +37,7 @@ impl PublicType {
3737
pub trait MyPubTrait {
3838
type Foo: OtherTrait;
3939
}
40-
//~^^^ ERROR trait `priv_dep::OtherTrait` from private dependency 'priv_dep' in public interface [leaked_private_dependency]
40+
//~^^^ ERROR trait `priv_dep::OtherTrait` from private dependency 'priv_dep' in public interface
4141
//~| WARNING this was previously accepted
4242

4343

src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | pub field: OtherType,
77
note: lint level defined here
88
--> $DIR/pub-priv1.rs:5:9
99
|
10-
LL | #![deny(leaked_private_dependency)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![deny(external_private_dependency)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1313
= note: for more information, see issue #44663 <https://github.com/rust-lang/rust/issues/44663>
1414

0 commit comments

Comments
 (0)