Move trait into attr so it's greppable
This commit is contained in:
parent
9c25823bb4
commit
a9dbf63087
31 changed files with 91 additions and 80 deletions
|
@ -13,8 +13,8 @@ use rustc_middle::ty::{self, TyCtxt};
|
|||
|
||||
/// FIXME(-Znext-solver): This or public because it is shared with the
|
||||
/// new trait solver implementation. We should deduplicate canonicalization.
|
||||
#[extension]
|
||||
pub impl<'tcx, V> CanonicalExt<'tcx, V> for Canonical<'tcx, V> {
|
||||
#[extension(pub trait CanonicalExt<'tcx, V>)]
|
||||
impl<'tcx, V> Canonical<'tcx, V> {
|
||||
/// Instantiate the wrapped value, replacing each canonical value
|
||||
/// with the value given in `var_values`.
|
||||
fn instantiate(&self, tcx: TyCtxt<'tcx>, var_values: &CanonicalVarValues<'tcx>) -> V
|
||||
|
|
|
@ -2786,8 +2786,8 @@ pub enum FailureCode {
|
|||
Error0644,
|
||||
}
|
||||
|
||||
#[extension]
|
||||
pub impl<'tcx> ObligationCauseExt<'tcx> for ObligationCause<'tcx> {
|
||||
#[extension(pub trait ObligationCauseExt<'tcx>)]
|
||||
impl<'tcx> ObligationCause<'tcx> {
|
||||
fn as_failure_code(&self, terr: TypeError<'tcx>) -> FailureCode {
|
||||
use self::FailureCode::*;
|
||||
use crate::traits::ObligationCauseCode::*;
|
||||
|
|
|
@ -626,8 +626,8 @@ pub struct InferCtxtBuilder<'tcx> {
|
|||
next_trait_solver: bool,
|
||||
}
|
||||
|
||||
#[extension]
|
||||
pub impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> {
|
||||
#[extension(pub trait TyCtxtInferExt<'tcx>)]
|
||||
impl<'tcx> TyCtxt<'tcx> {
|
||||
fn infer_ctxt(self) -> InferCtxtBuilder<'tcx> {
|
||||
InferCtxtBuilder {
|
||||
tcx: self,
|
||||
|
|
|
@ -52,8 +52,8 @@ pub trait TraitEngine<'tcx>: 'tcx {
|
|||
) -> Vec<PredicateObligation<'tcx>>;
|
||||
}
|
||||
|
||||
#[extension]
|
||||
pub impl<'tcx, T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
#[extension(pub trait TraitEngineExt<'tcx>)]
|
||||
impl<'tcx, T: ?Sized + TraitEngine<'tcx>> T {
|
||||
fn register_predicate_obligations(
|
||||
&mut self,
|
||||
infcx: &InferCtxt<'tcx>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue