Skip to content

Conversation

LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Dec 2, 2024

No description provided.

FractalFir and others added 2 commits December 2, 2024 14:53
…scaping '{' and '}' correctly.

The `debug_printf` and `debug_printfln` passes its format string to the `asm!` macro, which uses `{` and `}` to separate its arguments. Passing `{` and `}` to `asm!` directly is incorrect, and leads to compilation issues:
```
error: invalid asm template string: expected `'}'`, found `'"'`
     --> examples/shaders/sky-shader/src/lib.rs:13016:2
      |
13015 | unsafe{debug_printf!("Variant3{")};
      |        -------------------------- in this macro invocation
13016 |         unsafe{debug_printf!("fld0:")};
      | ----^ expected `'}'` in asm template string
      | |
      | because of this opening brace
      |
      = note: if you intended to print `{`, you can escape it using `{{`
      = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
``` 

This commit escapes those characters using `{{` and `}}`, which removes this issue and produces correct behaviour.
@LegNeato LegNeato merged commit 1932353 into Rust-GPU:main Dec 2, 2024
6 checks passed
@LegNeato LegNeato deleted the ff-whoops branch December 2, 2024 15:22
LegNeato added a commit to LegNeato/rust-gpu that referenced this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants