Commit Graph

154 Commits

Author SHA1 Message Date
ranger-ross
cbf92fcf39 Fixed more typos in library/core 2024-08-31 14:57:38 +09:00
Guillaume Gomez
eeb76ccaf0 Rollup merge of #128240 - mbrubeck:patch-3, r=joboet
Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.

This adds information and links from the docs for the following macros to their debug-only versions:

* `assert_eq!`
* `assert_ne!`
* `assert_matches!`

This matches the existing documentation for the `assert!` macro.
2024-07-28 20:07:46 +02:00
Matt Brubeck
1c64fd3be8 Add links from assert_eq! docs to debug_assert_eq!, etc.
This adds information and links from the docs for the following macros to their debug-only versions:

* `assert_eq!`
* `assert_ne!`
* `assert_matches!`

This matches the existing documentation for the `assert!` macro.
2024-07-26 12:17:10 -07:00
John Arundel
a19472a93e Fix doc nits
Many tiny changes to stdlib doc comments to make them consistent (for example
"Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph
breaks, backticks for monospace style, and other minor nits.

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-26 13:26:33 +01:00
Jubilee
efd8959ab1 Rollup merge of #126096 - c410-f3r:tests-tests-tests, r=jhpratt
[RFC-2011] Allow `core_intrinsics` when activated

Fix #120612
2024-06-06 14:46:25 -07:00
Caio
a8084dcec1 [RFC-2011] Allow core_intrinsics when activated 2024-06-06 16:30:05 -03:00
Mark Rousskov
44988e2577 Workaround rustfmt bug replacing type ascription 2024-05-01 23:23:00 -04:00
Mark Rousskov
a64f941611 Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
beetrees
0bbaa2505b Fix error message for env! when env var is not valid Unicode 2024-04-01 05:44:45 +01:00
Jacob Pratt
2624e9183d Soft-destabilize RustcEncodable/RustcDecodable 2024-03-22 13:24:35 -07:00
Michael Goulet
2d633317f3 Implement macro-based deref!() syntax for deref patterns
Stop using `box PAT` syntax for deref patterns, as it's misleading and
also causes their semantics being tangled up.
2024-03-21 11:42:49 -04:00
Michael Goulet
a015b90953 Make type_ascribe! not a built-in 2024-03-20 22:28:56 -04:00
Ralf Jung
1a2bc1102d Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00
Lukas Bergdoll
c45f0a977a Apply suggestions from code review
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-03-03 15:30:46 +01:00
Lukas Bergdoll
d6438f5266 Apply review comments 2024-03-02 14:07:25 +01:00
Lukas Bergdoll
d2495facb1 Drop link to matches macro and link matches macro to assert_matches. 2024-02-29 09:52:02 +01:00
Lukas Bergdoll
e4781115f2 Improve assert_matches! documentation
This new documentation tries to avoid to limit the impact of the
conceptual pitfall, that the if guard relaxes the constraint, when
really it tightens it. This is achieved by changing the text and
examples. The previous documentation also chose a rather weird and
non-representative example for the if guard, that made it needlessly
complicated to understand.
2024-02-28 11:51:27 +01:00
Matthias Krüger
0238d2619f Rollup merge of #111106 - Stargateur:doc/format_args, r=m-ou-se
Add known issue of let binding to format_args doc

Simply add doc about https://github.com/rust-lang/rust/issues/92698.

 `@rustbot` label +T-rustdoc -T-libs

 r? `@GuillaumeGomez`
2024-02-15 09:20:16 +01:00
Zalathar
6d7e80c5bc Add #[coverage(off)] to closures introduced by #[test]/#[bench] 2024-01-21 23:17:00 +11:00
Miguel Ojeda
18a1ca6a17 core: panic: fix broken link
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-01-09 14:15:45 +01:00
Ralf Jung
af4913fcf4 merge core_panic feature into panic_internals 2023-12-09 14:49:00 +01:00
Thom Chiovoloni
65bec86b42 Add diagnostic items for a few of core's builtin macros 2023-11-04 17:00:51 -07:00
Caio
0b96e479ca Remove cfg_match from the prelude 2023-10-25 09:42:56 -03:00
James Haywood
0c6d279728 Appease tidy 2023-10-02 19:22:42 -04:00
James Haywood
f96cfb533a Adapt todo! documentation to mention displaying custom values
Correct hidden trait in doc test
2023-10-02 19:09:11 -04:00
Caio
d63959f2fa Add the cfg_match! macro 2023-09-23 14:23:51 -03:00
ShE3py
94e651b9b2 Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
Ralf Jung
5016695357 improve panic.md edition disucssion, and nits 2023-08-28 12:11:19 +02:00
Ian Jackson
39c642e3d2 format, format_args: Make xref to std::fmt much more prominent
That xref contains the actual documentation for what format! does.
It should be very prominent - particularly, more so than the other
links.
2023-08-28 11:54:40 +02:00
Ian Jackson
2ec8b6b50f panic macro: Link directly to format syntax, not to format! 2023-08-28 11:52:21 +02:00
Ian Jackson
11167071db panic macro: Document edition differences
Having a section for this inspired by the docs for array::IntoIterator
2023-08-28 11:50:38 +02:00
Arthur Cohen
f1776250eb core: Remove #[macro_export] from debug_assert_matches
The `debug_assert_matches` macro was marked with the `#[macro_export]` attribute,
despite being a declarative macro/macro 2.0, for which the exporting rules are similar
to items. In fact, `#[macro_export]` on a decl macro has no effect on its visibility.
2023-08-07 21:13:55 +02:00
Antoine PLASKOWSKI
cd7c161294 Add known issue of let binding to format_args doc 2023-06-21 16:51:39 +02:00
Pavel Grigorenko
cfe2e4660d Mention env! in option_env!'s docs 2023-06-14 18:29:08 +03:00
Caio
462a96c9e9 [RFC-2011] Expand more expressions 2023-05-24 21:15:50 -03:00
ozkanonur
4e7c14fe9f enable rust_2018_idioms for doctests
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07 00:12:29 +03:00
Josh Soref
9cb9346005 Spelling library/
* advance
* aligned
* borrowed
* calculate
* debugable
* debuggable
* declarations
* desugaring
* documentation
* enclave
* ignorable
* initialized
* iterator
* kaboom
* monomorphization
* nonexistent
* optimizer
* panicking
* process
* reentrant
* rustonomicon
* the
* uninitialized

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-26 02:10:22 -04:00
Patrik Kormosi
4e84d695f3 Reword the docstring in todo! macro definition 2023-04-11 16:29:48 +02:00
Patrik Kormosi
53fa6fe56f Fix typo in todo! macro docstring 2023-04-09 10:38:35 +02:00
Konrad Borowski
dfe4c49e9b Use Edition 2021 :pat in matches macro
This makes the macro syntax used in documentation more readable.
2023-03-06 21:21:06 +01:00
Gijs Burghoorn
ae667be0f6 Remove HTML tags around warning 2023-01-06 13:20:58 +01:00
Gijs Burghoorn
c30f7c9980 Better phrasing for hygiene of include macro 2023-01-05 17:09:11 +01:00
Gijs Burghoorn
eb2980c7f1 Tidy up whitespace 2023-01-04 16:18:34 +01:00
Gijs Burghoorn
0c43b42b0c Improve include macro documentation 2023-01-04 16:07:33 +01:00
Pietro Albini
11191279b7 Update bootstrap cfg 2022-12-28 09:18:43 -05:00
nils
efea79ca80 Gate macros behind #[cfg(not(bootstrap))]
Co-authored-by: Takayuki Maeda <takoyaki0316@gmail.com>
2022-12-01 11:16:18 +01:00
Nilstrieb
6ee0dd97e3 Add unstable type_ascribe macro
This macro serves as a placeholder for future type ascription syntax to
make sure that the semantic implementation keeps working.
2022-11-19 22:16:42 +01:00
Philipp Krones
34a14349b7 Readd the matches_macro diag item
This is now used by Clippy
2022-11-17 19:32:28 +01:00
Maybe Waffle
409c3ce441 Remove unused diagnostic items 2022-11-13 18:49:21 +00:00
Dylan DPC
4b0b89827d Rollup merge of #102049 - fee1-dead-contrib:derive_const, r=oli-obk
Add the `#[derive_const]` attribute

Closes #102371. This is a minimal patchset for the attribute to work. There are no restrictions on what traits this attribute applies to.

r? `````@oli-obk`````
2022-11-12 12:02:50 +05:30