Repository navigation
Generate internal compiler errors instead of panicking - #7450
Merged
Merged
Conversation
laurmaedje
reviewed
Nov 24, 2025
Member
There was a problem hiding this comment.
It would be nice if the error had a precise line/column number regardless of the backtrace like panics do. if the backtrace API can't do that in release, I suppose a macro still could with file!() and line!(). though that would only nicely work for the assert variant, not for the expect variant.
saecki
force-pushed
the
internal-compiler-errors
branch
from
November 24, 2025 20:02
ee90f65 to
4f517b6
Compare
Member
Author
|
Using |
istudyatuni
reviewed
Nov 24, 2025
saecki
force-pushed
the
internal-compiler-errors
branch
3 times, most recently
from
November 24, 2025 20:45
7a415f1 to
d6d1bf4
Compare
Member
|
The Windows tests strike again, c.f. #6433 (comment) |
saecki
force-pushed
the
internal-compiler-errors
branch
from
November 25, 2025 13:18
d6d1bf4 to
f8a6e08
Compare
saecki
force-pushed
the
internal-compiler-errors
branch
from
November 25, 2025 20:21
f8a6e08 to
86ed797
Compare
laurmaedje
force-pushed
the
internal-compiler-errors
branch
2 times, most recently
from
November 26, 2025 16:56
01a1c60 to
0e18cc1
Compare
laurmaedje
enabled auto-merge
November 26, 2025 16:57
laurmaedje
disabled auto-merge
November 26, 2025 16:59
laurmaedje
reviewed
Nov 26, 2025
These barely add value, but I just don't like the look of bare items!
saecki
force-pushed
the
internal-compiler-errors
branch
from
November 26, 2025 17:59
0e18cc1 to
4da3fd0
Compare
saecki
force-pushed
the
internal-compiler-errors
branch
from
November 26, 2025 18:01
4da3fd0 to
575e208
Compare
laurmaedje
added a commit
that referenced
this pull request
Dec 2, 2025
Co-Authored-By: Laurenz <[email protected]>
Dikluwe
pushed a commit
to Dikluwe/typst-crystalline
that referenced
this pull request
Sep 12, 2026
Co-authored-by: Laurenz <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid crashes: #7301 #7257
But proper fixes are still outstanding.
This adds some utilities to generate internal compiler errors instead of panicking. These errors can capture a stack trace which is nice for debugging. Generating a backtrace is only attempted when
debug_assertionsare enabled and whenRUST_BACKTRACEis set. In release mode debug symbols are stripped anyway, so the backtrace only displays addresses.The backtrace isn't captured using
Backtrace::force_capture, because the paths in the backtrace are absolute and thus machine dependent, I experimented with sanitizing the paths, but that was somewhat hacky since there is no proper API to access the individual frames.