diff options
| author | bors <bors@rust-lang.org> | 2022-03-18 00:35:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-18 00:35:19 +0000 |
| commit | cd119057160cedea245aa2679add56723f3dc784 (patch) | |
| tree | 21335c52669bb2665024cf37adf8d892925d9d31 /compiler/rustc_interface/src | |
| parent | 4ca56d2b7bbe275bc6c9f3cd698c6e0719a07182 (diff) | |
| parent | 4493826d07bf38cca058b4d9e75bce14ceeeaab9 (diff) | |
| download | rust-cd119057160cedea245aa2679add56723f3dc784.tar.gz rust-cd119057160cedea245aa2679add56723f3dc784.zip | |
Auto merge of #95056 - Dylan-DPC:rollup-swtuw2n, r=Dylan-DPC
Rollup of 10 pull requests
Successful merges:
- #91133 (Improve `unsafe` diagnostic)
- #93222 (Make ErrorReported impossible to construct outside `rustc_errors`)
- #93745 (Stabilize ADX target feature)
- #94309 ([generator_interior] Be more precise with scopes of borrowed places)
- #94698 (Remove redundant code from copy-suggestions)
- #94731 (Suggest adding `{ .. }` around a const function call with arguments)
- #94960 (Fix many spelling mistakes)
- #94982 (Add deprecated_safe feature gate and attribute, cc #94978)
- #94997 (debuginfo: Fix ICE when generating name for type that produces a layout error.)
- #95000 (Fixed wrong type name in comment)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 26 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 7 |
2 files changed, 16 insertions, 17 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 1aceb4e95e6..4f30e78f5e2 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -373,7 +373,7 @@ pub fn configure_and_expand( if recursion_limit_hit { // If we hit a recursion limit, exit early to avoid later passes getting overwhelmed // with a large AST - Err(ErrorGuaranteed) + Err(ErrorGuaranteed::unchecked_claim_error_was_emitted()) } else { Ok(krate) } @@ -413,7 +413,7 @@ pub fn configure_and_expand( ); msg.warn("The generated documentation may be incorrect"); - msg.emit() + msg.emit(); } else { krate = sess.time("maybe_create_a_macro_crate", || { let is_test_crate = sess.opts.test; @@ -742,29 +742,30 @@ pub fn prepare_outputs( if let Some(ref input_path) = compiler.input_path { if sess.opts.will_create_output_file() { if output_contains_path(&output_paths, input_path) { - sess.err(&format!( + let reported = sess.err(&format!( "the input file \"{}\" would be overwritten by the generated \ executable", input_path.display() )); - return Err(ErrorGuaranteed); + return Err(reported); } if let Some(dir_path) = output_conflicts_with_dir(&output_paths) { - sess.err(&format!( + let reported = sess.err(&format!( "the generated executable for the input file \"{}\" conflicts with the \ existing directory \"{}\"", input_path.display(), dir_path.display() )); - return Err(ErrorGuaranteed); + return Err(reported); } } } if let Some(ref dir) = compiler.temps_dir { if fs::create_dir_all(dir).is_err() { - sess.err("failed to find or create the directory specified by `--temps-dir`"); - return Err(ErrorGuaranteed); + let reported = + sess.err("failed to find or create the directory specified by `--temps-dir`"); + return Err(reported); } } @@ -776,8 +777,9 @@ pub fn prepare_outputs( if !only_dep_info { if let Some(ref dir) = compiler.output_dir { if fs::create_dir_all(dir).is_err() { - sess.err("failed to find or create the directory specified by `--out-dir`"); - return Err(ErrorGuaranteed); + let reported = + sess.err("failed to find or create the directory specified by `--out-dir`"); + return Err(reported); } } } @@ -987,8 +989,8 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { // lot of annoying errors in the ui tests (basically, // lint warnings and so on -- kindck used to do this abort, but // kindck is gone now). -nmatsakis - if sess.has_errors() { - return Err(ErrorGuaranteed); + if let Some(reported) = sess.has_errors() { + return Err(reported); } sess.time("misc_checking_3", || { diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index d0e533b4571..6373f4e9af1 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -5,7 +5,6 @@ use rustc_ast as ast; use rustc_codegen_ssa::traits::CodegenBackend; use rustc_data_structures::svh::Svh; use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal}; -use rustc_errors::ErrorGuaranteed; use rustc_hir::def_id::LOCAL_CRATE; use rustc_incremental::DepGraphFuture; use rustc_lint::LintStore; @@ -121,10 +120,8 @@ impl<'tcx> Queries<'tcx> { pub fn parse(&self) -> Result<&Query<ast::Crate>> { self.parse.compute(|| { - passes::parse(self.session(), &self.compiler.input).map_err(|mut parse_error| { - parse_error.emit(); - ErrorGuaranteed - }) + passes::parse(self.session(), &self.compiler.input) + .map_err(|mut parse_error| parse_error.emit()) }) } |
