Skip to main content

Module misplaced_dots

Module misplaced_dots 

Source
Expand description

Hint for a file that fails to parse because a Rust ... parameter is not the last one (#1737).

Rust’s ... parameter parses only in last position, so a file holding fn f(sources: ..., dosing_type: Strs) fails syn::parse_file and no rule checks it. hint tokenizes the source (which still works, and drops comments) and names the cause and the &Dots spelling, for the lint to append to its “failed to parse” warning.

Mirror: miniextendr-macros/src/misplaced_dots.rs gives #[miniextendr] the same error. 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.
hint 🔒
The hint for a source file that holds a ... parameter with another parameter after it: line N: <message>. None when it holds none or does not tokenize.
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.