1
Fork 0

document Applicability

This commit is contained in:
Andy Russell 2019-01-25 14:56:27 -05:00
parent 491680114a
commit 8eaa84c79f
No known key found for this signature in database
GPG key ID: BE2221033EDBC374

View file

@ -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)]