Skip to content

Commit

Permalink
Replace uses of constraint and restriction in attributes chapters.
Browse files Browse the repository at this point in the history
  • Loading branch information
chorman0773 committed Sep 26, 2024
1 parent e77f4e6 commit e579b2a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/attributes/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ 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_feature.restriction-inline]
r[attributes.codegen.target_feature.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
4 changes: 2 additions & 2 deletions src/attributes/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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.

r[attributes.debugger.debugger_visualizer.restriction]
r[attributes.debugger.debugger_visualizer.syntax]
It uses the [_MetaListNameValueStr_] syntax to specify its inputs, and must be specified as a crate attribute.

### Using `debugger_visualizer` with Natvis
Expand All @@ -23,7 +23,7 @@ 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.msvc]
This attribute only supports embedding Natvis files on `-windows-msvc` targets.

r[attributes.debugger.debugger_visualizer.natvis.path]
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ r[attributes.diagnostic.on_unimplemented]
r[attributes.diagnostic.on_unimplemented.intro]
The `#[diagnostic::on_unimplemented]` attribute is a hint to the compiler to supplement the error message that would normally be generated in scenarios where a trait is required but not implemented on a type.
r[attributes.diagnostic.on_unimplemented.restriction]
r[attributes.diagnostic.on_unimplemented.application]
The attribute should be placed on a [trait declaration], though it is not an error to be located in other positions.
r[attributes.diagnostic.on_unimplemented.syntax]
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ r[attributes.limits.type_length_limit.intro]
The *`type_length_limit` attribute* limits the maximum number of type
substitutions made when constructing a concrete type during monomorphization.

r[attributes.limits.type_length_limit.restriction]
r[attributes.limits.type_length_limit.syntax]
It is applied at the [crate] level, and uses the [_MetaNameValueStr_] syntax
to set the limit based on the number of type substitutions.

Expand Down
4 changes: 2 additions & 2 deletions src/attributes/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The *`test` attribute* marks a function to be executed as a test.
r[attributes.testing.test.enabled]
These functions are only compiled when in test mode.

r[attributes.testing.test.restriction]
r[attributes.testing.test.target]
Test functions must be free, monomorphic functions that take no arguments, and the return type must implement the [`Termination`] trait, for example:

* `()`
Expand Down Expand Up @@ -80,7 +80,7 @@ fn mytest() {

r[attributes.testing.should_panic]

r[attributes.testing.should_panic.restriction]
r[attributes.testing.should_panic.target]
A function annotated with the `test` attribute that returns `()` can also be
annotated with the `should_panic` attribute.

Expand Down
2 changes: 1 addition & 1 deletion src/attributes/type_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ r[attributes.type-system.non_exhaustive.intro]
The *`non_exhaustive` attribute* indicates that a type or variant may have
more fields or variants added in the future.

r[attributes.type-system.non_exhaustive.restriction]
r[attributes.type-system.non_exhaustive.application]
It can be applied to [`struct`s][struct], [`enum`s][enum], and `enum` variants.

r[attributes.type-system.non_exhaustive.syntax]
Expand Down

0 comments on commit e579b2a

Please sign in to comment.