Skip to content

Commit 7847ca8

Browse files
committed
Document OverlapMode
1 parent e5f2fdb commit 7847ca8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

+5
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,15 @@ fn with_fresh_ty_vars<'cx, 'tcx>(
137137
header
138138
}
139139

140+
/// What kind of overlap check are we doing -- this exists just for testing and feature-gating
141+
/// purposes.
140142
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
141143
enum OverlapMode {
144+
/// The 1.0 rules (either types fail to unify, or where clauses are not implemented for crate-local types)
142145
Stable,
146+
/// Feature-gated test: Stable, *or* there is an explicit negative impl that rules out one of the where-clauses.
143147
WithNegative,
148+
/// Just check for negative impls, not for "where clause not implemented": used for testing.
144149
Strict,
145150
}
146151

0 commit comments

Comments
 (0)