File tree 2 files changed +3
-6
lines changed
compiler/rustc_hir_analysis/src/hir_ty_lowering
tests/ui/associated-consts
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -998,6 +998,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
998
998
self . lower_const_arg ( ct, FeedConstTy :: No ) . into ( )
999
999
}
1000
1000
} ;
1001
+ if term. references_error ( ) {
1002
+ continue ;
1003
+ }
1001
1004
// FIXME(#97583): This isn't syntactically well-formed!
1002
1005
where_bounds. push ( format ! (
1003
1006
" T: {trait}::{assoc_name} = {term}" ,
Original file line number Diff line number Diff line change @@ -26,12 +26,6 @@ LL | trait Parent2 { const C: &'static str; }
26
26
LL |
27
27
LL | fn take1(_: impl Trait1<C = "?">) {}
28
28
| ^^^^^^^ ambiguous associated constant `C`
29
- |
30
- = help: consider introducing a new type parameter `T` and adding `where` constraints:
31
- where
32
- T: Trait1,
33
- T: Parent2::C = {const error},
34
- T: Parent1::C = {const error}
35
29
36
30
error: aborting due to 2 previous errors
37
31
You can’t perform that action at this time.
0 commit comments