File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 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> {
535535 for ( _, subst) in result. method_resolutions . values_mut ( ) {
536536 * subst = table. resolve_completely ( subst. clone ( ) ) ;
537537 }
538+ for ( _, subst) in result. assoc_resolutions . values_mut ( ) {
539+ * subst = table. resolve_completely ( subst. clone ( ) ) ;
540+ }
538541 for adjustment in result. expr_adjustments . values_mut ( ) . flatten ( ) {
539542 adjustment. target = table. resolve_completely ( adjustment. target . clone ( ) ) ;
540543 }
Original file line number Diff line number Diff line change @@ -4079,6 +4079,37 @@ const FOO$0: f64 = 1.0f64;
40794079 ) ;
40804080}
40814081
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+
40824113#[ test]
40834114fn hover_const_pat ( ) {
40844115 check (
You can’t perform that action at this time.
0 commit comments