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.

Re-exportsยง

use proc_macro2::Delimiter; ๐Ÿ”’
use proc_macro2::Spacing; ๐Ÿ”’
use proc_macro2::TokenStream; ๐Ÿ”’
use proc_macro2::TokenTree; ๐Ÿ”’

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.