Rollup merge of #114246 - Bryanskiy:type-privacy-lints-fixes, r=petrochenkov
Weaken unnameable_types lint `unnameable_types` lint is no longer emitted for - associated types - internal types r? ``@petrochenkov``
This commit is contained in:
commit
d113b5b848
3 changed files with 4 additions and 20 deletions
|
|
@ -11,12 +11,12 @@ mod m {
|
|||
|
||||
pub trait PubTr { //~ ERROR trait `PubTr` is reachable but cannot be named
|
||||
const C : i32 = 0;
|
||||
type Alias; //~ ERROR associated type `PubTr::Alias` is reachable but cannot be named
|
||||
type Alias;
|
||||
fn f() {}
|
||||
}
|
||||
|
||||
impl PubTr for PubStruct {
|
||||
type Alias = i32; //~ ERROR associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
|
||||
type Alias = i32;
|
||||
fn f() {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,17 +22,5 @@ error: trait `PubTr` is reachable but cannot be named
|
|||
LL | pub trait PubTr {
|
||||
| ^^^^^^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
|
||||
|
||||
error: associated type `PubTr::Alias` is reachable but cannot be named
|
||||
--> $DIR/unnameable_types.rs:14:9
|
||||
|
|
||||
LL | type Alias;
|
||||
| ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
|
||||
|
||||
error: associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
|
||||
--> $DIR/unnameable_types.rs:19:9
|
||||
|
|
||||
LL | type Alias = i32;
|
||||
| ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue