]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/trait-item-privacy.stderr
keep predicate order and tweak output
[rust.git] / src / test / ui / traits / trait-item-privacy.stderr
1 error[E0599]: no method named `a` found for struct `S` in the current scope
2   --> $DIR/trait-item-privacy.rs:67:7
3    |
4 LL | struct S;
5    | --------- method `a` not found for this
6 ...
7 LL |     S.a();
8    |       ^ method not found in `S`
9    |
10    = help: items from traits can only be used if the trait is implemented and in scope
11 note: `method::A` defines an item `a`, perhaps you need to implement it
12   --> $DIR/trait-item-privacy.rs:6:5
13    |
14 LL |     trait A {
15    |     ^^^^^^^
16
17 error[E0599]: no method named `b` found for struct `S` in the current scope
18   --> $DIR/trait-item-privacy.rs:68:7
19    |
20 LL | struct S;
21    | --------- method `b` not found for this
22 ...
23 LL |         fn b(&self) { }
24    |            -
25    |            |
26    |            the method is available for `std::boxed::Box<S>` here
27    |            the method is available for `std::sync::Arc<S>` here
28    |            the method is available for `std::rc::Rc<S>` here
29 ...
30 LL |     S.b();
31    |       ^ method not found in `S`
32    |
33    = help: items from traits can only be used if the trait is in scope
34 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
35    |
36 LL | use method::B;
37    |
38
39 error[E0624]: method `a` is private
40   --> $DIR/trait-item-privacy.rs:72:7
41    |
42 LL |     c.a();
43    |       ^
44
45 error[E0599]: no function or associated item named `a` found for struct `S` in the current scope
46   --> $DIR/trait-item-privacy.rs:78:8
47    |
48 LL | struct S;
49    | --------- function or associated item `a` not found for this
50 ...
51 LL |     S::a(&S);
52    |        ^ function or associated item not found in `S`
53    |
54    = help: items from traits can only be used if the trait is implemented and in scope
55 note: `method::A` defines an item `a`, perhaps you need to implement it
56   --> $DIR/trait-item-privacy.rs:6:5
57    |
58 LL |     trait A {
59    |     ^^^^^^^
60
61 error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
62   --> $DIR/trait-item-privacy.rs:80:8
63    |
64 LL | struct S;
65    | --------- function or associated item `b` not found for this
66 ...
67 LL |     S::b(&S);
68    |        ^ function or associated item not found in `S`
69    |
70    = help: items from traits can only be used if the trait is in scope
71 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
72    |
73 LL | use method::B;
74    |
75
76 error[E0624]: method `a` is private
77   --> $DIR/trait-item-privacy.rs:84:5
78    |
79 LL |     C::a(&S);
80    |     ^^^^
81
82 error[E0599]: no associated item named `A` found for struct `S` in the current scope
83   --> $DIR/trait-item-privacy.rs:97:8
84    |
85 LL | struct S;
86    | --------- associated item `A` not found for this
87 ...
88 LL |     S::A;
89    |        ^ associated item not found in `S`
90    |
91    = help: items from traits can only be used if the trait is implemented and in scope
92 note: `assoc_const::A` defines an item `A`, perhaps you need to implement it
93   --> $DIR/trait-item-privacy.rs:24:5
94    |
95 LL |     trait A {
96    |     ^^^^^^^
97
98 error[E0599]: no associated item named `B` found for struct `S` in the current scope
99   --> $DIR/trait-item-privacy.rs:98:8
100    |
101 LL | struct S;
102    | --------- associated item `B` not found for this
103 ...
104 LL |     S::B;
105    |        ^ associated item not found in `S`
106    |
107    = help: items from traits can only be used if the trait is in scope
108 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
109    |
110 LL | use assoc_const::B;
111    |
112
113 error[E0624]: associated constant `A` is private
114   --> $DIR/trait-item-privacy.rs:101:5
115    |
116 LL |     C::A;
117    |     ^^^^
118
119 error[E0038]: the trait `assoc_const::C` cannot be made into an object
120   --> $DIR/trait-item-privacy.rs:101:5
121    |
122 LL |         const A: u8 = 0;
123    |               - ...because it contains this associated `const`
124 ...
125 LL |         const B: u8 = 0;
126    |               - ...because it contains this associated `const`
127 ...
128 LL |     pub trait C: A + B {
129    |               - this trait cannot be made into an object...
130 LL |         const C: u8 = 0;
131    |               - ...because it contains this associated `const`
132 ...
133 LL |     C::A;
134    |     ^^^^ the trait `assoc_const::C` cannot be made into an object
135    |
136    = help: consider moving `C` to another trait
137    = help: consider moving `B` to another trait
138    = help: consider moving `A` to another trait
139
140 error[E0223]: ambiguous associated type
141   --> $DIR/trait-item-privacy.rs:115:12
142    |
143 LL |     let _: S::A;
144    |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::A`
145
146 error[E0223]: ambiguous associated type
147   --> $DIR/trait-item-privacy.rs:116:12
148    |
149 LL |     let _: S::B;
150    |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::B`
151
152 error[E0223]: ambiguous associated type
153   --> $DIR/trait-item-privacy.rs:117:12
154    |
155 LL |     let _: S::C;
156    |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::C`
157
158 error: associated type `A` is private
159   --> $DIR/trait-item-privacy.rs:119:12
160    |
161 LL |     let _: T::A;
162    |            ^^^^
163
164 error: associated type `A` is private
165   --> $DIR/trait-item-privacy.rs:128:9
166    |
167 LL |         A = u8,
168    |         ^^^^^^
169
170 error: aborting due to 15 previous errors
171
172 Some errors have detailed explanations: E0038, E0223, E0599, E0624.
173 For more information about an error, try `rustc --explain E0038`.