You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The *`collapse_debuginfo`[attribute]* controls whether code locations from a macro definition are collapsed into a single location associated with the macro's call site, when generating debuginfo for code calling this macro.
159
+
The *`collapse_debuginfo`[attribute]* controls whether code locations from a macro definition are collapsed into a single location associated with the macro's call site when generating debuginfo for code calling this macro.
159
160
160
161
> [!EXAMPLE]
161
162
> ```rust
@@ -167,9 +168,7 @@ The *`collapse_debuginfo` [attribute]* controls whether code locations from a ma
<!--TODO:Ithinkitwouldbenicetoextendthistoexplainalittlemoreaboutwhythisisuseful, andthekindsofscenarioswhereyouwouldwantonevstheother.Seehttps://github.com/rust-lang/rfcs/pull/2117 for some guidance. -->
The `collapse_debuginfo` attribute may only be specified once on a macro.
191
+
The `collapse_debuginfo` attribute may used only once on a macro.
193
192
194
193
r[attributes.debugger.collapse_debuginfo.options]
195
-
Accepted options:
196
-
-`#[collapse_debuginfo(yes)]` --- code locations in debuginfo are collapsed.
197
-
-`#[collapse_debuginfo(no)]` --- code locations in debuginfo are not collapsed.
198
-
-`#[collapse_debuginfo(external)]` --- code locations in debuginfo are collapsed only if the macro comes from a different crate.
194
+
The `collapse_debuginfo` attribute accepts these options:
195
+
196
+
-`#[collapse_debuginfo(yes)]` --- Code locations in debuginfo are collapsed.
197
+
-`#[collapse_debuginfo(no)]` --- Code locations in debuginfo are not collapsed.
198
+
-`#[collapse_debuginfo(external)]` --- Code locations in debuginfo are collapsed only if the macro comes from a different crate.
199
199
200
200
r[attributes.debugger.collapse_debuginfo.default]
201
-
The `external` behavior is the default for macros that don't have this attribute, unless they are built-in macros. For built-in macros the default is `yes`.
201
+
The `external` behavior is the default for macros that don't have this attribute unless they are built-in macros. For built-in macros the default is `yes`.
202
202
203
203
> [!NOTE]
204
-
> `rustc` has a [`-C collapse-macro-debuginfo`] CLI option to override both the default collapsing behavior and `#[collapse_debuginfo]` attributes.
204
+
> `rustc` has a [`-C collapse-macro-debuginfo`] CLI option to override both the default behavior and the values of any`#[collapse_debuginfo]` attributes.
0 commit comments