mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-08 08:07:53 -10:00
Leave function ends to #6821's zero return
The text rewrite appended `return T(0);` to every value-returning function, which doesn't compile for a struct type (`S(0)`). Main's #6821 gives naga's added end returns the result type's ZeroValue, structs included; this PR's early-return test passes on it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
dc3fc4c8c4
commit
3ce797f378
1 file changed
-5
@@ -237,11 +237,6 @@ impl Stage<'_> {
|
||||
depth -= 1;
|
||||
hidden.retain(|&(_, _, d)| d <= depth);
|
||||
if depth == 0 {
|
||||
if let Some(ty) = returns {
|
||||
out.push_str(" return ");
|
||||
out.push_str(ty);
|
||||
out.push_str("(0); ");
|
||||
}
|
||||
params.clear();
|
||||
hidden.clear();
|
||||
returns = None;
|
||||
|
||||
Reference in new issue
Block a user