| Age | Commit message (Collapse) | Author | Lines |
|
resolve: Preserve reexport chains in `ModChild`ren
This may be potentially useful for
- avoiding uses of `hir::ItemKind::Use` (which usually lead to correctness issues)
- preserving documentation comments on all reexports, including those from other crates
- preserving and checking stability/deprecation info on reexports
- all kinds of diagnostics
The second commit then migrates some hacky logic from rustdoc to `module_reexports` to make it simpler and more correct.
Ideally rustdoc should use `module_reexports` immediately at the top level, so `hir::ItemKind::Use`s are never used.
The second commit also fixes issues with https://github.com/rust-lang/rust/pull/109330 and therefore
Fixes https://github.com/rust-lang/rust/issues/109631
Fixes https://github.com/rust-lang/rust/issues/109614
Fixes https://github.com/rust-lang/rust/issues/109424
|
|
|
|
|
|
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
|
|
|
|
|
|
Receiver disconnection relies on the incorrect assumption that
`head.index != tail.index` implies that the channel is initialized (i.e
`head.block` and `tail.block` point to allocated blocks). However, it
can happen that `head.index != tail.index` and `head.block == null` at
the same time which leads to a segfault when a channel is dropped in
that state.
This can happen because initialization is performed in two steps. First,
the tail block is allocated and the `tail.block` is set. If that is
successful `head.block` is set to the same pointer. Importantly,
initialization is skipped if `tail.block` is not null.
Therefore we can have the following situation:
1. Thread A starts to send the first value of the channel, observes that
`tail.block` is null and begins initialization. It sets `tail.block`
to point to a newly allocated block and then gets preempted.
`head.block` is still null at this point.
2. Thread B starts to send the second value of the channel, observes
that `tail.block` *is not* null and proceeds with writing its value
in the allocated tail block and sets `tail.index` to 1.
3. Thread B drops the receiver of the channel which observes that
`head.index != tail.index` (0 and 1 respectively), therefore there
must be messages to drop. It starts traversing the linked list from
`head.block` which is still a null pointer, leading to a segfault.
This PR fixes this problem by waiting for initialization to complete
when `head.index != tail.index` and the `head.block` is still null. A
similar check exists in `start_recv` for similar reasons.
Fixes #110001
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #110030 (rustdoc: clean up JS)
- #110037 (rustdoc: add test and bug fix for theme defaults)
- #110065 (Fix wrong type in docs: i16 -> u16)
- #110068 (Temporarily remove myself from reviewers list)
- #110075 (Fix a typo in `config.example.toml`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
This reverts commit 7bc67ef6e02d69023c6fb04c2258beab54ac22b8.
|
|
rustc_do_not_const_check, implement const Iterator and DoubleEndedIterator for Range."
This reverts commit 8a9d6bf4fd540b2a2882193cbd6232b86e5dcd7e.
|
|
enkron:u/enkron/substitute-hardcoded-port-num-in-listen-on-fn, r=the8472
chore(tcp): change a hardcoded port number in a doctest to `port` var
The `listen_on` function in the example has a `port` option but doesn't use it
|
|
|
|
|
|
@rustbot label +A-docs
r? docs
|
|
|
|
|
|
|
|
No need for us to write the multiplication when `size_of_val` does exactly what we need.
|
|
Stabilize is_some_and
This stabilizes the following public API:
```rust
impl<T> Option<T> {
pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool;
}
impl<T, E> Result<T, E> {
pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool;
pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool;
}
```
Closes #93050 (tracking issue).
`@rustbot` label +T-libs-api -T-libs
|
|
Remove an unnecessary `mut` in `BufWriter::into_parts`.
`ptr::read` takes `*const T` so `&mut` is not necessary.
|
|
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.
|
|
Fix buffer overrun in bootstrap and (test-only) symlink_junction
I don't think these can be hit in practice, due to their inputs being valid paths. It's also not security-sensitive code, but just... bad vibes.
I think this is still not really the right way to do this (in terms of path correctness), but is no worse than it was.
r? `@ChrisDenton`
|
|
Workaround #109797 on windows-gnu
The addition of `#[inline]` here in https://github.com/rust-lang/rust/pull/108089 caused an unrelated linking issue (https://github.com/rust-lang/rust/issues/109797). This PR removes this attribute again on Windows to avoid regressions.
|
|
|
|
The `listen_on` function in the example has a `port` option but doesn't
use it
|
|
`ptr::read` takes `*const T` so `&mut` is not necessary.
|
|
|
|
Change core::char::{EscapeUnicode, EscapeDefault and EscapeDebug}
structures from using a state machine to computing escaped sequence
upfront and during iteration just going through the characters.
This is arguably simpler since it’s easier to think about having
a buffer and start..end range to iterate over rather than thinking
about a state machine.
This also harmonises implementation of aforementioned iterators and
core::ascii::EscapeDefault struct. This is done by introducing a new
helper EscapeIterInner struct which holds the buffer and offers simple
methods for iterating over range.
As a side effect, this probably optimises Display implementation for
those types since rather than calling write_char repeatedly, write_str
is invoked once. On 64-bit platforms, it also reduces size of some of
the structs:
| Struct | Before | After |
|----------------------------+--------+-------+
| core::char::EscapeUnicode | 16 | 12 |
| core::char::EscapeDefault | 16 | 12 |
| core::char::EscapeDebug | 16 | 16 |
My ulterior motive and reason why I started looking into this is
addition of as_str method to the iterators. With this change this
will became trivial. It’s also going to be trivial to implement
DoubleEndedIterator if that’s ever desired.
|
|
|
|
Document NonZeroXxx layout guarantees
Document that `NonZeroXxx` has the same layout and bit validity as `Xxx` with the exception of `0`.
|
|
|
|
|
|
|
|
Add links to <cell.rs>
`UnsafeCell` page could benefit too from having links to these most popular structs in the module.
|
|
|
|
|
|
Original `var_os` description said that it _may_ return an error if the value contains `=` or NUL. Let's make no promises on the `None` return value in these situation either, keep it in the [potential mood](https://en.wikipedia.org/wiki/Grammatical_mood#Potential).
|
|
one is enough
|
|
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
|
|
Re-introduced some of the former errors as situations where `None` is returned.
|
|
Remove `Errors` section from `var_os` documentation
|
|
Update compiler-builtins to 0.1.91 to bring in msp430 shift primitive…
… fixes.
This fixes unsoundness on MSP430 where `compiler-builtins` and LLVM didn't agree on the width of the shift amount argument of the shifting primitives (4 bytes vs 2 bytes). See https://github.com/rust-lang/compiler-builtins/pull/522 for more details.
|
|
binary_heap: Optimize Extend implementation.
This PR makes the `Extend` implementation for `BinaryHeap` no longer rely on specialization, so that it always use the bulk rebuild optimization that was previously only available for the `Vec` specialization.
|
|
Implement read_buf for RustHermit
In principle, this PR extends rust-lang/rust#108326 for RustyHermit.
|
|
`UnsafeCell` page could benefit too from having links to these most popular structs in the module.
|
|
Rollup of 4 pull requests
Successful merges:
- #109839 (Improve grammar of Iterator.partition_in_place)
- #109840 (Fix typo in std/src/os/fd/owned.rs)
- #109844 (a couple clippy::complexity fixes)
- #109846 (more clippy::complexity fixes (iter_kv_map, map_flatten, nonminimal_bool))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix typo in std/src/os/fd/owned.rs
|
|
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).
|