rust/tests/ui/privacy/private-in-public-warn.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

426 lines
15 KiB
Plaintext
Raw Normal View History

error: type `types::Priv` is more private than the item `types::Alias`
2018-12-25 09:56:47 -06:00
--> $DIR/private-in-public-warn.rs:15:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub type Alias = Priv;
| ^^^^^^^^^^^^^^ type alias `types::Alias` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
|
LL | struct Priv;
| ^^^^^^^^^^^
2020-01-22 17:57:38 -06:00
note: the lint level is defined here
2018-12-25 09:56:47 -06:00
--> $DIR/private-in-public-warn.rs:5:9
2018-08-08 07:28:26 -05:00
|
LL | #![deny(private_interfaces, private_bounds)]
| ^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `E::V1::0`
--> $DIR/private-in-public-warn.rs:17:12
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | V1(Priv),
| ^^^^ field `E::V1::0` is reachable at visibility `pub(crate)`
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `E::V2::field`
--> $DIR/private-in-public-warn.rs:18:14
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | V2 { field: Priv },
| ^^^^^^^^^^^ field `E::V2::field` is reachable at visibility `pub(crate)`
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `Tr::C`
--> $DIR/private-in-public-warn.rs:21:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | const C: Priv = Priv;
| ^^^^^^^^^^^^^ associated constant `Tr::C` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error[E0446]: private type `types::Priv` in public interface
--> $DIR/private-in-public-warn.rs:22:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `types::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Alias = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `Tr::f1`
--> $DIR/private-in-public-warn.rs:23:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | fn f1(arg: Priv) {}
| ^^^^^^^^^^^^^^^^ associated function `Tr::f1` is reachable at visibility `pub(crate)`
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `Tr::f2`
--> $DIR/private-in-public-warn.rs:24:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | fn f2() -> Priv { panic!() }
| ^^^^^^^^^^^^^^^ associated function `Tr::f2` is reachable at visibility `pub(crate)`
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `types::ES`
--> $DIR/private-in-public-warn.rs:27:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub static ES: Priv;
| ^^^^^^^^^^^^^^^^^^^ static `types::ES` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `types::ef1`
--> $DIR/private-in-public-warn.rs:28:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub fn ef1(arg: Priv);
| ^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `types::Priv` is more private than the item `types::ef2`
--> $DIR/private-in-public-warn.rs:29:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub fn ef2() -> Priv;
| ^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)`
|
note: but type `types::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:9:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error[E0446]: private type `types::Priv` in public interface
--> $DIR/private-in-public-warn.rs:32:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `types::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Alias = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Alias`
--> $DIR/private-in-public-warn.rs:41:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub type Alias<T: PrivTr> = T;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ type alias `traits::Alias` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/private-in-public-warn.rs:5:29
|
LL | #![deny(private_interfaces, private_bounds)]
| ^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Tr1`
--> $DIR/private-in-public-warn.rs:43:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub trait Tr1: PrivTr {}
| ^^^^^^^^^^^^^^^^^^^^^ trait `traits::Tr1` is reachable at visibility `pub(crate)`
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Tr2`
--> $DIR/private-in-public-warn.rs:44:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub trait Tr2<T: PrivTr> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ trait `traits::Tr2` is reachable at visibility `pub(crate)`
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Tr3::Alias`
--> $DIR/private-in-public-warn.rs:46:9
|
LL | type Alias: PrivTr;
| ^^^^^^^^^^^^^^^^^^ associated type `traits::Tr3::Alias` is reachable at visibility `pub(crate)`
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Tr3::f`
--> $DIR/private-in-public-warn.rs:48:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | fn f<T: PrivTr>(arg: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits::Tr3::f` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits::PrivTr` is more private than the item `traits::Pub<T>`
--> $DIR/private-in-public-warn.rs:50:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | impl<T: PrivTr> Pub<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^ implementation `traits::Pub<T>` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:37:5
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Alias`
--> $DIR/private-in-public-warn.rs:59:5
2018-08-08 07:28:26 -05:00
|
LL | pub type Alias<T> where T: PrivTr = T;
| ^^^^^^^^^^^^^^^^^ type alias `traits_where::Alias` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:55:5
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr2`
--> $DIR/private-in-public-warn.rs:62:5
2018-08-08 07:28:26 -05:00
|
LL | pub trait Tr2<T> where T: PrivTr {}
| ^^^^^^^^^^^^^^^^ trait `traits_where::Tr2` is reachable at visibility `pub(crate)`
|
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:55:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr3::f`
--> $DIR/private-in-public-warn.rs:65:9
2018-08-08 07:28:26 -05:00
|
LL | fn f<T>(arg: T) where T: PrivTr {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits_where::Tr3::f` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:55:5
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `traits_where::PrivTr` is more private than the item `traits_where::Pub<T>`
--> $DIR/private-in-public-warn.rs:68:5
2018-08-08 07:28:26 -05:00
|
LL | impl<T> Pub<T> where T: PrivTr {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation `traits_where::Pub<T>` is reachable at visibility `pub(crate)`
|
note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:55:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr {}
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `generics::PrivTr<generics::Pub>` is more private than the item `generics::Tr1`
--> $DIR/private-in-public-warn.rs:79:5
2018-08-08 07:28:26 -05:00
|
LL | pub trait Tr1: PrivTr<Pub> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr1` is reachable at visibility `pub(crate)`
|
note: but trait `generics::PrivTr<generics::Pub>` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:76:5
2018-08-08 07:28:26 -05:00
|
LL | trait PrivTr<T> {}
| ^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `generics::Priv` is more private than the item `generics::Tr2`
--> $DIR/private-in-public-warn.rs:81:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub trait Tr2: PubTr<Priv> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr2` is reachable at visibility `pub(crate)`
|
note: but type `generics::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:74:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv<T = u8>(T);
| ^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `generics::Priv` is more private than the item `generics::Tr3`
--> $DIR/private-in-public-warn.rs:82:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub trait Tr3: PubTr<[Priv; 1]> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr3` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `generics::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:74:5
|
LL | struct Priv<T = u8>(T);
| ^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `generics::Priv` is more private than the item `Tr4`
--> $DIR/private-in-public-warn.rs:83:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub trait Tr4: PubTr<Pub<Priv>> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `Tr4` is reachable at visibility `pub(crate)`
|
note: but type `generics::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:74:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv<T = u8>(T);
| ^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error[E0446]: private type `impls::Priv` in public interface
--> $DIR/private-in-public-warn.rs:109:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `impls::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Alias = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error: type `aliases_pub::Priv` is more private than the item `aliases_pub::<impl Pub2>::f`
--> $DIR/private-in-public-warn.rs:180:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | pub fn f(arg: Priv) {}
| ^^^^^^^^^^^^^^^^^^^ associated function `aliases_pub::<impl Pub2>::f` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but type `aliases_pub::Priv` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:153:5
|
LL | struct Priv;
| ^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:183:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `aliases_pub::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Check = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:186:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `aliases_pub::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Check = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:189:9
2018-08-08 07:28:26 -05:00
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `aliases_pub::Priv` declared as private
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | type Check = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
2018-08-08 07:28:26 -05:00
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:192:9
|
LL | struct Priv;
2022-02-13 09:27:59 -06:00
| ----------- `aliases_pub::Priv` declared as private
...
2019-03-09 06:03:44 -06:00
LL | type Check = Priv;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^ can't leak private type
error: trait `PrivTr1` is more private than the item `aliases_priv::Tr1`
--> $DIR/private-in-public-warn.rs:222:5
2018-08-08 07:28:26 -05:00
|
LL | pub trait Tr1: PrivUseAliasTr {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr1` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `PrivTr1` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:208:5
|
LL | trait PrivTr1<T = u8> {
| ^^^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: trait `PrivTr1<Priv2>` is more private than the item `aliases_priv::Tr2`
--> $DIR/private-in-public-warn.rs:224:5
2018-08-08 07:28:26 -05:00
|
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
2018-08-08 07:28:26 -05:00
|
note: but trait `PrivTr1<Priv2>` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:208:5
|
LL | trait PrivTr1<T = u8> {
| ^^^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: type `Priv2` is more private than the item `aliases_priv::Tr2`
--> $DIR/private-in-public-warn.rs:224:5
2018-08-08 07:28:26 -05:00
|
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)`
|
note: but type `Priv2` is only usable at visibility `pub(self)`
--> $DIR/private-in-public-warn.rs:206:5
2018-08-08 07:28:26 -05:00
|
LL | struct Priv2;
| ^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/private-in-public-warn.rs:41:23
|
2019-03-09 06:03:44 -06:00
LL | pub type Alias<T: PrivTr> = T;
| ^^^^^^
|
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
LL - pub type Alias<T: PrivTr> = T;
LL + pub type Alias<T> = T;
2022-06-08 12:34:57 -05:00
|
warning: where clauses are not enforced in type aliases
--> $DIR/private-in-public-warn.rs:59:29
|
LL | pub type Alias<T> where T: PrivTr = T;
| ^^^^^^^^^
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL - pub type Alias<T> where T: PrivTr = T;
LL + pub type Alias<T> = T;
2022-06-08 12:34:57 -05:00
|
error: aborting due to 34 previous errors; 2 warnings emitted
2018-08-08 07:28:26 -05:00
For more information about this error, try `rustc --explain E0446`.