1
Fork 0

Use ScrubbedTraitError in more places

This commit is contained in:
Michael Goulet 2024-06-01 15:00:02 -04:00
parent eb0a70a557
commit 94a524ed11
7 changed files with 25 additions and 22 deletions

View file

@ -70,10 +70,17 @@ pub use self::util::{with_replaced_escaping_bound_vars, BoundVarReplacer, Placeh
pub use rustc_infer::traits::*;
// A trait error without any information in it. You likely want to alternately use [`ObligationCtxt::new_with_diagnostics`] to get a [`FulfillmentError`].
/// A trait error without most of its information removed. This is the error
/// returned by an [`ObligationCtxt`] by default, and suitable if you just
/// want to see if a predicate holds, and don't particularly care about the
/// error itself (except for if it's an ambiguity or true error).
///
/// use [`ObligationCtxt::new_with_diagnostics`] to get a [`FulfillmentError`].
#[derive(Copy, Clone, Debug)]
pub enum ScrubbedTraitError {
/// A real error. This goal definitely does not hold.
TrueError,
/// An ambiguity. This goal may hold if further inference is done.
Ambiguity,
}