fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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