rename ErrorReported -> ErrorGuaranteed
This commit is contained in:
parent
c42d846add
commit
e489a94dee
112 changed files with 580 additions and 559 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use rustc_ast as ast;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::{ColorConfig, ErrorReported, FatalError};
|
||||
use rustc_errors::{ColorConfig, ErrorGuaranteed, FatalError};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_hir::intravisit;
|
||||
|
|
@ -44,7 +44,7 @@ crate struct GlobalTestOptions {
|
|||
crate attrs: Vec<String>,
|
||||
}
|
||||
|
||||
crate fn run(options: RustdocOptions) -> Result<(), ErrorReported> {
|
||||
crate fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> {
|
||||
let input = config::Input::File(options.input.clone());
|
||||
|
||||
let invalid_codeblock_attributes_name = crate::lint::INVALID_CODEBLOCK_ATTRIBUTES.name;
|
||||
|
|
@ -154,14 +154,14 @@ crate fn run(options: RustdocOptions) -> Result<(), ErrorReported> {
|
|||
|
||||
let unused_extern_reports = collector.unused_extern_reports.clone();
|
||||
let compiling_test_count = collector.compiling_test_count.load(Ordering::SeqCst);
|
||||
let ret: Result<_, ErrorReported> =
|
||||
let ret: Result<_, ErrorGuaranteed> =
|
||||
Ok((collector.tests, unused_extern_reports, compiling_test_count));
|
||||
ret
|
||||
})
|
||||
});
|
||||
let (tests, unused_extern_reports, compiling_test_count) = match res {
|
||||
Ok(res) => res,
|
||||
Err(ErrorReported) => return Err(ErrorReported),
|
||||
Err(ErrorGuaranteed) => return Err(ErrorGuaranteed),
|
||||
};
|
||||
|
||||
run_tests(test_args, nocapture, tests);
|
||||
|
|
@ -619,7 +619,7 @@ crate fn make_test(
|
|||
});
|
||||
let (already_has_main, already_has_extern_crate, found_macro) = match result {
|
||||
Ok(result) => result,
|
||||
Err(ErrorReported) => {
|
||||
Err(ErrorGuaranteed) => {
|
||||
// If the parser panicked due to a fatal error, pass the test code through unchanged.
|
||||
// The error will be reported during compilation.
|
||||
return (s.to_owned(), 0, false);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ use std::io;
|
|||
use std::process;
|
||||
|
||||
use rustc_driver::{abort_on_err, describe_lints};
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_interface::interface;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGroup};
|
||||
|
|
@ -178,7 +178,7 @@ pub fn main() {
|
|||
|
||||
let exit_code = rustc_driver::catch_with_exit_code(|| match get_args() {
|
||||
Some(args) => main_args(&args),
|
||||
_ => Err(ErrorReported),
|
||||
_ => Err(ErrorGuaranteed),
|
||||
});
|
||||
process::exit(exit_code);
|
||||
}
|
||||
|
|
@ -671,7 +671,7 @@ fn usage(argv0: &str) {
|
|||
}
|
||||
|
||||
/// A result type used by several functions under `main()`.
|
||||
type MainResult = Result<(), ErrorReported>;
|
||||
type MainResult = Result<(), ErrorGuaranteed>;
|
||||
|
||||
fn main_args(at_args: &[String]) -> MainResult {
|
||||
let args = rustc_driver::args::arg_expand_all(at_args);
|
||||
|
|
@ -691,7 +691,7 @@ fn main_args(at_args: &[String]) -> MainResult {
|
|||
// codes from `from_matches` here.
|
||||
let options = match config::Options::from_matches(&matches) {
|
||||
Ok(opts) => opts,
|
||||
Err(code) => return if code == 0 { Ok(()) } else { Err(ErrorReported) },
|
||||
Err(code) => return if code == 0 { Ok(()) } else { Err(ErrorGuaranteed) },
|
||||
};
|
||||
rustc_interface::util::run_in_thread_pool_with_globals(
|
||||
options.edition,
|
||||
|
|
@ -705,7 +705,7 @@ fn wrap_return(diag: &rustc_errors::Handler, res: Result<(), String>) -> MainRes
|
|||
Ok(()) => Ok(()),
|
||||
Err(err) => {
|
||||
diag.struct_err(&err).emit();
|
||||
Err(ErrorReported)
|
||||
Err(ErrorGuaranteed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue