From 618409901ac354b57e6f3ea9fdbd6c4e88a10ef9 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 5 Dec 2023 12:47:12 +1100 Subject: Fewer early errors. `build_session` is passed an `EarlyErrorHandler` and then constructs a `Handler`. But the `EarlyErrorHandler` is still used for some time after that. This commit changes `build_session` so it consumes the passed `EarlyErrorHandler`, and also drops it as soon as the `Handler` is built. As a result, `parse_cfg` and `parse_check_cfg` now take a `Handler` instead of an `EarlyErrorHandler`. --- compiler/rustc_session/src/errors.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_session/src/errors.rs') diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 70ee46ea902..8a9315dde51 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -444,3 +444,9 @@ pub(crate) struct FunctionReturnRequiresX86OrX8664; #[derive(Diagnostic)] #[diag(session_function_return_thunk_extern_requires_non_large_code_model)] pub(crate) struct FunctionReturnThunkExternRequiresNonLargeCodeModel; + +#[derive(Diagnostic)] +#[diag(session_failed_to_create_profiler)] +pub struct FailedToCreateProfiler { + pub err: String, +} -- cgit 1.4.1-3-g733a5