summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_type_ir/src/visit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_type_ir/src/visit.rs')
-rw-r--r--compiler/rustc_type_ir/src/visit.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_type_ir/src/visit.rs b/compiler/rustc_type_ir/src/visit.rs
index 9c7b8156b..7aa990046 100644
--- a/compiler/rustc_type_ir/src/visit.rs
+++ b/compiler/rustc_type_ir/src/visit.rs
@@ -41,12 +41,12 @@
//! - u.visit_with(visitor)
//! ```
-use rustc_data_structures::sync::Lrc;
use rustc_index::{Idx, IndexVec};
use std::fmt;
use std::ops::ControlFlow;
use crate::Interner;
+use crate::Lrc;
/// This trait is implemented for every type that can be visited,
/// providing the skeleton of the traversal.
@@ -82,8 +82,12 @@ pub trait TypeSuperVisitable<I: Interner>: TypeVisitable<I> {
/// method defined for every type of interest. Each such method has a default
/// that recurses into the type's fields in a non-custom fashion.
pub trait TypeVisitor<I: Interner>: Sized {
+ #[cfg(feature = "nightly")]
type BreakTy = !;
+ #[cfg(not(feature = "nightly"))]
+ type BreakTy;
+
fn visit_binder<T: TypeVisitable<I>>(&mut self, t: &I::Binder<T>) -> ControlFlow<Self::BreakTy>
where
I::Binder<T>: TypeSuperVisitable<I>,