| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
rustdoc perf: clone `clean::Item` less
In https://github.com/rust-lang/rust/pull/130798, I caused a small perf regression for rustdoc (see https://github.com/rust-lang/rust/pull/130807#issuecomment-2373116917), so here is a small improvement to make up for it :smiley_cat:.
This change is actually unrelated to the minor perf regression in `Item::stability` and instead fixes a more relevant perf problem that I found while investigating: For certain crates with many impls on type aliases, we unnecessarily cloned large `clean::Item`s multiple times -- now we just borrow them.
|
|
Rollup of 8 pull requests
Successful merges:
- #130313 ([`cfg_match`] Generalize inputs)
- #130706 ([rustdoc] Remove unneeded jinja comments)
- #130846 (Revert Break into the debugger on panic (129019))
- #130875 (update `compiler-builtins` to 0.1.126)
- #130889 (Weekly `cargo update`: only `rustbook`)
- #130892 (Partially update `library/Cargo.lock`)
- #130911 (diagnostics: wrap fn cast suggestions in parens when needed)
- #130912 (On implicit `Sized` bound on fn argument, point at type instead of pattern)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
On implicit `Sized` bound on fn argument, point at type instead of pattern
Instead of
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:20
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^ doesn't have a size known at compile-time
```
output
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:29
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
```
|
|
notriddle:notriddle/suggest-wrap-parens-fn-pointer, r=compiler-errors
diagnostics: wrap fn cast suggestions in parens when needed
Fixes #121632
|
|
Partially update `library/Cargo.lock`
Run `cargo update` in library but exclude updates to `cc` and to `compiler_builtins`. Exclusions were done because `cc` seems to have some issues updating [1], and `compiler_builtins` needs to be updated on its own.
Partially supersedes https://github.com/rust-lang/rust/pull/129538.
[1]: https://github.com/rust-lang/rust/pull/130720
try-job: x86_64-msvc
|
|
Weekly `cargo update`: only `rustbook`
We are having problems getting updates to merge due to CI failures. I took only the rustbook portion of https://github.com/rust-lang/rust/pull/129538 and put it into this PR, which hopefully should be able to successfully merge on its own.
Original message:
```
cargo update: rustbook
rustbook dependencies:
Locking 70 packages to latest compatible versions
Removing adler v1.0.2
Adding adler2 v2.0.0
Updating anstream v0.6.14 -> v0.6.15
Updating anstyle v1.0.7 -> v1.0.8
Updating anstyle-parse v0.2.4 -> v0.2.5
Updating anstyle-query v1.1.0 -> v1.1.1
Updating anstyle-wincon v3.0.3 -> v3.0.4
Updating anyhow v1.0.86 -> v1.0.89
Removing base64 v0.22.1
Updating bstr v1.9.1 -> v1.10.0
Adding byteorder v1.5.0
Updating cc v1.1.5 -> v1.1.21
Updating clap v4.5.9 -> v4.5.18
Updating clap_builder v4.5.9 -> v4.5.18
Updating clap_complete v4.5.8 -> v4.5.29
Updating clap_derive v4.5.8 -> v4.5.18
Updating clap_lex v0.7.1 -> v0.7.2
Updating colorchoice v1.0.1 -> v1.0.2
Updating core-foundation-sys v0.8.6 -> v0.8.7
Updating cpufeatures v0.2.12 -> v0.2.14
Adding dateparser v0.2.1
Removing deranged v0.3.11
Updating env_filter v0.1.0 -> v0.1.2
Updating env_logger v0.11.3 -> v0.11.5
Updating fastrand v2.1.0 -> v2.1.1
Updating flate2 v1.0.30 -> v1.0.33
Updating iana-time-zone v0.1.60 -> v0.1.61
Updating indexmap v2.2.6 -> v2.5.0
Updating is_terminal_polyfill v1.70.0 -> v1.70.1
Updating js-sys v0.3.69 -> v0.3.70
Adding lazy_static v1.5.0
Updating libc v0.2.155 -> v0.2.158
Removing linked-hash-map v0.5.6
Updating mdbook-i18n-helpers v0.3.4 -> v0.3.5
Updating miniz_oxide v0.7.4 -> v0.8.0
Updating normpath v1.2.0 -> v1.3.0
Removing num-conv v0.1.0
Updating opener v0.7.1 -> v0.7.2
Updating pest v2.7.11 -> v2.7.13
Updating pest_derive v2.7.11 -> v2.7.13
Updating pest_generator v2.7.11 -> v2.7.13
Updating pest_meta v2.7.11 -> v2.7.13
Removing plist v1.7.0
Removing powerfmt v0.2.0
Updating ppv-lite86 v0.2.17 -> v0.2.20
Adding pulldown-cmark v0.11.3 (latest: v0.12.1)
Adding pulldown-cmark-escape v0.11.0
Adding pulldown-cmark-to-cmark v15.0.1 (latest: v17.0.0)
Removing quick-xml v0.32.0
Updating quote v1.0.36 -> v1.0.37
Updating redox_syscall v0.5.3 -> v0.5.4
Updating regex v1.10.5 -> v1.10.6
Updating rustix v0.38.34 -> v0.38.37
Updating serde v1.0.204 -> v1.0.210
Updating serde_derive v1.0.204 -> v1.0.210
Updating serde_json v1.0.120 -> v1.0.128
Updating serde_spanned v0.6.6 -> v0.6.7
Updating syn v2.0.71 -> v2.0.77
Updating tempfile v3.10.1 -> v3.12.0
Updating thiserror v1.0.62 -> v1.0.63
Updating thiserror-impl v1.0.62 -> v1.0.63
Removing time v0.3.36
Removing time-core v0.1.2
Removing time-macros v0.2.18
Updating toml v0.8.14 -> v0.8.19
Updating toml_datetime v0.6.6 -> v0.6.8
Updating toml_edit v0.22.15 -> v0.22.21
Updating unicode-ident v1.0.12 -> v1.0.13
Updating unicode-normalization v0.1.23 -> v0.1.24
Updating unicode-width v0.1.13 -> v0.1.14 (latest: v0.2.0)
Updating version_check v0.9.4 -> v0.9.5
Updating wasm-bindgen v0.2.92 -> v0.2.93
Updating wasm-bindgen-backend v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro-support v0.2.92 -> v0.2.93
Updating wasm-bindgen-shared v0.2.92 -> v0.2.93
Updating winapi-util v0.1.8 -> v0.1.9
Adding windows-sys v0.59.0
Updating winnow v0.6.13 -> v0.6.18
Removing yaml-rust v0.4.5
Adding zerocopy v0.7.35
Adding zerocopy-derive v0.7.35
note: pass `--verbose` to see 26 unchanged dependencies behind latest
```
|
|
update `compiler-builtins` to 0.1.126
this requires the addition of a bootstrap variant of the new `naked_asm!` macro
r? `@tgross35`
extracted from https://github.com/rust-lang/rust/pull/128651
|
|
Revert Break into the debugger on panic (129019)
This was talked about a bit at a recent libs meeting. While I think experimenting with this is worthwhile, I am nervous about this new behaviour reaching stable. We've already reverted on one tier 1 platform (Linux, https://github.com/rust-lang/rust/pull/130810) which means we have differing semantics on different tier 1 platforms. Also the fact it triggers even when `catch_unwind` is used to catch the panic means it can be very noisy in some projects.
At the very least I think it could use some more discussion before being instantly stable. I think this could maybe be re-landed with an environment variable to control/override the behaviour. But that part would likely need a libs-api decision.
cc ````@workingjubilee```` ````@kromych````
|
|
r=notriddle
[rustdoc] Remove unneeded jinja comments
This is a follow-up of https://github.com/rust-lang/rust/pull/130585.
Since we now check for the jinja comments we missed, we can now check for the jinja comments which are unneeded. It will make the parsing and therefore the compilation a tiny bit faster (well, if anyone sees a difference haha). The real goal is mostly to have easier to read template files. :wink:
r? ``@notriddle``
|
|
[`cfg_match`] Generalize inputs
cc #115585
Changes the input type from `item` to `tt`, which makes the macro have the same functionality of `cfg_if`.
Also adds a test to ensure that `stmt_expr_attributes` is not triggered.
|
|
Fixes #121632
|
|
Instead of
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:20
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^ doesn't have a size known at compile-time
```
output
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:29
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
```
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #130279 (Document subtleties of `ManuallyDrop`)
- #130517 (Add the library workspace to the suggested rust-analyzer config)
- #130820 (Fix diagnostics for coroutines with () as input.)
- #130833 (Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation)
- #130845 (Utf8Chunks: add link to Utf8Chunk)
- #130850 (Pass Module Analysis Manager to Standard Instrumentations)
- #130861 (Use `mem::offset_of!` for `sockaddr_un.sun_path`)
- #130862 (rustdoc: do not animate :target when user prefers reduced motion)
- #130868 (Update FIXME comment in s390x_unknown_linux_*.rs)
- #130879 (Pass correct HirId to late_bound_vars in diagnostic code)
- #130880 (add missing FIXME(const-hack))
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
add missing FIXME(const-hack)
r? ```@scottmcm```
|
|
Pass correct HirId to late_bound_vars in diagnostic code
Fixes #130858.
Fixes #125655.
Fixes #130391.
Fixes #130663.
r? compiler-errors
|
|
Update FIXME comment in s390x_unknown_linux_*.rs
- Remove comment about "LLVM < 16" since the minimum external LLVM version is 16+ since https://github.com/rust-lang/rust/pull/117947
- Reflect rename of cabi_s390x.rs in https://github.com/rust-lang/rust/commit/030244cd4a76914af7dc2939ed1a16f394ceda48 (renamed to [abi/call/s390x.rs](https://github.com/rust-lang/rust/commit/030244cd4a76914af7dc2939ed1a16f394ceda48#diff-20136d4a18fa0ef9bd4fc2e6f92e88daad6be88bfb156e5702af39ee87ca4879), and it is currently [still in the same location](https://github.com/rust-lang/rust/blob/9e394f551c050ff03c6fc57f190e0761cf0be6e8/compiler/rustc_target/src/abi/call/s390x.rs)).
r? ``````@cuviper``````
``````@rustbot`````` label +O-SystemZ
|
|
rustdoc: do not animate :target when user prefers reduced motion
This accessibility improvement gates #129284 behind an inverted [prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/`@media/prefers-reduced-motion)` media query.
|
|
Use `mem::offset_of!` for `sockaddr_un.sun_path`
We don't need manual pointer math here anymore!
try-job: dist-i686-msvc
|
|
r=nikic
Pass Module Analysis Manager to Standard Instrumentations
This PR introduces changes related to llvm::PassInstrumentationCallbacks. Now, we pass Module Analysis Manager to StandardInstrumentations::registerCallbacks, so it can take advantage of such instrumentations as IR verifier or preserved CFG checker. So basically this is NFC PR.
|
|
Utf8Chunks: add link to Utf8Chunk
It is currently surprisingly non-trivial to go from the `utf8_chunks` method to the docs of the `valid`/`invalid` methods used in the example. This should help.
|
|
Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation
Closes: #130430
r? rust-lang/diagnostics
|
|
Fix diagnostics for coroutines with () as input.
This may be a more real-life example to trigger the diagnostic:
```rust
#![features(try_blocks, coroutine_trait, coroutines)]
use std::ops::Coroutine;
struct Request;
struct Response;
fn get_args() -> Result<String, String> { todo!() }
fn build_request(_arg: String) -> Request { todo!() }
fn work() -> impl Coroutine<Option<Response>, Yield = Request> {
#[coroutine]
|_| {
let r: Result<(), String> = try {
let req = get_args()?;
yield build_request(req)
};
if let Err(msg) = r {
eprintln!("Error: {msg}");
}
}
}
```
|
|
Add the library workspace to the suggested rust-analyzer config
|
|
Document subtleties of `ManuallyDrop`
After seeing #130140 and #130141, I figured that `ManuallyDrop` needs documentation explaining its subtleties, hence this PR.
See also https://github.com/rust-lang/unsafe-code-guidelines/issues/245
|
|
|
|
Run `cargo update` in the project root
try-job: x86_64-msvc
|
|
|
|
|
|
|
|
Run `cargo update` in library but exclude updates to `cc` and to
`compiler_builtins`. Exclusions were done because `cc` seems to have
some issues updating [1], and `compiler_builtins` needs to be updated on
its own.
[1]: https://github.com/rust-lang/rust/pull/130720
|
|
rustbook dependencies:
Locking 70 packages to latest compatible versions
Removing adler v1.0.2
Adding adler2 v2.0.0
Updating anstream v0.6.14 -> v0.6.15
Updating anstyle v1.0.7 -> v1.0.8
Updating anstyle-parse v0.2.4 -> v0.2.5
Updating anstyle-query v1.1.0 -> v1.1.1
Updating anstyle-wincon v3.0.3 -> v3.0.4
Updating anyhow v1.0.86 -> v1.0.89
Removing base64 v0.22.1
Updating bstr v1.9.1 -> v1.10.0
Adding byteorder v1.5.0
Updating cc v1.1.5 -> v1.1.21
Updating clap v4.5.9 -> v4.5.18
Updating clap_builder v4.5.9 -> v4.5.18
Updating clap_complete v4.5.8 -> v4.5.29
Updating clap_derive v4.5.8 -> v4.5.18
Updating clap_lex v0.7.1 -> v0.7.2
Updating colorchoice v1.0.1 -> v1.0.2
Updating core-foundation-sys v0.8.6 -> v0.8.7
Updating cpufeatures v0.2.12 -> v0.2.14
Adding dateparser v0.2.1
Removing deranged v0.3.11
Updating env_filter v0.1.0 -> v0.1.2
Updating env_logger v0.11.3 -> v0.11.5
Updating fastrand v2.1.0 -> v2.1.1
Updating flate2 v1.0.30 -> v1.0.33
Updating iana-time-zone v0.1.60 -> v0.1.61
Updating indexmap v2.2.6 -> v2.5.0
Updating is_terminal_polyfill v1.70.0 -> v1.70.1
Updating js-sys v0.3.69 -> v0.3.70
Adding lazy_static v1.5.0
Updating libc v0.2.155 -> v0.2.158
Removing linked-hash-map v0.5.6
Updating mdbook-i18n-helpers v0.3.4 -> v0.3.5
Updating miniz_oxide v0.7.4 -> v0.8.0
Updating normpath v1.2.0 -> v1.3.0
Removing num-conv v0.1.0
Updating opener v0.7.1 -> v0.7.2
Updating pest v2.7.11 -> v2.7.13
Updating pest_derive v2.7.11 -> v2.7.13
Updating pest_generator v2.7.11 -> v2.7.13
Updating pest_meta v2.7.11 -> v2.7.13
Removing plist v1.7.0
Removing powerfmt v0.2.0
Updating ppv-lite86 v0.2.17 -> v0.2.20
Adding pulldown-cmark v0.11.3 (latest: v0.12.1)
Adding pulldown-cmark-escape v0.11.0
Adding pulldown-cmark-to-cmark v15.0.1 (latest: v17.0.0)
Removing quick-xml v0.32.0
Updating quote v1.0.36 -> v1.0.37
Updating redox_syscall v0.5.3 -> v0.5.4
Updating regex v1.10.5 -> v1.10.6
Updating rustix v0.38.34 -> v0.38.37
Updating serde v1.0.204 -> v1.0.210
Updating serde_derive v1.0.204 -> v1.0.210
Updating serde_json v1.0.120 -> v1.0.128
Updating serde_spanned v0.6.6 -> v0.6.7
Updating syn v2.0.71 -> v2.0.77
Updating tempfile v3.10.1 -> v3.12.0
Updating thiserror v1.0.62 -> v1.0.63
Updating thiserror-impl v1.0.62 -> v1.0.63
Removing time v0.3.36
Removing time-core v0.1.2
Removing time-macros v0.2.18
Updating toml v0.8.14 -> v0.8.19
Updating toml_datetime v0.6.6 -> v0.6.8
Updating toml_edit v0.22.15 -> v0.22.21
Updating unicode-ident v1.0.12 -> v1.0.13
Updating unicode-normalization v0.1.23 -> v0.1.24
Updating unicode-width v0.1.13 -> v0.1.14 (latest: v0.2.0)
Updating version_check v0.9.4 -> v0.9.5
Updating wasm-bindgen v0.2.92 -> v0.2.93
Updating wasm-bindgen-backend v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro-support v0.2.92 -> v0.2.93
Updating wasm-bindgen-shared v0.2.92 -> v0.2.93
Updating winapi-util v0.1.8 -> v0.1.9
Adding windows-sys v0.59.0
Updating winnow v0.6.13 -> v0.6.18
Removing yaml-rust v0.4.5
Adding zerocopy v0.7.35
Adding zerocopy-derive v0.7.35
note: pass `--verbose` to see 26 unchanged dependencies behind latest
[ extracted from rust-lang/rust#129538 - Trevor ]
Co-authored-by: Trevor Gross <tmgross@umich.edu>
|
|
|
|
|
|
r=RalfJung
Stabilize `const_refs_to_static`
Meanwhile, I am cooking a sub-section in the language reference.
|
|
This accessibility improvement gates the target flashing and tooltip fade-out
behind an inverted prefers-reduced-motion media query.
|
|
update tests
fix bitwidth-sensitive stderr output
use build-fail for asm tests
|
|
Use `&raw` in the standard library
Since the stabilization in #127679 has reached stage0, 1.82-beta, we can
start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!`
and `ptr::addr_of_mut!` can stop allowing the unstable feature.
I intentionally did not change any documentation or tests, but the rest
of those macro uses are all now using `&raw const` or `&raw mut` in the
standard library.
|
|
|
|
|
|
|
|
Reorder stack spills so that constants come later.
Currently constants are "pulled forward" and have their stack spills emitted first. This confuses LLVM as to where to place breakpoints at function entry, and results in argument values being wrong in the debugger. It's straightforward to avoid emitting the stack spills for constants until arguments/etc have been introduced in debug_introduce_locals, so do that.
Example LLVM IR (irrelevant IR elided):
Before:
```
define internal void `@_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64` %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start:
%c.dbg.spill = alloca [8 x i8], align 8
%b.dbg.spill = alloca [8 x i8], align 8
%a.dbg.spill = alloca [8 x i8], align 8
%x.dbg.spill = alloca [4 x i8], align 4
store i32 0, ptr %x.dbg.spill, align 4, !dbg !192 ; LLVM places breakpoint here.
#dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !192)
store i64 %a, ptr %a.dbg.spill, align 8
#dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !193)
store i64 %b, ptr %b.dbg.spill, align 8
#dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !194)
store double %c, ptr %c.dbg.spill, align 8
#dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !195)
ret void, !dbg !196
}
```
After:
```
define internal void `@_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64` %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start:
%x.dbg.spill = alloca [4 x i8], align 4
%c.dbg.spill = alloca [8 x i8], align 8
%b.dbg.spill = alloca [8 x i8], align 8
%a.dbg.spill = alloca [8 x i8], align 8
store i64 %a, ptr %a.dbg.spill, align 8
#dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !192)
store i64 %b, ptr %b.dbg.spill, align 8
#dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !193)
store double %c, ptr %c.dbg.spill, align 8
#dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !194)
store i32 0, ptr %x.dbg.spill, align 4, !dbg !195 ; LLVM places breakpoint here.
#dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !195)
ret void, !dbg !196
}
```
Note in particular the position of the "LLVM places breakpoint here" comment relative to the stack spills for the function arguments. LLVM assumes that the first instruction with with a debug location is the end of the prologue. As LLVM does not currently offer front ends any direct control over the placement of the prologue end reordering the IR is the only mechanism available to fix argument values at function entry in the presence of MIR optimizations like SingleUseConsts. Fixes #128945
r? `@michaelwoerister`
|
|
implementation
|
|
Since the stabilization in #127679 has reached stage0, 1.82-beta, we can
start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!`
and `ptr::addr_of_mut!` can stop allowing the unstable feature.
I intentionally did not change any documentation or tests, but the rest
of those macro uses are all now using `&raw const` or `&raw mut` in the
standard library.
|
|
|
|
|