Module clippy_lints::utils
[−]
[src]
Modules
comparisons |
Utility functions about comparison operators. |
conf |
Read configurations files. |
constants |
This module contains some useful constants. |
higher |
This module contains functions for retrieve the original AST from lowered |
inspector |
checks for attributes |
internal_lints | |
paths |
This module contains paths to types and functions Clippy needs to know about. |
sugg |
Contains utility functions to generate suggestions. |
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 |
Functions
camel_case_from |
Return index of the last camel-case component of |
camel_case_until |
Return the index of the character after the first camel-case 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_constant | |
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_automatically_derived |
Checks for the |
is_copy | |
is_direct_expn_of |
Return the pre-expansion span if is this directly comes from an expansion of the macro |
is_expn_of |
Return the pre-expansion span if is this comes from an expansion of the macro |
is_integer_literal |
Check whether the given expression is a constant literal of the given value. |
is_refutable |
Return whether a pattern is refutable. |
is_self | |
is_self_ty | |
is_try |
Check if a given expression is a match expression
expanded from |
iter_input_pats | |
last_path_segment | |
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_path_old | |
match_trait_method |
Check if the method call given in |
match_type |
Check if type is struct, enum or union type with given def path. |
method_chain_args |
Match an |
multispan_sugg |
Create a suggestion made from several |
opt_def_id | |
path_to_def |
Get the definition associated to a path. TODO: investigate if there is something more efficient for that. |
remove_blocks |
Remove blocks around an expression. |
resolve_node |
Resolve the definition of a node from its |
return_ty |
Convenience function to get the return type of a function |
same_tys |
Check if two types are the same. |
single_segment_path | |
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_sugg | |
span_lint_and_then | |
span_note_and_lint | |
trim_multiline |
Trim indentation from a multiline string with possibility of ignoring the first line. |
type_is_unsafe_function |
Return whether the given type is an |
type_size | |
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 |