Module clippy::utils
[−]
[src]
Structs
DiagnosticWrapper | |
LimitStack | |
SpanlessEq |
Type used to check whether two ast are the same. This is different from the operator
|
SpanlessHash |
Type used to hash an ast element. This is different from the |
UnsugaredRange |
Represents a range akin to |
Constants
Functions
camel_case_from |
Returns index of last CamelCase component of |
camel_case_until |
Returns index of character after first CamelCase component of |
differing_macro_contexts |
Returns true if the two spans come from differing expansions (i.e. one is from a macro and one isn't). |
expr_block |
Like |
get_enclosing_block | |
get_item_name |
Get the name of the item the expression is in, if available. |
get_parent_expr |
Get a parent expressions if any – this is useful to constrain a lint. |
get_trait_def_id |
Convenience function to get the |
implements_trait |
Check whether a type implements a trait.
See also |
in_external_macro |
Returns true if the macro that expanded the crate was outside of the current crate or was a compiler plugin. |
in_macro |
Returns true if this |
is_adjusted | |
is_expn_of |
Return the pre-expansion span if is this comes from an expansion of the macro |
is_from_for_desugar |
Checks if a |
is_integer_literal |
Check whether the given expression is a constant literal of the given value. |
match_def_path |
Check if a |
match_impl_method |
Check if the method call given in |
match_path |
Match a |
match_path_ast |
Match a |
match_trait_method |
Check if the method call given in |
match_type |
Check if type is struct or enum type with given def path. |
method_chain_args |
Match an |
path_to_def |
Get the definition associated to a path. TODO: investigate if there is something more efficient for that. |
snippet |
Convert a span to a code snippet if available, otherwise use default. |
snippet_block |
Convert a span (from a block) to a code snippet if available, otherwise use default. This trims the code of indentation, except for the first line. Use it for blocks or block-like things which need to be printed as such. |
snippet_opt |
Convert a span to a code snippet. Returns |
span_help_and_lint | |
span_lint | |
span_lint_and_then | |
span_note_and_lint | |
trim_multiline |
Trim indentation from a multiline string with possibility of ignoring the first line. |
unsugar_range |
Unsugar a |
walk_ptrs_ty |
Return the base type for references and raw pointers. |
walk_ptrs_ty_depth |
Return the base type for references and raw pointers, and count reference depth. |
Type Definitions
MethodArgs |