Skip to content

Commit 180ac4e

Browse files
ehusstraviscross
authored andcommitted
Add a little bit of a description to the example
I considered maybe showing actual debugger output to really cement what it is like, but I'm not sure it is worth taking all that space.
1 parent c012986 commit 180ac4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/attributes/debugger.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ The *`collapse_debuginfo` [attribute]* controls whether code locations from a ma
166166
> };
167167
> }
168168
> ```
169+
>
170+
> When using a debugger, invoking the `example` macro may appear like it is calling a function. That is, when you step to the invocation site, it may show the macro invocation as the next instruction.
171+
>
172+
> Without the `collapse_debuginfo` attribute, the invocation site may behave as-if the macro is expanded in place.
173+
174+
<!-- TODO: I think it would be nice to extend this to explain a little more about why this is useful, and the kinds of scenarios where you would want one vs the other. See https://github.com/rust-lang/rfcs/pull/2117 for some guidance. -->
169175
170176
r[attributes.debugger.collapse_debuginfo.syntax]
171177
The attribute uses the [MetaListIdents] syntax to specify its inputs, and can only be applied to macro definitions.

0 commit comments

Comments
 (0)