diff options
| author | Michael Goulet <michael@errs.io> | 2023-07-27 18:51:44 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-07-27 18:51:44 +0000 |
| commit | d45eb41c500e35bd4ac155b1b49e0920c746abfc (patch) | |
| tree | 43fa899f6a6c6dc7bf53965286415bfb440b84fa | |
| parent | 77fa702b639f941aab7462ca6e3562f793f54fef (diff) | |
| download | rust-d45eb41c500e35bd4ac155b1b49e0920c746abfc.tar.gz rust-d45eb41c500e35bd4ac155b1b49e0920c746abfc.zip | |
Dont report CTFE errors that are due to references-error layouts
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/error.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index ffeff8d079a..d39a7e8a192 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -138,7 +138,10 @@ where err_inval!(Layout(LayoutError::Unknown(_))) | err_inval!(TooGeneric) => { ErrorHandled::TooGeneric } - err_inval!(AlreadyReported(error_reported)) => ErrorHandled::Reported(error_reported), + err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar), + err_inval!(Layout(LayoutError::ReferencesError(guar))) => { + ErrorHandled::Reported(guar.into()) + } err_inval!(Layout(layout_error @ LayoutError::SizeOverflow(_))) => { // We must *always* hard error on these, even if the caller wants just a lint. // The `message` makes little sense here, this is a more serious error than the |
