document Applicability
This commit is contained in:
parent
491680114a
commit
8eaa84c79f
1 changed files with 18 additions and 2 deletions
|
@ -54,12 +54,28 @@ use syntax_pos::{BytePos,
|
|||
Span,
|
||||
NO_EXPANSION};
|
||||
|
||||
/// Indicates the confidence in the correctness of a suggestion.
|
||||
///
|
||||
/// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion
|
||||
/// to determine whether it should be automatically applied or if the user should be consulted
|
||||
/// before applying the suggestion.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
|
||||
pub enum Applicability {
|
||||
/// The suggestion is definitely what the user intended. This suggestion should be
|
||||
/// automatically applied.
|
||||
MachineApplicable,
|
||||
HasPlaceholders,
|
||||
|
||||
/// The suggestion may be what the user intended, but it is uncertain. The suggestion should
|
||||
/// result in valid Rust code if it is applied.
|
||||
MaybeIncorrect,
|
||||
Unspecified
|
||||
|
||||
/// The suggestion contains placeholders like `(...)` or `{ /* fields */ }`. The suggestion
|
||||
/// cannot be applied automatically because it will not result in valid Rust code. The user
|
||||
/// will need to fill in the placeholders.
|
||||
HasPlaceholders,
|
||||
|
||||
/// The applicability of the suggestion is unknown.
|
||||
Unspecified,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue