Skip to content

Commit 8eaa84c

Browse files
committed
document Applicability
1 parent 4916801 commit 8eaa84c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/librustc_errors/lib.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,28 @@ use syntax_pos::{BytePos,
5454
Span,
5555
NO_EXPANSION};
5656

57+
/// Indicates the confidence in the correctness of a suggestion.
58+
///
59+
/// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion
60+
/// to determine whether it should be automatically applied or if the user should be consulted
61+
/// before applying the suggestion.
5762
#[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
5863
pub enum Applicability {
64+
/// The suggestion is definitely what the user intended. This suggestion should be
65+
/// automatically applied.
5966
MachineApplicable,
60-
HasPlaceholders,
67+
68+
/// The suggestion may be what the user intended, but it is uncertain. The suggestion should
69+
/// result in valid Rust code if it is applied.
6170
MaybeIncorrect,
62-
Unspecified
71+
72+
/// The suggestion contains placeholders like `(...)` or `{ /* fields */ }`. The suggestion
73+
/// cannot be applied automatically because it will not result in valid Rust code. The user
74+
/// will need to fill in the placeholders.
75+
HasPlaceholders,
76+
77+
/// The applicability of the suggestion is unknown.
78+
Unspecified,
6379
}
6480

6581
#[derive(Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]

0 commit comments

Comments
 (0)