| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
This allows us to remove `static_panic_msg` from the SSA<->LLVM
boundary, along with its fat pointer representation for &str.
Also changes the signature of PanicInfo::internal_contructor to
avoid copying.
Closes #65856.
|
|
|
|
https://github.com/rust-lang/rust/issues/65721
|
|
|
|
rewrite documentation for unimplemented! to clarify use
The current docs for `unimplemented!` seem to miss the point of this macro.
> This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.
You could also return a `()` if you just want your code to type-check.
I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area.
I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.
|
|
|
|
Stabilize todo macro
The `todo!` macro is just another name for `unimplemented!`.
Tracking issue: https://github.com/rust-lang/rust/issues/59277
This PR needs a FCP to merge.
r? @withoutboats
|
|
|
|
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently
requires a submodule update of `stdarch` to fix a problem with previous
compilers.
|
|
Use it for feature-gating `#[bench]`
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
All transparancies are passed explicitly now.
Also remove `#[rustc_macro_transparency]` annotations from built-in macros, they are no longer used.
`#[rustc_macro_transparency]` only makes sense for declarative macros now.
|
|
|
|
|
|
|
|
|
|
|
|
Remove gensym in format_args
This also fixes some things to allow us to export opaque macros from libcore:
* Don't consider items that are only reachable through opaque macros as public/exported (so they aren't linted as needing docs)
* Mark private items reachable from the root of libcore as unstable - they are now reachable (in principle) in other crates via macros in libcore
r? @petrochenkov
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
|
|
Fixes #63375
|
|
|
|
More questionmarks in doctests
This removes the other `unwrap`s in the macro doctests, replacing them with `?`. For now, we need to specify the main function including the return type, we can get rid of that once the return type suggestion for `fn main() { .. }` works correctly.
r? @QuietMisdreavus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The expansions were created to allow unstable things inside `#[test_case/test/bench]`, but that's not a proper way to do that.
Put the required `allow_internal_unstable`s into the macros' properties instead.
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
TIL that debug_assert is implemented using `if cfg!(debug_assertions)`
rather than `#[cfg(debug_assertions)]`. This means one can not use API
gated with `#[cfg(debug_assertions)]` in `debug_assert` family of
macros.
|
|
First question mark in doctest
We have had `?` for `Result`s in doctests for some time, but so far haven't used them in doctests. With this PR, I want to start the de-`unwrap`ping of doctests – and the discussion on where to do so.
There is one downside, which is that the code can no longer be copied into a plain `main()` method, on the other hand, there should be a workable error if one does this.
|
|
|
|
|
|
|
|
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
kleene operator as its binder in the left-hand side. Either it does not repeat
enough, or it uses a different operator somewhere.
This change should have no semantic impact.
|
|
|
|
|
|
|
|
|
|
Use consistent phrasing for all macro summaries
None
|
|
|
|
uninitialized -> uninit
into_initialized -> assume_init
read_initialized -> read
set -> write
|
|
The use-case of `todo!()` macro is to be a much easier to type
alternative to `unimplemented!()` macro.
|