Skip to content

Commit

Permalink
document Applicability
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Jan 27, 2019
1 parent 4916801 commit 8eaa84c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/librustc_errors/lib.rs
Expand Up @@ -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)]
Expand Down

0 comments on commit 8eaa84c

Please sign in to comment.