File tree 2 files changed +34
-0
lines changed 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,9 @@ impl<'a> InferenceContext<'a> {
535
535
for ( _, subst) in result. method_resolutions . values_mut ( ) {
536
536
* subst = table. resolve_completely ( subst. clone ( ) ) ;
537
537
}
538
+ for ( _, subst) in result. assoc_resolutions . values_mut ( ) {
539
+ * subst = table. resolve_completely ( subst. clone ( ) ) ;
540
+ }
538
541
for adjustment in result. expr_adjustments . values_mut ( ) . flatten ( ) {
539
542
adjustment. target = table. resolve_completely ( adjustment. target . clone ( ) ) ;
540
543
}
Original file line number Diff line number Diff line change @@ -4079,6 +4079,37 @@ const FOO$0: f64 = 1.0f64;
4079
4079
) ;
4080
4080
}
4081
4081
4082
+ #[ test]
4083
+ fn hover_const_eval_in_generic_trait ( ) {
4084
+ // Doesn't compile, but we shouldn't crash.
4085
+ check (
4086
+ r#"
4087
+ trait Trait<T> {
4088
+ const FOO: bool = false;
4089
+ }
4090
+ struct S<T>(T);
4091
+ impl<T> Trait<T> for S<T> {
4092
+ const FOO: bool = true;
4093
+ }
4094
+
4095
+ fn test() {
4096
+ S::FOO$0;
4097
+ }
4098
+ "# ,
4099
+ expect ! [ [ r#"
4100
+ *FOO*
4101
+
4102
+ ```rust
4103
+ test
4104
+ ```
4105
+
4106
+ ```rust
4107
+ const FOO: bool = true
4108
+ ```
4109
+ "# ] ] ,
4110
+ ) ;
4111
+ }
4112
+
4082
4113
#[ test]
4083
4114
fn hover_const_pat ( ) {
4084
4115
check (
You can’t perform that action at this time.
0 commit comments