Commit Graph

114 Commits

Author SHA1 Message Date
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 - fee1-dead-contrib:derive_const, r=oli-obk
Add the `#[derive_const]` attribute

Closes . 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
Amanieu d'Antras
56074b5231 Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` ().
2022-10-31 16:32:57 +00:00
Deadbeef
a052f2cce1 Add the #[derive_const] attribute 2022-09-20 11:57:58 +00:00
Jay3332
ba3b3bcc17
Fix typo in concat_bytes documentation
This fixes the typo `&[u8, _]` -> `&[u8; _]`
2022-09-12 21:40:28 -04:00
Martin Geisler
e10ab62690 Link “? operator” to relevant chapter in The Book
Before, the text simply asked people to use a symbol which is hard to
search for. Now the text links back to the chapter on error
propagation in The Book. That should help people find the relevant
keywords for further searches.
2022-08-31 11:01:49 +02:00
Josh Triplett
ae937cc347 Clarify comment to fit as _ better 2022-08-25 00:22:40 +02:00
Josh Triplett
589db1f73a Expand example to show how to implement qualified trait names 2022-08-24 15:38:21 +02:00
Josh Triplett
3c8618fd82 Update write! docs: can now import traits as _ to avoid conflicts 2022-08-24 14:42:25 +02:00
Josh Triplett
a7886506ad Remove some documentation duplicated between writeln! and write!
`writeln!` already includes a reference to `write!` for more
information, so remove duplicated information.
2022-08-24 14:41:22 +02:00
David Tolnay
f1ca69d245
Revert write! and writeln! to late drop temporaries 2022-07-24 11:12:00 -07:00
Jane Lusby
0715616b51 add rt flag to allowed internal unstable for RustcEncodable/Decodable 2022-07-08 21:18:15 +00:00
est31
97519bd202 Grammar fix in the compile_error documentation 2022-06-09 12:40:10 +02:00
David Tolnay
0502496b1e
Make write/print macros eagerly drop temporaries 2022-05-22 16:11:08 -07:00
bors
8a2fe75d0e Auto merge of - jhpratt:remove-rustc_deprecated, r=compiler-errors
Remove `#[rustc_deprecated]`

This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires , which includes converting `stdarch`.

I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
2022-05-09 04:47:30 +00:00
Vadim Petrochenkov
6083db7c4e Fix some links in the standard library 2022-05-01 00:02:34 +03:00
Jacob Pratt
4fbe73e0b7
Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
Jane Lusby
aa3c141c86 reword panic vs result section to remove recoverable vs unrecoverable framing 2022-04-07 13:44:57 -07:00
Dylan DPC
a2df05d4d5
Rollup merge of - mgeisler:mention-std-env-var, r=Dylan-DPC
Mention `std::env::var` in `env!`

When searching for how to read an environment variable, I first encountered the `env!` macro. It would have been useful to me if the documentation had included a link to `std::env::var`, which is what I was actually looking for.
2022-04-07 06:04:52 +02:00
Martin Geisler
4f08d75375 Mention std::env::var in env!
When searching for how to read an environment variable, I first encountered the `env!` macro. It would have been useful to me if the documentation had included a link to `std::env::var`, which is what I was actually looking for.
2022-04-06 14:23:42 +02:00
Jane Lusby
ccb704c73d Update panic docs to make it clearer when to use panic vs Result 2022-04-04 16:09:49 -07:00
David Tolnay
af53809c87
Format core and std macro rules, removing needless surrounding blocks 2022-03-11 15:26:51 -08:00
T-O-R-U-S
72a25d05bf Use implicit capture syntax in format_args
This updates the standard library's documentation to use the new syntax. The
documentation is worthwhile to update as it should be more idiomatic
(particularly for features like this, which are nice for users to get acquainted
with). The general codebase is likely more hassle than benefit to update: it'll
hurt git blame, and generally updates can be done by folks updating the code if
(and when) that makes things more readable with the new format.

