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