2018-02-25 10:58:54 -05:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
|
|
//! Experimental types for the trait query interface. The methods
|
|
|
|
|
//! defined in this module are all based on **canonicalization**,
|
|
|
|
|
//! which makes a canonical query by replacing unbound inference
|
|
|
|
|
//! variables and regions, so that results can be reused more broadly.
|
|
|
|
|
//! The providers for the queries defined here can be found in
|
|
|
|
|
//! `librustc_traits`.
|
|
|
|
|
|
|
|
|
|
use infer::canonical::Canonical;
|
2018-02-21 10:55:16 -05:00
|
|
|
use ty::{self, Ty};
|
2018-02-25 10:58:54 -05:00
|
|
|
|
2018-02-21 10:55:16 -05:00
|
|
|
pub mod dropck_outlives;
|
2018-02-25 10:58:54 -05:00
|
|
|
pub mod normalize;
|
2018-02-21 11:24:13 -05:00
|
|
|
pub mod normalize_erasing_regions;
|
2018-02-25 10:58:54 -05:00
|
|
|
|
|
|
|
|
pub type CanonicalProjectionGoal<'tcx> =
|
|
|
|
|
Canonical<'tcx, ty::ParamEnvAnd<'tcx, ty::ProjectionTy<'tcx>>>;
|
|
|
|
|
|
2018-02-21 10:55:16 -05:00
|
|
|
pub type CanonicalTyGoal<'tcx> = Canonical<'tcx, ty::ParamEnvAnd<'tcx, Ty<'tcx>>>;
|
|
|
|
|
|
2018-02-25 10:58:54 -05:00
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
|
|
|
|
pub struct NoSolution;
|
|
|
|
|
|
|
|
|
|
pub type Fallible<T> = Result<T, NoSolution>;
|
|
|
|
|
|
|
|
|
|
impl_stable_hash_for!(struct NoSolution { });
|