File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2705,6 +2705,37 @@ fn main() {
2705
2705
```
2706
2706
"## ,
2707
2707
2708
+ E0329 : r##"
2709
+ An attempt was made to access an associated constant through either a generic
2710
+ type parameter or `Self`. This is not supported yet. An example causing this
2711
+ error is shown below:
2712
+
2713
+ ```
2714
+ trait Foo {
2715
+ const BAR: f64;
2716
+ }
2717
+
2718
+ struct MyStruct;
2719
+
2720
+ impl Foo for MyStruct {
2721
+ const BAR: f64 = 0f64;
2722
+ }
2723
+
2724
+ fn get_bar_bad<F: Foo>(t: F) -> f64 {
2725
+ F::BAR
2726
+ }
2727
+ ```
2728
+
2729
+ Currently, the value of `BAR` for a particular type can only be accessed through
2730
+ a concrete type, as shown below:
2731
+
2732
+ ```
2733
+ fn get_bar_good() -> f64 {
2734
+ <MyStruct as Foo>::BAR
2735
+ }
2736
+ ```
2737
+ "## ,
2738
+
2708
2739
E0366 : r##"
2709
2740
An attempt was made to implement `Drop` on a concrete specialization of a
2710
2741
generic type. An example is shown below:
@@ -3251,7 +3282,6 @@ register_diagnostics! {
3251
3282
E0320 , // recursive overflow during dropck
3252
3283
E0321 , // extended coherence rules for defaulted traits violated
3253
3284
E0328 , // cannot implement Unsize explicitly
3254
- E0329 , // associated const depends on type parameter or Self.
3255
3285
E0374 , // the trait `CoerceUnsized` may only be implemented for a coercion
3256
3286
// between structures with one field being coerced, none found
3257
3287
E0375 , // the trait `CoerceUnsized` may only be implemented for a coercion
You can’t perform that action at this time.
0 commit comments