summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr
blob: e2d7ce4469242f5151875b4e072a4be41e1d8c11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
error[E0445]: private trait `PrivTr` in public interface
  --> $DIR/where-pub-type-impls-priv-trait.rs:24:1
   |
LL | trait PrivTr {}
   | ------------ `PrivTr` declared as private
...
LL | pub struct S
   | ^^^^^^^^^^^^ can't leak private trait

warning: trait `PrivTr` is more private than the item `S`
  --> $DIR/where-pub-type-impls-priv-trait.rs:24:1
   |
LL | pub struct S
   | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub`
   |
note: but trait `PrivTr` is only usable at visibility `pub(crate)`
  --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
   |
LL | trait PrivTr {}
   | ^^^^^^^^^^^^
note: the lint level is defined here
  --> $DIR/where-pub-type-impls-priv-trait.rs:7:9
   |
LL | #![warn(private_bounds)]
   |         ^^^^^^^^^^^^^^

error[E0445]: private trait `PrivTr` in public interface
  --> $DIR/where-pub-type-impls-priv-trait.rs:32:1
   |
LL | trait PrivTr {}
   | ------------ `PrivTr` declared as private
...
LL | pub enum E
   | ^^^^^^^^^^ can't leak private trait

warning: trait `PrivTr` is more private than the item `E`
  --> $DIR/where-pub-type-impls-priv-trait.rs:32:1
   |
LL | pub enum E
   | ^^^^^^^^^^ enum `E` is reachable at visibility `pub`
   |
note: but trait `PrivTr` is only usable at visibility `pub(crate)`
  --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
   |
LL | trait PrivTr {}
   | ^^^^^^^^^^^^

error[E0445]: private trait `PrivTr` in public interface
  --> $DIR/where-pub-type-impls-priv-trait.rs:40:1
   |
LL |   trait PrivTr {}
   |   ------------ `PrivTr` declared as private
...
LL | / pub fn f()
LL | |
LL | |
LL | | where
LL | |     PubTy: PrivTr
   | |_________________^ can't leak private trait

warning: trait `PrivTr` is more private than the item `f`
  --> $DIR/where-pub-type-impls-priv-trait.rs:40:1
   |
LL | / pub fn f()
LL | |
LL | |
LL | | where
LL | |     PubTy: PrivTr
   | |_________________^ function `f` is reachable at visibility `pub`
   |
note: but trait `PrivTr` is only usable at visibility `pub(crate)`
  --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
   |
LL | trait PrivTr {}
   | ^^^^^^^^^^^^

error[E0445]: private trait `PrivTr` in public interface
  --> $DIR/where-pub-type-impls-priv-trait.rs:48:1
   |
LL | trait PrivTr {}
   | ------------ `PrivTr` declared as private
...
LL | impl S
   | ^^^^^^ can't leak private trait

warning: trait `PrivTr` is more private than the item `S`
  --> $DIR/where-pub-type-impls-priv-trait.rs:48:1
   |
LL | impl S
   | ^^^^^^ implementation `S` is reachable at visibility `pub`
   |
note: but trait `PrivTr` is only usable at visibility `pub(crate)`
  --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
   |
LL | trait PrivTr {}
   | ^^^^^^^^^^^^

error[E0445]: private trait `PrivTr` in public interface
  --> $DIR/where-pub-type-impls-priv-trait.rs:54:5
   |
LL |   trait PrivTr {}
   |   ------------ `PrivTr` declared as private
...
LL | /     pub fn f()
LL | |
LL | |
LL | |     where
LL | |         PubTy: PrivTr
   | |_____________________^ can't leak private trait

warning: trait `PrivTr` is more private than the item `S::f`
  --> $DIR/where-pub-type-impls-priv-trait.rs:54:5
   |
LL | /     pub fn f()
LL | |
LL | |
LL | |     where
LL | |         PubTy: PrivTr
   | |_____________________^ associated function `S::f` is reachable at visibility `pub`
   |
note: but trait `PrivTr` is only usable at visibility `pub(crate)`
  --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
   |
LL | trait PrivTr {}
   | ^^^^^^^^^^^^

error: aborting due to 5 previous errors; 5 warnings emitted

For more information about this error, try `rustc --explain E0445`.