1 //! Trait Resolution. See the [rustc guide] for more information on how this works.
3 //! [rustc guide]: https://rust-lang.github.io/rustc-guide/traits/resolution.html
7 pub mod specialization_graph;
10 use crate::infer::canonical::Canonical;
11 use crate::mir::interpret::ErrorHandled;
12 use crate::ty::fold::{TypeFolder, TypeVisitor};
13 use crate::ty::subst::SubstsRef;
14 use crate::ty::{self, AdtKind, List, Ty, TyCtxt};
17 use rustc_hir::def_id::DefId;
18 use rustc_span::{Span, DUMMY_SP};
24 pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache};
26 pub type ChalkCanonicalGoal<'tcx> = Canonical<'tcx, InEnvironment<'tcx, ty::Predicate<'tcx>>>;
28 pub use self::ObligationCauseCode::*;
29 pub use self::SelectionError::*;
30 pub use self::Vtable::*;
32 /// Depending on the stage of compilation, we want projection to be
33 /// more or less conservative.
34 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, HashStable)]
36 /// At type-checking time, we refuse to project any associated
37 /// type that is marked `default`. Non-`default` ("final") types
38 /// are always projected. This is necessary in general for
39 /// soundness of specialization. However, we *could* allow
40 /// projections in fully-monomorphic cases. We choose not to,
41 /// because we prefer for `default type` to force the type
42 /// definition to be treated abstractly by any consumers of the
43 /// impl. Concretely, that means that the following example will
51 /// impl<T> Assoc for T {
52 /// default type Output = bool;
56 /// let <() as Assoc>::Output = true;
61 /// At codegen time, all monomorphic projections will succeed.
62 /// Also, `impl Trait` is normalized to the concrete type,
63 /// which has to be already collected by type-checking.
65 /// NOTE: as `impl Trait`'s concrete type should *never*
66 /// be observable directly by the user, `Reveal::All`
67 /// should not be used by checks which may expose
68 /// type equality or type contents to the user.
69 /// There are some exceptions, e.g., around OIBITS and
70 /// transmute-checking, which expose some details, but
71 /// not the whole concrete type of the `impl Trait`.
75 /// The reason why we incurred this obligation; used for error reporting.
76 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
77 pub struct ObligationCause<'tcx> {
80 /// The ID of the fn body that triggered this obligation. This is
81 /// used for region obligations to determine the precise
82 /// environment in which the region obligation should be evaluated
83 /// (in particular, closures can add new assumptions). See the
84 /// field `region_obligations` of the `FulfillmentContext` for more
86 pub body_id: hir::HirId,
88 pub code: ObligationCauseCode<'tcx>,
91 impl<'tcx> ObligationCause<'tcx> {
96 code: ObligationCauseCode<'tcx>,
97 ) -> ObligationCause<'tcx> {
98 ObligationCause { span, body_id, code }
101 pub fn misc(span: Span, body_id: hir::HirId) -> ObligationCause<'tcx> {
102 ObligationCause { span, body_id, code: MiscObligation }
105 pub fn dummy() -> ObligationCause<'tcx> {
106 ObligationCause { span: DUMMY_SP, body_id: hir::CRATE_HIR_ID, code: MiscObligation }
109 pub fn span(&self, tcx: TyCtxt<'tcx>) -> Span {
111 ObligationCauseCode::CompareImplMethodObligation { .. }
112 | ObligationCauseCode::MainFunctionType
113 | ObligationCauseCode::StartFunctionType => tcx.sess.source_map().def_span(self.span),
114 ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
123 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
124 pub enum ObligationCauseCode<'tcx> {
125 /// Not well classified or should be obvious from the span.
128 /// A slice or array is WF only if `T: Sized`.
131 /// A tuple is WF only if its middle elements are `Sized`.
134 /// This is the trait reference from the given projection.
135 ProjectionWf(ty::ProjectionTy<'tcx>),
137 /// In an impl of trait `X` for type `Y`, type `Y` must
138 /// also implement all supertraits of `X`.
139 ItemObligation(DefId),
141 /// Like `ItemObligation`, but with extra detail on the source of the obligation.
142 BindingObligation(DefId, Span),
144 /// A type like `&'a T` is WF only if `T: 'a`.
145 ReferenceOutlivesReferent(Ty<'tcx>),
147 /// A type like `Box<Foo<'a> + 'b>` is WF only if `'b: 'a`.
148 ObjectTypeBound(Ty<'tcx>, ty::Region<'tcx>),
150 /// Obligation incurred due to an object cast.
151 ObjectCastObligation(/* Object type */ Ty<'tcx>),
153 /// Obligation incurred due to a coercion.
159 /// Various cases where expressions must be `Sized` / `Copy` / etc.
160 /// `L = X` implies that `L` is `Sized`.
162 /// `(x1, .., xn)` must be `Sized`.
163 TupleInitializerSized,
164 /// `S { ... }` must be `Sized`.
165 StructInitializerSized,
166 /// Type of each variable must be `Sized`.
167 VariableType(hir::HirId),
168 /// Argument type must be `Sized`.
170 /// Return type must be `Sized`.
172 /// Yield type must be `Sized`.
174 /// `[T, ..n]` implies that `T` must be `Copy`.
175 /// If `true`, suggest `const_in_array_repeat_expressions` feature flag.
178 /// Types of fields (other than the last, except for packed structs) in a struct must be sized.
184 /// Constant expressions must be sized.
187 /// `static` items must have `Sync` type.
190 BuiltinDerivedObligation(DerivedObligationCause<'tcx>),
192 ImplDerivedObligation(DerivedObligationCause<'tcx>),
194 /// Error derived when matching traits/impls; see ObligationCause for more details
195 CompareImplMethodObligation {
196 item_name: ast::Name,
197 impl_item_def_id: DefId,
198 trait_item_def_id: DefId,
201 /// Error derived when matching traits/impls; see ObligationCause for more details
202 CompareImplTypeObligation {
203 item_name: ast::Name,
204 impl_item_def_id: DefId,
205 trait_item_def_id: DefId,
208 /// Checking that this expression can be assigned where it needs to be
209 // FIXME(eddyb) #11161 is the original Expr required?
212 /// Computing common supertype in the arms of a match expression
213 MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>),
215 /// Type error arising from type checking a pattern against an expected type.
217 /// The span of the scrutinee or type expression which caused the `root_ty` type.
219 /// The root expected type induced by a scrutinee or type expression.
221 /// Whether the `Span` came from an expression or a type expression.
225 /// Constants in patterns must have `Structural` type.
226 ConstPatternStructural,
228 /// Computing common supertype in an if expression
229 IfExpression(Box<IfExpressionCause>),
231 /// Computing common supertype of an if expression with no else counter-part
232 IfExpressionWithNoElse,
234 /// `main` has wrong type
237 /// `start` has wrong type
240 /// Intrinsic has wrong type
246 /// `return` with no expression
249 /// `return` with an expression
250 ReturnValue(hir::HirId),
252 /// Return type of this function
255 /// Block implicit return
256 BlockTailExpression(hir::HirId),
258 /// #[feature(trivial_bounds)] is not enabled
261 AssocTypeBound(Box<AssocTypeBoundData>),
264 impl ObligationCauseCode<'_> {
265 // Return the base obligation, ignoring derived obligations.
266 pub fn peel_derives(&self) -> &Self {
267 let mut base_cause = self;
268 while let BuiltinDerivedObligation(cause) | ImplDerivedObligation(cause) = base_cause {
269 base_cause = &cause.parent_code;
275 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
276 pub struct AssocTypeBoundData {
277 pub impl_span: Option<Span>,
279 pub bounds: Vec<Span>,
282 // `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.
283 #[cfg(target_arch = "x86_64")]
284 static_assert_size!(ObligationCauseCode<'_>, 32);
286 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
287 pub struct MatchExpressionArmCause<'tcx> {
289 pub source: hir::MatchSource,
290 pub prior_arms: Vec<Span>,
291 pub last_ty: Ty<'tcx>,
292 pub scrut_hir_id: hir::HirId,
295 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
296 pub struct IfExpressionCause {
298 pub outer: Option<Span>,
299 pub semicolon: Option<Span>,
302 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
303 pub struct DerivedObligationCause<'tcx> {
304 /// The trait reference of the parent obligation that led to the
305 /// current obligation. Note that only trait obligations lead to
306 /// derived obligations, so we just store the trait reference here
308 pub parent_trait_ref: ty::PolyTraitRef<'tcx>,
310 /// The parent trait had this cause.
311 pub parent_code: Rc<ObligationCauseCode<'tcx>>,
314 /// The following types:
322 /// * `InEnvironment`,
323 /// are used for representing the trait system in the form of
324 /// logic programming clauses. They are part of the interface
325 /// for the chalk SLG solver.
326 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable, Lift)]
327 pub enum WhereClause<'tcx> {
328 Implemented(ty::TraitPredicate<'tcx>),
329 ProjectionEq(ty::ProjectionPredicate<'tcx>),
330 RegionOutlives(ty::RegionOutlivesPredicate<'tcx>),
331 TypeOutlives(ty::TypeOutlivesPredicate<'tcx>),
334 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable, Lift)]
335 pub enum WellFormed<'tcx> {
336 Trait(ty::TraitPredicate<'tcx>),
340 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable, Lift)]
341 pub enum FromEnv<'tcx> {
342 Trait(ty::TraitPredicate<'tcx>),
346 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable, Lift)]
347 pub enum DomainGoal<'tcx> {
348 Holds(WhereClause<'tcx>),
349 WellFormed(WellFormed<'tcx>),
350 FromEnv(FromEnv<'tcx>),
351 Normalize(ty::ProjectionPredicate<'tcx>),
354 pub type PolyDomainGoal<'tcx> = ty::Binder<DomainGoal<'tcx>>;
356 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable)]
357 pub enum QuantifierKind {
362 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable, Lift)]
363 pub enum GoalKind<'tcx> {
364 Implies(Clauses<'tcx>, Goal<'tcx>),
365 And(Goal<'tcx>, Goal<'tcx>),
367 DomainGoal(DomainGoal<'tcx>),
368 Quantified(QuantifierKind, ty::Binder<Goal<'tcx>>),
369 Subtype(Ty<'tcx>, Ty<'tcx>),
373 pub type Goal<'tcx> = &'tcx GoalKind<'tcx>;
375 pub type Goals<'tcx> = &'tcx List<Goal<'tcx>>;
377 impl<'tcx> DomainGoal<'tcx> {
378 pub fn into_goal(self) -> GoalKind<'tcx> {
379 GoalKind::DomainGoal(self)
382 pub fn into_program_clause(self) -> ProgramClause<'tcx> {
385 hypotheses: ty::List::empty(),
386 category: ProgramClauseCategory::Other,
391 impl<'tcx> GoalKind<'tcx> {
392 pub fn from_poly_domain_goal(
393 domain_goal: PolyDomainGoal<'tcx>,
395 ) -> GoalKind<'tcx> {
396 match domain_goal.no_bound_vars() {
397 Some(p) => p.into_goal(),
398 None => GoalKind::Quantified(
399 QuantifierKind::Universal,
400 domain_goal.map_bound(|p| tcx.mk_goal(p.into_goal())),
406 /// This matches the definition from Page 7 of "A Proof Procedure for the Logic of Hereditary
407 /// Harrop Formulas".
408 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable)]
409 pub enum Clause<'tcx> {
410 Implies(ProgramClause<'tcx>),
411 ForAll(ty::Binder<ProgramClause<'tcx>>),
415 pub fn category(self) -> ProgramClauseCategory {
417 Clause::Implies(clause) => clause.category,
418 Clause::ForAll(clause) => clause.skip_binder().category,
423 /// Multiple clauses.
424 pub type Clauses<'tcx> = &'tcx List<Clause<'tcx>>;
426 /// A "program clause" has the form `D :- G1, ..., Gn`. It is saying
427 /// that the domain goal `D` is true if `G1...Gn` are provable. This
428 /// is equivalent to the implication `G1..Gn => D`; we usually write
429 /// it with the reverse implication operator `:-` to emphasize the way
430 /// that programs are actually solved (via backchaining, which starts
431 /// with the goal to solve and proceeds from there).
432 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable)]
433 pub struct ProgramClause<'tcx> {
434 /// This goal will be considered true ...
435 pub goal: DomainGoal<'tcx>,
437 /// ... if we can prove these hypotheses (there may be no hypotheses at all):
438 pub hypotheses: Goals<'tcx>,
440 /// Useful for filtering clauses.
441 pub category: ProgramClauseCategory,
444 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable)]
445 pub enum ProgramClauseCategory {
451 /// A set of clauses that we assume to be true.
452 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable)]
453 pub struct Environment<'tcx> {
454 pub clauses: Clauses<'tcx>,
457 impl Environment<'tcx> {
458 pub fn with<G>(self, goal: G) -> InEnvironment<'tcx, G> {
459 InEnvironment { environment: self, goal }
463 /// Something (usually a goal), along with an environment.
464 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, TypeFoldable)]
465 pub struct InEnvironment<'tcx, G> {
466 pub environment: Environment<'tcx>,
470 #[derive(Clone, Debug, TypeFoldable)]
471 pub enum SelectionError<'tcx> {
473 OutputTypeParameterMismatch(
474 ty::PolyTraitRef<'tcx>,
475 ty::PolyTraitRef<'tcx>,
476 ty::error::TypeError<'tcx>,
478 TraitNotObjectSafe(DefId),
479 ConstEvalFailure(ErrorHandled),
483 /// When performing resolution, it is typically the case that there
484 /// can be one of three outcomes:
486 /// - `Ok(Some(r))`: success occurred with result `r`
487 /// - `Ok(None)`: could not definitely determine anything, usually due
488 /// to inconclusive type inference.
489 /// - `Err(e)`: error `e` occurred
490 pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
492 /// Given the successful resolution of an obligation, the `Vtable`
493 /// indicates where the vtable comes from. Note that while we call this
494 /// a "vtable", it does not necessarily indicate dynamic dispatch at
495 /// runtime. `Vtable` instances just tell the compiler where to find
496 /// methods, but in generic code those methods are typically statically
497 /// dispatched -- only when an object is constructed is a `Vtable`
498 /// instance reified into an actual vtable.
500 /// For example, the vtable may be tied to a specific impl (case A),
501 /// or it may be relative to some bound that is in scope (case B).
504 /// impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1
505 /// impl<T:Clone> Clone<T> for Box<T> { ... } // Impl_2
506 /// impl Clone for int { ... } // Impl_3
508 /// fn foo<T:Clone>(concrete: Option<Box<int>>,
510 /// mixed: Option<T>) {
512 /// // Case A: Vtable points at a specific impl. Only possible when
513 /// // type is concretely known. If the impl itself has bounded
514 /// // type parameters, Vtable will carry resolutions for those as well:
515 /// concrete.clone(); // Vtable(Impl_1, [Vtable(Impl_2, [Vtable(Impl_3)])])
517 /// // Case B: Vtable must be provided by caller. This applies when
518 /// // type is a type parameter.
519 /// param.clone(); // VtableParam
521 /// // Case C: A mix of cases A and B.
522 /// mixed.clone(); // Vtable(Impl_1, [VtableParam])
526 /// ### The type parameter `N`
528 /// See explanation on `VtableImplData`.
529 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
530 pub enum Vtable<'tcx, N> {
531 /// Vtable identifying a particular impl.
532 VtableImpl(VtableImplData<'tcx, N>),
534 /// Vtable for auto trait implementations.
535 /// This carries the information and nested obligations with regards
536 /// to an auto implementation for a trait `Trait`. The nested obligations
537 /// ensure the trait implementation holds for all the constituent types.
538 VtableAutoImpl(VtableAutoImplData<N>),
540 /// Successful resolution to an obligation provided by the caller
541 /// for some type parameter. The `Vec<N>` represents the
542 /// obligations incurred from normalizing the where-clause (if
546 /// Virtual calls through an object.
547 VtableObject(VtableObjectData<'tcx, N>),
549 /// Successful resolution for a builtin trait.
550 VtableBuiltin(VtableBuiltinData<N>),
552 /// Vtable automatically generated for a closure. The `DefId` is the ID
553 /// of the closure expression. This is a `VtableImpl` in spirit, but the
554 /// impl is generated by the compiler and does not appear in the source.
555 VtableClosure(VtableClosureData<'tcx, N>),
557 /// Same as above, but for a function pointer type with the given signature.
558 VtableFnPointer(VtableFnPointerData<'tcx, N>),
560 /// Vtable automatically generated for a generator.
561 VtableGenerator(VtableGeneratorData<'tcx, N>),
563 /// Vtable for a trait alias.
564 VtableTraitAlias(VtableTraitAliasData<'tcx, N>),
567 impl<'tcx, N> Vtable<'tcx, N> {
568 pub fn nested_obligations(self) -> Vec<N> {
570 VtableImpl(i) => i.nested,
572 VtableBuiltin(i) => i.nested,
573 VtableAutoImpl(d) => d.nested,
574 VtableClosure(c) => c.nested,
575 VtableGenerator(c) => c.nested,
576 VtableObject(d) => d.nested,
577 VtableFnPointer(d) => d.nested,
578 VtableTraitAlias(d) => d.nested,
582 pub fn map<M, F>(self, f: F) -> Vtable<'tcx, M>
587 VtableImpl(i) => VtableImpl(VtableImplData {
588 impl_def_id: i.impl_def_id,
590 nested: i.nested.into_iter().map(f).collect(),
592 VtableParam(n) => VtableParam(n.into_iter().map(f).collect()),
593 VtableBuiltin(i) => {
594 VtableBuiltin(VtableBuiltinData { nested: i.nested.into_iter().map(f).collect() })
596 VtableObject(o) => VtableObject(VtableObjectData {
597 upcast_trait_ref: o.upcast_trait_ref,
598 vtable_base: o.vtable_base,
599 nested: o.nested.into_iter().map(f).collect(),
601 VtableAutoImpl(d) => VtableAutoImpl(VtableAutoImplData {
602 trait_def_id: d.trait_def_id,
603 nested: d.nested.into_iter().map(f).collect(),
605 VtableClosure(c) => VtableClosure(VtableClosureData {
606 closure_def_id: c.closure_def_id,
608 nested: c.nested.into_iter().map(f).collect(),
610 VtableGenerator(c) => VtableGenerator(VtableGeneratorData {
611 generator_def_id: c.generator_def_id,
613 nested: c.nested.into_iter().map(f).collect(),
615 VtableFnPointer(p) => VtableFnPointer(VtableFnPointerData {
617 nested: p.nested.into_iter().map(f).collect(),
619 VtableTraitAlias(d) => VtableTraitAlias(VtableTraitAliasData {
620 alias_def_id: d.alias_def_id,
622 nested: d.nested.into_iter().map(f).collect(),
628 /// Identifies a particular impl in the source, along with a set of
629 /// substitutions from the impl's type/lifetime parameters. The
630 /// `nested` vector corresponds to the nested obligations attached to
631 /// the impl's type parameters.
633 /// The type parameter `N` indicates the type used for "nested
634 /// obligations" that are required by the impl. During type-check, this
635 /// is `Obligation`, as one might expect. During codegen, however, this
636 /// is `()`, because codegen only requires a shallow resolution of an
637 /// impl, and nested obligations are satisfied later.
638 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
639 pub struct VtableImplData<'tcx, N> {
640 pub impl_def_id: DefId,
641 pub substs: SubstsRef<'tcx>,
645 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
646 pub struct VtableGeneratorData<'tcx, N> {
647 pub generator_def_id: DefId,
648 pub substs: SubstsRef<'tcx>,
649 /// Nested obligations. This can be non-empty if the generator
650 /// signature contains associated types.
654 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
655 pub struct VtableClosureData<'tcx, N> {
656 pub closure_def_id: DefId,
657 pub substs: SubstsRef<'tcx>,
658 /// Nested obligations. This can be non-empty if the closure
659 /// signature contains associated types.
663 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
664 pub struct VtableAutoImplData<N> {
665 pub trait_def_id: DefId,
669 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
670 pub struct VtableBuiltinData<N> {
674 /// A vtable for some object-safe trait `Foo` automatically derived
675 /// for the object type `Foo`.
676 #[derive(PartialEq, Eq, Clone, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
677 pub struct VtableObjectData<'tcx, N> {
678 /// `Foo` upcast to the obligation trait. This will be some supertrait of `Foo`.
679 pub upcast_trait_ref: ty::PolyTraitRef<'tcx>,
681 /// The vtable is formed by concatenating together the method lists of
682 /// the base object trait and all supertraits; this is the start of
683 /// `upcast_trait_ref`'s methods in that vtable.
684 pub vtable_base: usize,
689 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
690 pub struct VtableFnPointerData<'tcx, N> {
695 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
696 pub struct VtableTraitAliasData<'tcx, N> {
697 pub alias_def_id: DefId,
698 pub substs: SubstsRef<'tcx>,
702 pub trait ExClauseFold<'tcx>
704 Self: chalk_engine::context::Context + Clone,
706 fn fold_ex_clause_with<F: TypeFolder<'tcx>>(
707 ex_clause: &chalk_engine::ExClause<Self>,
709 ) -> chalk_engine::ExClause<Self>;
711 fn visit_ex_clause_with<V: TypeVisitor<'tcx>>(
712 ex_clause: &chalk_engine::ExClause<Self>,
717 pub trait ChalkContextLift<'tcx>
719 Self: chalk_engine::context::Context + Clone,
721 type LiftedExClause: Debug + 'tcx;
722 type LiftedDelayedLiteral: Debug + 'tcx;
723 type LiftedLiteral: Debug + 'tcx;
725 fn lift_ex_clause_to_tcx(
726 ex_clause: &chalk_engine::ExClause<Self>,
728 ) -> Option<Self::LiftedExClause>;
730 fn lift_delayed_literal_to_tcx(
731 ex_clause: &chalk_engine::DelayedLiteral<Self>,
733 ) -> Option<Self::LiftedDelayedLiteral>;
735 fn lift_literal_to_tcx(
736 ex_clause: &chalk_engine::Literal<Self>,
738 ) -> Option<Self::LiftedLiteral>;