| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Remove some unneeded imports / qualified paths
Continuation of #105537.
|
|
Fix typos in library
I ran [`typos -w library`](https://github.com/crate-ci/typos) to fix typos in the `library` directory.
Refs #110150
|
|
Use `Display` in top-level example for `PanicInfo`
Addresses https://github.com/rust-lang/rust/issues/110098.
This confused me as well, when I was writing a `no_std` panic handler for the first time, so here's a better top-level example.
`Display` is stable, prints the `.message()` if available, and falls back to `.payload().downcast_ref<&str>()` if the message is not available. So this example should provide strictly more information and also work for formatted panics.
The old example still exists on the `payload` method.
|
|
Add links from `core::cmp` derives to their traits
Fixes #109946
Adds intra-doc links from the `core::cmp` derives to their respective traits, and a link to their derive behaviour
`@rustbot` label +A-docs
|
|
Add `tidy-alphabetical` to features in `core`
So that people have to keep them sorted in future, rather than just sticking them on the end where they conflict more often.
|
|
Add better assert messages for f32/f64 clamps
|
|
r=compiler-errors
Improve safe transmute error reporting
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason.
Also, fix some small bugs that occur when computing the `Answer` for transmutability.
|
|
This patch updates the error reporting when Safe Transmute is not
possible between 2 types by including the reason.
Also, fix some small bugs that occur when computing the `Answer` for
transmutability.
|
|
Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented
I made a PR earlier, but accidentally renamed a branch and that deleted the PR... sorry for the duplicate
Currently, if an operation on `Pin<T>` is performed that requires `T` to implement `Unpin`, the diagnostic suggestion is to use `Box::pin` ("note: consider using `Box::pin`").
This PR suggests pin! as well, as that's another valid way of pinning a value, and avoids a heap allocation. Appropriate diagnostic suggestions were included to highlight the difference in semantics (local pinning for pin! vs non-local for Box::pin).
Fixes #109964
|
|
Make rust-intrinsic ABI unwindable
Fix #104451, fix https://github.com/rust-lang/miri/issues/2839
r? `@RalfJung`
|
|
|
|
So that people have to keep them sorted in future.
|
|
Typo in the documentation.
|
|
implemented
|
|
|
|
Custom MIR: Support `BinOp::Offset`
Since offset doesn't have an infix operator, a new function `Offset` is added which is lowered to `Rvalue::BinaryOp(BinOp::Offset, ..)`
r? ```@oli-obk``` or ```@tmiasko``` or ```@JakobDegen```
|
|
Stick `#[rustc_nounwind]` to all except `const_eval_select` to undo the
change for all other intrinsics.
|
|
Reword the docstring in todo! macro definition, fixing a typo
|
|
|
|
|
|
The `wrapping_neg` example for unsigned types shouldn't use `i8`
Probably it should have at least one example with an unsigned type.
|
|
|
|
Improve the floating point parser in dec2flt.
Greetings everyone,
I've benn studying the rust floating point parser recently and made the following tweaks:
* Remove all remaining traces of `unsafe`. The parser is now 100% safe Rust.
* The trick in which eight digits are processed in parallel is now in a loop.
* Parsing of inf/NaN values has been reworked.
On my system, the changes result in performance improvements for some input values.
|
|
Avoid some manual slice length calculation
No need for us to write the multiplication when `size_of_val` does exactly what we need.
(https://github.com/rust-lang/rust-clippy/pull/10601)
|
|
* Remove all remaining traces of unsafe.
* Put `parse_8digits` inside a loop.
* Rework parsing of inf/NaN values.
|
|
Revert #104100, Allow using `Range` as an `Iterator` in const contexts.
This fixes #109632.
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #110058 (Remove `box_syntax` usage)
- #110059 (ignore_git → omit_git_hash)
- #110060 (Document that `&T` and `&mut T` are `Sync` if `T` is)
- #110074 (Make the "codegen" profile of `config.toml` download and build llvm from source.)
- #110086 (Add `max_line_length` to `.editorconfig`, matching rustfmt)
- #110096 (Tweak tuple indexing suggestion)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Document that `&T` and `&mut T` are `Sync` if `T` is
Proof: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fec8dc9ec36e873bf2962a2367d67045
|
|
|
|
This reverts commit 7bc67ef6e02d69023c6fb04c2258beab54ac22b8.
|
|
rustc_do_not_const_check, implement const Iterator and DoubleEndedIterator for Range."
This reverts commit 8a9d6bf4fd540b2a2882193cbd6232b86e5dcd7e.
|
|
|
|
@rustbot label +A-docs
r? docs
|
|
|
|
No need for us to write the multiplication when `size_of_val` does exactly what we need.
|
|
To avoid link time dependency between core and compiler-builtins, when
using opt-level that implicitly enables -Zshare-generics.
While compiler-builtins should be compiled with -Zshare-generics
disabled, the -Zbuild-std does not ensure this at the moment.
|
|
|
|
Document NonZeroXxx layout guarantees
Document that `NonZeroXxx` has the same layout and bit validity as `Xxx` with the exception of `0`.
|
|
|
|
`UnsafeCell` page could benefit too from having links to these most popular structs in the module.
|
|
Improve grammar of Iterator.partition_in_place
This is my first PR against Rust, please let me know if there's anything I should be providing here! I didn't find any instructions specific to documentation grammar in the [std-dev guide](https://std-dev-guide.rust-lang.org/documentation/summary.html).
|
|
Optimize `LazyCell` size
`LazyCell` can only store either the initializing function or the data it produces, so it does not need to reserve the space for both. Similar to #107329, but uses an `enum` instead of a `union`.
|
|
b9535c0b7d6 Auto merge of #109801 - aliemjay:test-implied-normalization, r=petrochenkov
|
|
Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`
Fixes #88070.
It's been a while since this was turned into a "future incompatible lint" so I think we can now turn it into a hard error without problem.
r? `@jyn514`
|
|
Insert alignment checks for pointer dereferences when debug assertions are enabled
Closes https://github.com/rust-lang/rust/issues/54915
- [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit)
- [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue!
- [x] Implement a more helpful panic message like slice bounds checking.
r? `@oli-obk`
|
|
|
|
|