Skip to content

Commit

Permalink
Apply suggestions from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
chorman0773 committed Sep 10, 2024
1 parent 8fe1a3d commit e77f4e6
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 72 deletions.
8 changes: 4 additions & 4 deletions src/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ r[attributes.syntax]
>       [_DelimTokenTree_]\
>    | `=` [_Expression_]
r[attributes.general]
r[attributes.intro]
An _attribute_ is a general, free-form metadatum that is interpreted according
to name, convention, language, and compiler version. Attributes are modeled
on Attributes in [ECMA-335], with the syntax coming from [ECMA-334] \(C#).
Expand Down Expand Up @@ -109,7 +109,7 @@ fn some_unused_variables() {
r[attributes.meta]


r[attributes.meta.general]
r[attributes.meta.intro]
A "meta item" is the syntax used for the _Attr_ rule by most [built-in
attributes]. It has the following grammar:

Expand Down Expand Up @@ -192,7 +192,7 @@ _MetaListNameValueStr_ | `link(name = "CoreFoundation", kind = "framework")`

r[attributes.activity]

r[attributes.activity.general]
r[attributes.activity.intro]
An attribute is either active or inert. During attribute processing, *active
attributes* remove themselves from the thing they are on while *inert attributes*
stay on.
Expand All @@ -205,7 +205,7 @@ active. All other attributes are inert.

r[attributes.tool]

r[attributes.tool.general]
r[attributes.tool.intro]
The compiler may allow attributes for external tools where each tool resides
in its own module in the [tool prelude]. The first segment of the attribute
path is the name of the tool, with one or more additional segments whose
Expand Down
14 changes: 7 additions & 7 deletions src/attributes/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ have no effect on a trait function without a body.

r[attributes.codgen.inline]

r[attributes.codegen.inline.general]
r[attributes.codegen.inline.intro]
The *`inline` [attribute]* suggests that a copy of the attributed function
should be placed in the caller, rather than generating code to call the
function where it is defined.
Expand Down Expand Up @@ -64,7 +64,7 @@ assumed to exist.
r[attributes.codegen.target_feature]


r[attributes.codegen.target_feature.general]
r[attributes.codegen.target_feature.intro]
The *`target_feature` [attribute]* may be applied to a function to
enable code generation of that function for specific platform architecture
features. It uses the [_MetaListNameValueStr_] syntax with a single key of
Expand All @@ -76,17 +76,17 @@ features. It uses the [_MetaListNameValueStr_] syntax with a single key of
unsafe fn foo_avx2() {}
```

r[attributes.codegen.target_features.arch]
r[attributes.codegen.target_feature.arch]
Each [target architecture] has a set of features that may be enabled. It is an
error to specify a feature for a target architecture that the crate is not
being compiled for.

r[attributes.codegen.target_features.precondition]
r[attributes.codegen.target_feature.precondition]
It is [undefined behavior] to call a function that is compiled with a feature
that is not supported on the current platform the code is running on, *except*
if the platform explicitly documents this to be safe.

r[attributes.codegen.target_features.restriction]
r[attributes.codegen.target_feature.restriction-inline]
Functions marked with `target_feature` are not inlined into a context that
does not support the given features. The `#[inline(always)]` attribute may not
be used with a `target_feature` attribute.
Expand Down Expand Up @@ -361,7 +361,7 @@ otherwise undefined behavior results.

### Behavior

r[attributes.codegen.track_caller.behaviour]
r[attributes.codegen.track_caller.behavior]
Applying the attribute to a function `f` allows code within `f` to get a hint of the [`Location`] of
the "topmost" tracked call that led to `f`'s invocation. At the point of observation, an
implementation behaves as if it walks up the stack from `f`'s frame to find the nearest frame of an
Expand Down Expand Up @@ -443,7 +443,7 @@ And so on.

r[attributes.codegen.track_caller.limits]

r[attributes.codegent.track_caller.hint]
r[attributes.codegen.track_caller.hint]
This information is a hint and implementations are not required to preserve it.

r[attributes.codegen.track_caller.decay]
Expand Down
14 changes: 7 additions & 7 deletions src/attributes/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The following [attributes] are used for enhancing the debugging experience when

r[attributes.debugger.debugger_visualizer]

r[attributes.debugger.debugger_visualizer.general]
r[attributes.debugger.debugger_visualizer.intro]
The *`debugger_visualizer` attribute* can be used to embed a debugger visualizer file into the debug information.
This enables an improved debugger experience for displaying values in the debugger.

Expand All @@ -19,14 +19,14 @@ It uses the [_MetaListNameValueStr_] syntax to specify its inputs, and must be s

r[attributes.debugger.debugger_visualizer.natvis]

r[attributes.debugger.debugger_visualizer.natvis-general]
r[attributes.debugger.debugger_visualizer.natvis.intro]
Natvis is an XML-based framework for Microsoft debuggers (such as Visual Studio and WinDbg) that uses declarative rules to customize the display of types.
For detailed information on the Natvis format, refer to Microsoft's [Natvis documentation].

r[attributes.debugger.debugger_visualizer.natvis-restrictions]
r[attributes.debugger.debugger_visualizer.natvis.restrictions]
This attribute only supports embedding Natvis files on `-windows-msvc` targets.

r[attributes.debugger.debugger_visualizer.natvis-path]
r[attributes.debugger.debugger_visualizer.natvis.path]
The path to the Natvis file is specified with the `natvis_file` key, which is a path relative to the crate source file:

<!-- ignore: requires external files, and msvc -->
Expand Down Expand Up @@ -87,7 +87,7 @@ When viewed under WinDbg, the `fancy_rect` variable would be shown as follows:
r[attributes.debugger.debugger_visualizer.gdb]


r[attributes.debugger.debugger_visualizer.gdb-pretty]
r[attributes.debugger.debugger_visualizer.gdb.pretty]
GDB supports the use of a structured Python script, called a *pretty printer*, that describes how a type should be visualized in the debugger view.
For detailed information on pretty printers, refer to GDB's [pretty printing documentation].

Expand All @@ -97,7 +97,7 @@ There are two ways to enable auto-loading embedded pretty printers:
For more information, see GDB's [auto-loading documentation].
1. Create a file named `gdbinit` under `$HOME/.config/gdb` (you may need to create the directory if it doesn't already exist). Add the following line to that file: `add-auto-load-safe-path path/to/binary`.

r[attributes.debugger.debugger_visualizer.gdb-path]
r[attributes.debugger.debugger_visualizer.gdb.path]
These scripts are embedded using the `gdb_script_file` key, which is a path relative to the crate source file.

<!-- ignore: requires external files -->
Expand Down Expand Up @@ -162,7 +162,7 @@ When the crate's debug executable is passed into GDB[^rust-gdb], `print bob` wil
r[attributes.debugger.collapse_debuginfo]


r[attributes.debugger.collapse_debuginfo.general]
r[attributes.debugger.collapse_debuginfo.intro]
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.

Expand Down
2 changes: 1 addition & 1 deletion src/attributes/derive.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
r[attributes.derive]


r[attributes.derived.general]
r[attributes.derive.intro]
The *`derive` attribute* allows new [items] to be automatically generated for
data structures.

Expand Down
Loading

0 comments on commit e77f4e6

Please sign in to comment.