Skip to content

Commit

Permalink
Rename -Z explain to -Z teach
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 23, 2018
1 parent 3dac0f5 commit 482f7f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"treat all errors that occur as bugs"),
external_macro_backtrace: bool = (false, parse_bool, [UNTRACKED],
"show macro backtraces even for non-local macros"),
explain: bool = (false, parse_bool, [TRACKED],
teach: bool = (false, parse_bool, [TRACKED],
"show extended diagnostic help"),
continue_parse_after_error: bool = (false, parse_bool, [TRACKED],
"attempt to recover from parse errors (experimental)"),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ impl Session {
}
}

pub fn explain(&self, code: &DiagnosticId) -> bool {
self.opts.debugging_opts.explain && !self.parse_sess.span_diagnostic.code_emitted(code)
pub fn teach(&self, code: &DiagnosticId) -> bool {
self.opts.debugging_opts.teach && !self.parse_sess.span_diagnostic.code_emitted(code)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/structured_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait StructuredDiagnostic<'tcx> {

fn diagnostic(&self) -> DiagnosticBuilder<'tcx> {
let err = self.common();
if self.session().explain(&self.code()) {
if self.session().teach(&self.code()) {
self.extended(err)
} else {
self.regular(err)
Expand Down

0 comments on commit 482f7f1

Please sign in to comment.