Use extension trait derive
This commit is contained in:
@@ -22,20 +22,8 @@ use super::NoSolution;
|
||||
|
||||
pub use rustc_middle::traits::query::NormalizationResult;
|
||||
|
||||
pub trait QueryNormalizeExt<'tcx> {
|
||||
/// Normalize a value using the `QueryNormalizer`.
|
||||
///
|
||||
/// This normalization should *only* be used when the projection does not
|
||||
/// have possible ambiguity or may not be well-formed.
|
||||
///
|
||||
/// After codegen, when lifetimes do not matter, it is preferable to instead
|
||||
/// use [`TyCtxt::normalize_erasing_regions`], which wraps this procedure.
|
||||
fn query_normalize<T>(self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
|
||||
where
|
||||
T: TypeFoldable<TyCtxt<'tcx>>;
|
||||
}
|
||||
|
||||
impl<'cx, 'tcx> QueryNormalizeExt<'tcx> for At<'cx, 'tcx> {
|
||||
#[extension]
|
||||
pub impl<'cx, 'tcx> QueryNormalizeExt<'tcx> for At<'cx, 'tcx> {
|
||||
/// Normalize `value` in the context of the inference context,
|
||||
/// yielding a resulting type, or an error if `value` cannot be
|
||||
/// normalized. If you don't care about regions, you should prefer
|
||||
|
||||
Reference in New Issue
Block a user