Repository navigation
Conversation
Contributor
Author
|
The I did look at what Naga does, but Naga doesn't do anything useful in this case https://docs.rs/naga/latest/src/naga/valid/type.rs.html#114-115 . |
stefnotch
force-pushed
the
interner
branch
4 times, most recently
from
September 19, 2026 21:00
2100d7b to
cbd2b80
Compare
stefnotch
marked this pull request as ready for review
September 21, 2026 09:12
k2d222
reviewed
Sep 23, 2026
k2d222
left a comment
Collaborator
There was a problem hiding this comment.
incomplete review pass. Will finish review later :)
overall it looks promising, didn't see anything wrong with it.
Comment on lines
+467
to
+468
| _sourcemap: Option<&impl SourceMap>, | ||
| _mangler: Option<&impl Mangler>, |
Collaborator
There was a problem hiding this comment.
dont' need underscores I think
| match self { | ||
| Type::Struct(ty) => ty, | ||
| val => panic!("called `Type::unwrap_struct()` on a `{val}` value"), | ||
| val => panic!("called `Type::unwrap_struct()` on a `{val:?}` value"), |
Collaborator
There was a problem hiding this comment.
can we implement Display for Type with a fallback string for if it requires the arena? Looks like only struct types need the arena.
stefnotch
force-pushed
the
interner
branch
2 times, most recently
from
October 25, 2026 14:31
8fb6849 to
babddd2
Compare
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.
Adds interning to wesl-rs. It's split into smaller commits that should be easier to review.
It first adds an
ArenaandUniqueArena. They're based on the ones in naga. TheArenaisn't actually used.This also meant adding the dependencies for #292 .
Then it adds a
TyContext, which holds theUniqueArena<StructType>everywhere where it will be needed.In the next step, it actually starts using the
TyContext.And finally, it updates the printing stuff. Turns out that printing types now depends on the
TyContext. Which in turn means that error messages depend on theTyContext.While doing that final step, I also separated the
ErrorandDiagnostic<E>types a bit better. There's no reason to allow a recursive tree ofError::Error(Diagnostic { another error with a diagnostic with another error with a diagnostic ... })