| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
rustdoc: Rename typedef to type alias
This matches the name used by the [Rust Reference][1], which is also what
people usually call these items.
[1]: https://doc.rust-lang.org/reference/items/type-aliases.html
r? `@GuillaumeGomez`
|
|
Make `Sharded` an enum and specialize it for the single thread case
This changes `Sharded` to use a single shard by an enum, reducing the size of `Sharded` for greater cache efficiency.
Performance improvement with 1 thread and `cfg(parallel_compiler)`:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>π£ <b>clap</b>:check</td><td align="right">1.7009s</td><td align="right">1.6748s</td><td align="right">π -1.53%</td></tr><tr><td>π£ <b>hyper</b>:check</td><td align="right">0.2525s</td><td align="right">0.2451s</td><td align="right">π -2.90%</td></tr><tr><td>π£ <b>regex</b>:check</td><td align="right">0.9519s</td><td align="right">0.9353s</td><td align="right">π -1.74%</td></tr><tr><td>π£ <b>syn</b>:check</td><td align="right">1.5504s</td><td align="right">1.5280s</td><td align="right">π -1.45%</td></tr><tr><td>π£ <b>syntex_syntax</b>:check</td><td align="right">5.9536s</td><td align="right">5.8873s</td><td align="right">π -1.11%</td></tr><tr><td>Total</td><td align="right">10.4092s</td><td align="right">10.2706s</td><td align="right">π -1.33%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9825s</td><td align="right">π -1.75%</td></tr></table>
I did see an unexpected 0.23% change for the serial compiler, so this could use a perf run to see if that reproduces.
cc `@SparrowLii`
|
|
Ensure that THIR unsafety check is done before stealing it
This ensures that THIR unsafety check is done before stealing it by running it on the typeck root instead of on a closure, which does nothing.
Fixes https://github.com/rust-lang/rust/issues/111520
|
|
Default relax_elf_relocations to true
This option tells LLVM to emit relaxable relocation types R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX/R_386_GOT32X in applicable cases. True matches Clang's CMake default since 2020-08 [1] and latest LLVM default[2].
This also works around a GNU ld<2.41 issue[2] when using general-dynamic/local-dynamic TLS models in `-Z plt=no` mode with latest LLVM.
[1]: https://github.com/llvm/llvm-project/commit/c41a18cf61790fc898dcda1055c3efbf442c14c0
[2]: https://github.com/llvm/llvm-project/commit/2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e
[3]: https://sourceware.org/bugzilla/show_bug.cgi?id=24784
|
|
|
|
|
|
This option tells LLVM to emit relaxable relocation types
R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX/R_386_GOT32X in applicable cases. True
matches Clang's CMake default since 2020-08 [1] and latest LLVM default[2].
This also works around a GNU ld<2.41 issue[3] when using
general-dynamic/local-dynamic TLS models in `-Z plt=no` mode with latest LLVM.
[1]: https://github.com/llvm/llvm-project/commit/c41a18cf61790fc898dcda1055c3efbf442c14c0
[2]: https://github.com/llvm/llvm-project/commit/2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e
[3]: https://sourceware.org/bugzilla/show_bug.cgi?id=24784
|
|
Bump backtrace to 0.3.69
|
|
Rollup of 6 pull requests
Successful merges:
- #114696 (Fix a pthread_t handle leak #114610)
- #115102 (Improve note for the `invalid_reference_casting` lint)
- #115103 (Disable bootstrap rustc version check)
- #115106 (ArchiveWrapper: handle LLVM API update)
- #115109 (Skip ExpandYamlAnchors when the config is missing)
- #115135 (Rustdoc: Add unstable --no-html-source flag)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Rustdoc: Add unstable --no-html-source flag
Fixes https://github.com/rust-lang/rust/issues/115060.
This is the equivalent of `#![doc(no_html_source)]` but on the command-line. It disables the generation of the source pages (and of the links pointing to them as well).
The motivation behind this is to enable to reduce documentation size when generating it in some locations without enforcing this to end users or adding a new feature to enable/disable the crate attribute.
r? `@notriddle`
|
|
Skip ExpandYamlAnchors when the config is missing
The dist-src tarball does not include `.github/` at all, so we can't
check whether it needs to be regenerated.
|
|
ArchiveWrapper: handle LLVM API update
In llvm/llvm-project@f740bcb3707a17ed4ccd52157089011a586cc2a6 a boolean parameter changed to an enum.
r? ``@nikic``
``@rustbot`` label: +llvm-main
|
|
r=compiler-errors
Disable bootstrap rustc version check
Mitigates #115065
|
|
Improve note for the `invalid_reference_casting` lint
This PR add link to the book interior mutability chapter, https://doc.rust-lang.org/book/ch15-05-interior-mutability.html; this is done to guide peoples to a place with many useful information and context.
*Note that this isn't the first occurrence of a link to the book in [tests outputs](https://github.com/search?q=repo%3Arust-lang%2Frust+book+path%3A%2F%5Etests%5C%2Fui%5C%2F%2F&type=code).*
r? `@est31`
|
|
Fix a pthread_t handle leak #114610
https://github.com/rust-lang/rust/issues/114610
Ran the tests as described in https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-wasi-preview1-threads.md?plain=1#L125
|
|
|
|
|
|
|
|
Allow MaybeUninit in input and output of inline assembly
**Motivation:**
As part of the work to remove UBs from crossbeam's AtomicCell, I'm writing a library to implement atomic operations on MaybeUnint using inline assembly ([atomic-maybe-uninit](https://github.com/taiki-e/atomic-maybe-uninit), https://github.com/crossbeam-rs/crossbeam/pull/1015).
However, currently, MaybeUnint cannot be used in input&output of inline assembly, so when processing MaybeUninit, values must be [passed through memory](https://github.com/taiki-e/atomic-maybe-uninit/blob/main/src/arch/aarch64.rs#L121-L122). It is inefficient and microbenchmarks have [actually shown significant performance degradation](https://github.com/crossbeam-rs/crossbeam/pull/1015#issuecomment-1676549870).
It would be nice if we could allow MaybeUninit in input and output of inline assembly.
---
This PR changed the type check in rustc_hir_analysis to allow `MaybeUnint<int | float | ptr | fn ptr | simd vector>` in input and output of inline assembly and added a simple test.
To be honest, I'm not sure that this is the correct way to do it, because this is like doing transmute to integers/floats/etc from MaybeUninit on the compiler side. EDIT: [this seems fine](https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm/topic/MaybeUninit.20in.20asm!/near/384662900)
r? `@Amanieu`
cc `@thomcc` (because you [had previously proposed this](https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm/topic/MaybeUninit.20in.20asm!))
|
|
|
|
Update LLVM submodule to 17.0.0-rc3
|
|
Add link to the book interior mutability chapter,
https://doc.rust-lang.org/book/ch15-05-interior-mutability.html.
|
|
ci: Update FreeBSD and illumos binutils to 2.40
The current old 2.25 seems to cause trouble to #106511.
Install texinfo to dist-x86_64-freebsd/Dockerfile like other containers
to fix
```
MAKEINFO doc/bfd.info
/binutils/binutils-2.40/missing: 81: /binutils/binutils-2.40/missing: makeinfo: not found
WARNING: 'makeinfo' is missing on your system.
```
---
https://www.freshports.org/devel/binutils uses 2.40 for FreeBSD 12.x as well.
`@nikic`
|
|
Rollup of 7 pull requests
Successful merges:
- #114930 (Automatically add OS labels to std PRs)
- #115053 (docs: Add example, reference link for `type` keyword.)
- #115092 (Add generics_of to smir)
- #115096 (Add regression test for not `memcpy`ing padding bytes)
- #115100 (Add support for `ptr::write`s for the `invalid_reference_casting` lint)
- #115114 (Contents of reachable statics is reachable)
- #115122 (Fix clippy lint for identical `if`/`else` contraining `?` expressions)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix clippy lint for identical `if`/`else` contraining `?` expressions
Follow up to #114819.
|
|
Contents of reachable statics is reachable
Fixes #115052.
|
|
Add support for `ptr::write`s for the `invalid_reference_casting` lint
This PR adds support for `ptr::write` and others for the `invalid_reference_casting` lint.
Detecting instances where instead of using the deref (`*`) operator to assign someone uses `ptr::write`, `ptr::write_unaligned` or `ptr::write_volatile`.
```rust
let data_len = 5u64;
std::ptr::write(
std::mem::transmute::<*const u64, *mut u64>(&data_len),
new_data_len,
);
```
r? ``@est31``
|
|
Add regression test for not `memcpy`ing padding bytes
Closes #56297
See this comparison: https://rust.godbolt.org/z/jjzfonfcE
I don't have any experience with codegen tests, I hope this is correct
|
|
Add generics_of to smir
Continuing our covering of smir.
r? `@spastorino`
|
|
docs: Add example, reference link for `type` keyword.
Fixes #114281.
|
|
Automatically add OS labels to std PRs
I'd love to have `library/std/src/sys` PRs that touch Windows stuff to have the `O-windows` label for easier discovery (and rediscovery). While I'm here I added a couple of other auto OS labels. Perhaps `O-unix` is a little too broad but it's hard to be more specific and I think it's still useful insomuch as POSIX is a thing.
r? libs
|
|
Update the links for Stabilized APIs in 1.72.0
* Use `stable` instead of `nightly` paths.
* Fix the anchors for `CStr::to_*` links.
r? `@Mark-Simulacrum`
|
|
Update cargo
3 commits in 80eca0e58fb2ff52c1e94fc191b55b37ed73e0e4..2cc50bc0b63ad20da193e002ba11d391af0104b7
2023-08-19 00:52:06 +0000 to 2023-08-22 22:43:08 +0000
- config: merge lists in precedence order (rust-lang/cargo#12515)
- ci: test `resolver-tests` in a separate job (rust-lang/cargo#12540)
- refactor: Use clap to suggest alternative argument for unsupported arguments (rust-lang/cargo#12529)
r? ghost
|
|
|
|
Follow up to #114819.
|
|
|
|
r=GuillaumeGomez,ChAoSUnItY
rustdoc: use unicode-aware checks for redundant explicit link fastpath
Fixes #115064
Fixes #115062
Fixes #115116
|
|
* Use `stable` instead of `nightly` paths.
* Fix the anchors for `CStr::to_*` links.
|
|
Don't do intra-pass validation on MIR shims
Fixes #114375
In the test that was committed, we end up generating the drop shim for `struct Foo` that looks like:
```
fn std::ptr::drop_in_place(_1: *mut Foo) -> () {
let mut _0: ();
bb0: {
goto -> bb5;
}
bb1: {
return;
}
bb2 (cleanup): {
resume;
}
bb3: {
goto -> bb1;
}
bb4 (cleanup): {
drop(((*_1).0: foo::WrapperWithDrop<()>)) -> [return: bb2, unwind terminate];
}
bb5: {
drop(((*_1).0: foo::WrapperWithDrop<()>)) -> [return: bb3, unwind: bb2];
}
}
```
In `bb4` and `bb5`, we assert that `(*_1).0` has type `WrapperWithDrop<()>`. However, In a user-facing param env, the type is actually `WrapperWithDrop<Tait>`. These types are not equal in a user-facing param-env (and can't be made equal even if we use `DefiningAnchor::Bubble`, since it's a non-local TAIT).
|
|
|
|
The current old 2.25 seems to cause trouble to #106511.
Install texinfo to dist-x86_64-freebsd/Dockerfile like other containers
to fix
```
MAKEINFO doc/bfd.info
/binutils/binutils-2.40/missing: 81: /binutils/binutils-2.40/missing: makeinfo: not found
WARNING: 'makeinfo' is missing on your system.
```
|
|
Use the same DISubprogram for each instance of the same inlined function within a caller
# Issue Details:
The call to `panic` within a function like `Option::unwrap` is translated to LLVM as a `tail call` (as it will never return), when multiple calls to the same function like this is inlined LLVM will notice the common `tail call` block (i.e., loading the same panic string + location info and then calling `panic`) and merge them together.
When merging these instructions together, LLVM will also attempt to merge the debug locations as well, but this fails (i.e., debug info is dropped) as Rust emits a new `DISubprogram` at each inline site thus LLVM doesn't recognize that these are actually the same function and so thinks that there isn't a common debug location.
As an example of this when building for x86_64 Windows (note the lack of `.cv_loc` before the call to `panic`, thus it will be attributed to the same line at the `addq` instruction):
```
.cv_loc 0 1 23 0 # src\lib.rs:23:0
addq $40, %rsp
retq
leaq .Lalloc_f570dea0a53168780ce9a91e67646421(%rip), %rcx
leaq .Lalloc_629ace53b7e5b76aaa810d549cc84ea3(%rip), %r8
movl $43, %edx
callq _ZN4core9panicking5panic17h12e60b9063f6dee8E
int3
```
# Fix Details:
Cache the `DISubprogram` emitted for each inlined function instance within a caller so that this can be reused if that instance is encountered again, this also requires caching the `DILexicalBlock` and `DIVariable` objects to avoid creating duplicates.
After this change the above assembly now looks like:
```
.cv_loc 0 1 23 0 # src\lib.rs:23:0
addq $40, %rsp
retq
.cv_inline_site_id 5 within 0 inlined_at 1 0 0
.cv_inline_site_id 6 within 5 inlined_at 1 12 0
.cv_loc 6 2 935 0 # library\core\src\option.rs:935:0
leaq .Lalloc_5f55955de67e57c79064b537689facea(%rip), %rcx
leaq .Lalloc_e741d4de8cb5801e1fd7a6c6795c1559(%rip), %r8
movl $43, %edx
callq _ZN4core9panicking5panic17hde1558f32d5b1c04E
int3
```
|
|
|
|
|
|
|
|
The dist-src tarball does not include `.github/` at all, so we can't
check whether it needs to be regenerated.
|
|
In llvm/llvm-project@f740bcb3707a17ed4ccd52157089011a586cc2a6 a boolean
parameter changed to an enum.
r? @nikic
@rustbot label: +llvm-main
|
|
Rollup of 6 pull requests
Successful merges:
- #114959 (fix #113702 emit a proper diagnostic message for unstable lints passed from CLI)
- #115011 (Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`))
- #115077 (Do not emit invalid suggestion in E0191 when spans overlap)
- #115087 (Add disclaimer on size assertion macro)
- #115090 (Always use `os-release` rather than `/lib` to detect `NixOS` (bootstrap))
- #115101 (triagebot: add dependency licensing pings)
r? `@ghost`
`@rustbot` modify labels: rollup
|