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