Move trait into attr so it's greppable

This commit is contained in:
Michael Goulet
2024-02-14 17:18:56 +00:00
parent 9c25823bb4
commit a9dbf63087
31 changed files with 91 additions and 80 deletions

View File

@@ -131,8 +131,8 @@ pub enum GenerateProofTree {
Never,
}
#[extension]
pub impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
#[extension(pub trait InferCtxtEvalExt<'tcx>)]
impl<'tcx> InferCtxt<'tcx> {
/// Evaluates a goal from **outside** of the trait solver.
///
/// Using this while inside of the solver is wrong as it uses a new

View File

@@ -17,8 +17,8 @@ use crate::solve::inspect::ProofTreeBuilder;
use crate::traits::StructurallyNormalizeExt;
use crate::traits::TraitEngineExt;
#[extension]
pub impl<'tcx> InferCtxtSelectExt<'tcx> for InferCtxt<'tcx> {
#[extension(pub trait InferCtxtSelectExt<'tcx>)]
impl<'tcx> InferCtxt<'tcx> {
fn select_in_new_trait_solver(
&self,
obligation: &PolyTraitObligation<'tcx>,

View File

@@ -216,8 +216,8 @@ pub trait ProofTreeVisitor<'tcx> {
fn visit_goal(&mut self, goal: &InspectGoal<'_, 'tcx>) -> ControlFlow<Self::BreakTy>;
}
#[extension]
pub impl<'tcx> ProofTreeInferCtxtExt<'tcx> for InferCtxt<'tcx> {
#[extension(pub trait ProofTreeInferCtxtExt<'tcx>)]
impl<'tcx> InferCtxt<'tcx> {
fn visit_proof_tree<V: ProofTreeVisitor<'tcx>>(
&self,
goal: Goal<'tcx, ty::Predicate<'tcx>>,

View File

@@ -61,8 +61,8 @@ enum GoalEvaluationKind {
Nested { is_normalizes_to_hack: IsNormalizesToHack },
}
#[extension]
impl<'tcx> CanonicalResponseExt for Canonical<'tcx, Response<'tcx>> {
#[extension(trait CanonicalResponseExt)]
impl<'tcx> Canonical<'tcx, Response<'tcx>> {
fn has_no_inference_or_external_constraints(&self) -> bool {
self.value.external_constraints.region_constraints.is_empty()
&& self.value.var_values.is_identity()