Skip to main content

Module misplaced_dots

Module misplaced_dots 

Source
Expand description

Diagnostic for a Rust ... parameter that is not the last one (#1737).

Rust’s ... parameter parses only in last position, so fn f(sources: ..., dosing_type: Strs) is not a function to syn. The item fails ItemFn (and, as a method, ItemImpl / ItemTrait), which would leave #[miniextendr] with its struct/enum message. find recognises that shape at token level so the fallback can name the cause and the &Dots spelling.

Mirror: miniextendr-lint/src/misplaced_dots.rs appends the same text to the lint’s “failed to parse” warning. Keep the detector and message in sync.

Structs§

MisplacedDots 🔒
A Rust ... parameter followed by another parameter.

Functions§

dots_at 🔒
The three . tokens of a ... that starts at tts[i].
find 🔒
The first ... parameter that another parameter follows, in any fn signature in tokens.
in_params 🔒
A ... parameter in params with another parameter after it (a trailing comma is fine).
message 🔒
The diagnostic for a ... parameter that is not last, named name (None for unnamed dots).
params_group 🔒
The parameter list after fn name: the first parenthesized group outside the generics’ angle brackets.