-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #34206 - petrochenkov:pipdeny, r=nikomatsakis
Make `private_in_public` compatibility lint deny-by-default In accordance with the [plan](https://internals.rust-lang.org/t/fcp-for-various-future-compatibility-warnings/3590/5?u=petrochenkov). r? @nikomatsakis
- Loading branch information
Showing
11 changed files
with
101 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
pub use inner::C; | ||
|
||
mod inner { | ||
trait A { | ||
fn a(&self) { } | ||
} | ||
|
||
pub trait B { | ||
fn b(&self) { } | ||
} | ||
|
||
pub trait C: A + B { //~ ERROR private trait in public interface | ||
//~^ WARN will become a hard error | ||
fn c(&self) { } | ||
} | ||
|
||
impl A for i32 {} | ||
impl B for i32 {} | ||
impl C for i32 {} | ||
|
||
} | ||
|
||
fn main() { | ||
// A is private | ||
// B is pub, not reexported | ||
// C : A + B is pub, reexported | ||
|
||
// 0.a(); // can't call | ||
// 0.b(); // can't call | ||
0.c(); // ok | ||
|
||
C::a(&0); // can call | ||
C::b(&0); // can call | ||
C::c(&0); // ok | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,6 @@ | |
// except according to those terms. | ||
|
||
mod m1 { | ||
#![deny(private_in_public)] | ||
|
||
pub struct Pub; | ||
struct Priv; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ struct S2; | |
|
||
mod m1 { | ||
fn f() { | ||
struct Z { | ||
pub struct Z { | ||
pub field: u8 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters