pub struct UfcsArgMismatch {
pub index: usize,
pub expected: Ty,
pub found: Ty,
}Expand description
One statically-checkable argument-type mismatch at a UFCS-desugared free
function call (recv.name(args) → name(recv, args)) — issue #1881,
the UFCS sibling of infer::DirectCallArgMismatch (#1864/PR #1875,
direct calls) and infer::TypedAssignMismatch (#1877/PR #1899,
declaration initializers and assignments). Reported by [check_strict]
as E063, the same code the other two siblings use — no new code minted
for this position (docs/t1c-spec.md §8’s “existing TM-3 machinery”
posture, extended here rather than a parallel checker).
Fields§
§index: usizeThe mismatched argument’s 0-based position in the desugared call
name(recv, args) — 0 names the receiver itself (the desugar’s
first positional slot); i for i >= 1 names the (i - 1)-th
written argument. Matches the “receiver counts as the first
argument” convention this call site’s own arity-mismatch diagnostic
already uses (see [UfcsVisitor::try_free_fn_desugar]).
Exception (issue #1918): a UfcsVerdict::FieldCall’s own
arg_mismatches does not follow this convention — a field call has
no receiver-prepending desugar, so index there is 0-based over the
written arguments only (0 names the first written argument, not
the receiver); see that variant’s own field doc.
expected: TyThe desugared target’s declared parameter type at index.
found: TyThe receiver’s (index == 0) or written argument’s statically
classified type.
Trait Implementations§
Source§impl Clone for UfcsArgMismatch
impl Clone for UfcsArgMismatch
Source§fn clone(&self) -> UfcsArgMismatch
fn clone(&self) -> UfcsArgMismatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UfcsArgMismatch
impl Debug for UfcsArgMismatch
impl Eq for UfcsArgMismatch
Source§impl PartialEq for UfcsArgMismatch
impl PartialEq for UfcsArgMismatch
impl StructuralPartialEq for UfcsArgMismatch
Auto Trait Implementations§
impl Freeze for UfcsArgMismatch
impl RefUnwindSafe for UfcsArgMismatch
impl Send for UfcsArgMismatch
impl Sync for UfcsArgMismatch
impl Unpin for UfcsArgMismatch
impl UnsafeUnpin for UfcsArgMismatch
impl UnwindSafe for UfcsArgMismatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.