forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#81015 - jyn514:feature-gate-ptr, r=camelid
Feature-gate `pointer` and `reference` in intra-doc links r? `@camelid` Addresses (but does not close) rust-lang#80896.
- Loading branch information
Showing
10 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/doc/unstable-book/src/language-features/intra-doc-pointers.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# `intra-doc-pointers` | ||
|
||
The tracking issue for this feature is: [#80896] | ||
|
||
[#80896]: https://github.com/rust-lang/rust/issues/80896 | ||
|
||
------------------------ | ||
|
||
Rustdoc does not currently allow disambiguating between `*const` and `*mut`, and | ||
raw pointers in intra-doc links are unstable until it does. | ||
|
||
```rust | ||
#![feature(intra_doc_pointers)] | ||
//! [pointer::add] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! [pointer::add] | ||
//~^ ERROR: experimental | ||
//! [pointer::wrapping_add] | ||
//~^ ERROR: experimental | ||
//! [pointer] // This is explicitly allowed | ||
//! [reference] // This is explicitly allowed |
23 changes: 23 additions & 0 deletions
23
src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error[E0658]: linking to associated items of raw pointers is experimental | ||
--> $DIR/feature-gate-intra-doc-pointers.rs:1:6 | ||
| | ||
LL | //! [pointer::add] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: see issue #80896 <https://github.com/rust-lang/rust/issues/80896> for more information | ||
= help: add `#![feature(intra_doc_pointers)]` to the crate attributes to enable | ||
= note: rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does | ||
|
||
error[E0658]: linking to associated items of raw pointers is experimental | ||
--> $DIR/feature-gate-intra-doc-pointers.rs:3:6 | ||
| | ||
LL | //! [pointer::wrapping_add] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #80896 <https://github.com/rust-lang/rust/issues/80896> for more information | ||
= help: add `#![feature(intra_doc_pointers)]` to the crate attributes to enable | ||
= note: rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters