diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 3e25f98ccd27c..64d5ca0c2a742 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -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)]