Struct rustc_typeck::structured_errors::wrong_number_of_generic_args::WrongNumberOfGenericArgs [−][src]
Handles the wrong number of type / lifetime / ... arguments family of error messages.
Fields
tcx: TyCtxt<'tcx>kind: &'static str“type”, “lifetime” etc., put verbatim into the message
expected_min: usizeMinimum number of expected generic arguments (e.g. 2 for HashMap)
expected_max: usizeMaximum number of expected generic arguments (e.g. 3 for HashMap)
provided: usizeNumber of generic arguments provided by the user
params_offset: usizeOffset into gen_params - depends on the kind; might be different than args_offset when
user passed e.g. more arguments than was actually expected
args_offset: usizeOffset into gen_args - depends on the kind
path_segment: &'a PathSegment<'a>Offending path segment
gen_params: &'a GenericsGeneric parameters as expected by type or trait
gen_args: &'a GenericArgs<'a>Generic arguments as provided by user
def_id: DefIdDefId of the generic type
span: SpanOffending place where the generic type has been misused
Implementations
impl<'tcx> WrongNumberOfGenericArgs<'_, 'tcx>[src]
fn quantifier_and_bound(&self) -> (&'static str, usize)[src]
fn start_diagnostics(&self) -> DiagnosticBuilder<'tcx>[src]
fn notify(&self, err: &mut DiagnosticBuilder<'_>)[src]
Builds the expected 1 type argument / supplied 2 type arguments message.
fn suggest(&self, err: &mut DiagnosticBuilder<'_>)[src]
fn suggest_creating_generics(&self, err: &mut DiagnosticBuilder<'_>)[src]
Suggests to create generics (<...>) when current invocation site contains no generics at
all:
type Map = HashMap;
fn suggest_adding_args(&self, err: &mut DiagnosticBuilder<'_>)[src]
Suggests to add missing argument(s) when current invocation site already contains some generics:
type Map = HashMap<String>;
fn suggest_removing_args_or_generics(&self, err: &mut DiagnosticBuilder<'_>)[src]
Suggests to remove redundant argument(s):
type Map = HashMap<String, String, String, String>;
fn show_definition(&self, err: &mut DiagnosticBuilder<'_>)[src]
Builds the type defined here message.
Trait Implementations
impl<'tcx> StructuredDiagnostic<'tcx> for WrongNumberOfGenericArgs<'_, 'tcx>[src]
fn session(&self) -> &Session[src]
fn code(&self) -> DiagnosticId[src]
fn diagnostic_common(&self) -> DiagnosticBuilder<'tcx>[src]
fn diagnostic(&self) -> DiagnosticBuilder<'tcx>[src]
fn diagnostic_regular(
&self,
err: DiagnosticBuilder<'tcx>
) -> DiagnosticBuilder<'tcx>[src]
&self,
err: DiagnosticBuilder<'tcx>
) -> DiagnosticBuilder<'tcx>
fn diagnostic_extended(
&self,
err: DiagnosticBuilder<'tcx>
) -> DiagnosticBuilder<'tcx>[src]
&self,
err: DiagnosticBuilder<'tcx>
) -> DiagnosticBuilder<'tcx>
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for WrongNumberOfGenericArgs<'a, 'tcx>
impl<'a, 'tcx> !Send for WrongNumberOfGenericArgs<'a, 'tcx>
impl<'a, 'tcx> !Sync for WrongNumberOfGenericArgs<'a, 'tcx>
impl<'a, 'tcx> Unpin for WrongNumberOfGenericArgs<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for WrongNumberOfGenericArgs<'a, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.