File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
compiler/rustc_hir_analysis/src/coherence Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,13 @@ fn do_orphan_check_impl<'tcx>(
207207 NonlocalImpl :: DisallowOther ,
208208 ) ,
209209
210- // Some of these should perhaps be a delay_span_bug.
210+ // type Opaque = impl Trait;
211+ // impl AutoTrait for Opaque {}
212+ ty:: Alias ( AliasKind :: Opaque , _) => (
213+ LocalImpl :: Disallow { problematic_kind : "opaque type" } ,
214+ NonlocalImpl :: DisallowOther ,
215+ ) ,
216+
211217 ty:: Bool
212218 | ty:: Char
213219 | ty:: Int ( ..)
@@ -220,16 +226,17 @@ fn do_orphan_check_impl<'tcx>(
220226 | ty:: Ref ( ..)
221227 | ty:: FnDef ( ..)
222228 | ty:: FnPtr ( ..)
223- | ty:: Closure ( ..)
229+ | ty:: Never
230+ | ty:: Tuple ( ..) => ( LocalImpl :: Allow , NonlocalImpl :: DisallowOther ) ,
231+
232+ ty:: Closure ( ..)
224233 | ty:: Generator ( ..)
225234 | ty:: GeneratorWitness ( ..)
226- | ty:: Never
227- | ty:: Tuple ( ..)
228- | ty:: Alias ( AliasKind :: Opaque , ..)
229235 | ty:: Bound ( ..)
230236 | ty:: Placeholder ( ..)
231- | ty:: Infer ( ..)
232- | ty:: Error ( ..) => ( LocalImpl :: Allow , NonlocalImpl :: DisallowOther ) ,
237+ | ty:: Infer ( ..) => span_bug ! ( sp, "weird self type for autotrait impl" ) ,
238+
239+ ty:: Error ( ..) => ( LocalImpl :: Allow , NonlocalImpl :: Allow ) ,
233240 } ;
234241
235242 if trait_def_id. is_local ( ) {
You can’t perform that action at this time.
0 commit comments