|
9 | 9 | #![feature(file_buffered)]
|
10 | 10 | #![feature(if_let_guard)]
|
11 | 11 | #![feature(let_chains)]
|
| 12 | +#![feature(negative_impls)] |
12 | 13 | #![feature(never_type)]
|
13 | 14 | #![feature(rustc_attrs)]
|
14 | 15 | #![feature(rustdoc_internals)]
|
@@ -36,7 +37,9 @@ use rustc_infer::infer::{
|
36 | 37 | };
|
37 | 38 | use rustc_middle::mir::*;
|
38 | 39 | use rustc_middle::query::Providers;
|
39 |
| -use rustc_middle::ty::{self, ParamEnv, RegionVid, Ty, TyCtxt, TypingMode, fold_regions}; |
| 40 | +use rustc_middle::ty::{ |
| 41 | + self, ParamEnv, RegionVid, Ty, TyCtxt, TypeFoldable, TypeVisitable, TypingMode, fold_regions, |
| 42 | +}; |
40 | 43 | use rustc_middle::{bug, span_bug};
|
41 | 44 | use rustc_mir_dataflow::impls::{
|
42 | 45 | EverInitializedPlaces, MaybeInitializedPlaces, MaybeUninitializedPlaces,
|
@@ -236,13 +239,14 @@ pub enum ClosureOutlivesSubject<'tcx> {
|
236 | 239 | /// This abstraction is necessary because the type may include `ReVar` regions,
|
237 | 240 | /// which is what we use internally within NLL code, and they can't be used in
|
238 | 241 | /// a query response.
|
239 |
| -/// |
240 |
| -/// DO NOT implement `TypeVisitable` or `TypeFoldable` traits, because this |
241 |
| -/// type is not recognized as a binder for late-bound region. |
242 | 242 | #[derive(Copy, Clone, Debug)]
|
243 | 243 | pub struct ClosureOutlivesSubjectTy<'tcx> {
|
244 | 244 | inner: Ty<'tcx>,
|
245 | 245 | }
|
| 246 | +// DO NOT implement `TypeVisitable` or `TypeFoldable` traits, because this |
| 247 | +// type is not recognized as a binder for late-bound region. |
| 248 | +impl<'tcx, I> !TypeVisitable<I> for ClosureOutlivesSubjectTy<'tcx> {} |
| 249 | +impl<'tcx, I> !TypeFoldable<I> for ClosureOutlivesSubjectTy<'tcx> {} |
246 | 250 |
|
247 | 251 | impl<'tcx> ClosureOutlivesSubjectTy<'tcx> {
|
248 | 252 | /// All regions of `ty` must be of kind `ReVar` and must represent
|
|
0 commit comments