From 7847ca8c61f7dc49775f237efae9c7da007d20af Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 22 Jan 2022 21:24:11 -0300 Subject: [PATCH] Document OverlapMode --- compiler/rustc_trait_selection/src/traits/coherence.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index f22ca11d1c3..abe51b3fe30 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -137,10 +137,15 @@ fn with_fresh_ty_vars<'cx, 'tcx>( header } +/// What kind of overlap check are we doing -- this exists just for testing and feature-gating +/// purposes. #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] enum OverlapMode { + /// The 1.0 rules (either types fail to unify, or where clauses are not implemented for crate-local types) Stable, + /// Feature-gated test: Stable, *or* there is an explicit negative impl that rules out one of the where-clauses. WithNegative, + /// Just check for negative impls, not for "where clause not implemented": used for testing. Strict, }