File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/rustc_mir/src/const_eval Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,11 @@ fn const_to_valtree_inner<'tcx>(
87
87
ty:: FnPtr ( _) | ty:: RawPtr ( _) => None ,
88
88
ty:: Ref ( ..) => unimplemented ! ( "need to use deref_const" ) ,
89
89
90
- ty:: Dynamic ( ..) => unimplemented ! (
91
- "for trait objects we must look at the vtable and figure out the real type"
92
- ) ,
90
+ // Trait objects are not allowed in type level constants, as we have no concept for
91
+ // resolving their backing type, even if we can do that at const eval time. We may want to consider
92
+ // adding a `ValTree::DownCast(Ty<'tcx>, Box<ValTree>)` in the future, but I don't even know the
93
+ // questions such a concept would open up, so an RFC would probably be good for this.
94
+ ty:: Dynamic ( ..) => None ,
93
95
94
96
ty:: Slice ( _) | ty:: Str => {
95
97
unimplemented ! ( "need to find the backing data of the slice/str and recurse on that" )
You can’t perform that action at this time.
0 commit comments