A few places in the compiler and library code are updated (mostly just due to
already having been done when this commit was first authored).
2022-03-10 10:23:40 -05:00
Mark Rousskov
22c3a71de1 Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
yuhaixin.hx
daa3c795dc add link to format_args! when being mentioned in doc 2022-02-12 12:35:30 +08:00
Loïc BRANSTETT
565710b33c Fix invalid special casing of the unreachable! macro 2022-01-31 17:09:31 +01:00
Pietro Albini
5b3462c556
update cfg(bootstrap)s 2022-01-28 15:01:07 +01:00
bors
a34c079752 Auto merge of - tmiasko:rm-llvm-asm, r=Amanieu
Remove deprecated LLVM-style inline assembly

The `llvm_asm!` was deprecated back in  1.56.0, with intention to remove
it once `asm!` was stabilized, which already happened in  1.59.0. Now it
is time to remove `llvm_asm!` to avoid continued maintenance cost.

Closes .
Closes .
Closes .
Closes .

cc `@rust-lang/wg-inline-asm`

r? `@Amanieu`
2022-01-17 09:40:29 +00:00
Tomasz Miąsko
000b36c505 Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
Alex Macleod
7ea03db04a Add diagnostic items for macros 2022-01-06 14:59:33 +00:00
Daniel Henry-Mantilla
f20ccc0748 Make the documentation of builtin macro attributes accessible
- Do not `#[doc(hidden)]` the `#[derive]` macro attribute

  - Add a link to the reference section to `derive`'s inherent docs

  - Do the same for `#[test]` and `#[global_allocator]`

  - Fix `GlobalAlloc` link (why is it on `core` and not `alloc`?)

  - Try `no_inline`-ing the `std` reexports from `core`

  - Revert "Try `no_inline`-ing the `std` reexports from `core`"

  - Address PR review

  - Also document the unstable macros
2022-01-03 20:43:16 +01:00
Matthias Krüger
c9cc9e589c
Rollup merge of - ecstatic-morse:std-column-unicode, r=Manishearth
Document units for `std::column`

Fixes .

r? ``@Manishearth`` (for the terminology and the Chinese)
2021-12-28 13:59:26 +01:00
Dylan MacKenzie
3115d8413a Document units for std::column 2021-12-27 15:39:35 -08:00
Mara Bos
ad6ef48dd9 Use panic() instead of panic!() in some places in core. 2021-12-21 10:39:00 +01:00
Smitty
eb56693a37 Implement concat_bytes!
The tracking issue for this is .
2021-12-06 21:05:13 -05:00
Ed Morley
b41b2e5a5c
Document unreachable!() custom panic message
The `unreachable!` docs previously did not mention that there was a second
form, `unreachable!("message")` that could be used to specify a custom panic
message,

The docs now mention this in the same style as currently used for `unimplemented!`:
https://doc.rust-lang.org/core/macro.unimplemented.html#panics
2021-11-11 13:41:21 +00:00
Mara Bos
afe5335b97 Use correct edition for panic in [debug_]assert!() etc. 2021-10-07 14:27:08 +02:00
Mark Rousskov
b4e7649d6d Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
Cameron Steffen
975bc18481 Make Arguments constructors unsafe 2021-08-16 16:28:16 +00:00
Amanieu d'Antras
4dd933cdc2 Deprecate llvm_asm! 2021-08-15 13:14:32 +01:00
bors
24bbf7ac2f Auto merge of - ChayimFriedman2:matches-leading-pipe, r=m-ou-se
Allow leading pipe in `matches!()` patterns.

This is allowed in `match` statement, and stated in https://internals.rust-lang.org/t/leading-pipe-in-core-matches/14699/2 that it should be allowed in these macros too.
2021-08-02 00:13:40 +00:00
Pietro Albini
24f9de5a44 bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00