about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-12-21Align `{i686,x86_64}-win7-windows-msvc` to their parent targetsTobias Bucher-6/+8
There were some changes to `{i686,x86_64}-pc-windows-msvc`, include them in the backward compatibility targets as well.
2024-12-21Auto merge of #134594 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 10 commits in 99dff6d77db779716dda9ca3b29c26addd02c1be..652623b779c88fe44afede28bf7f1c9c07812511 2024-12-18 00:55:17 +0000 to 2024-12-20 15:44:42 +0000 - fix(package): use relpath to cwd for vcs dirtiness report (rust-lang/cargo#14970) - Enable triagebot merge conflict notifications (rust-lang/cargo#14972) - fixed the error message for a user to open the crate (rust-lang/cargo#14969) - fix(package): show dirty filepaths relative to git workdir (rust-lang/cargo#14968) - Add the `test` cfg as a well known cfg before of compiler change (rust-lang/cargo#14963) - refactor(cargo-package): let-else to flatten code (rust-lang/cargo#14959) - fix(cargo-package): add more traces (rust-lang/cargo#14960) - Do not hash absolute sysroot path into stdlib crates metadata. (rust-lang/cargo#14951) - docs: add missing argument to Rustup Cargo workaround (rust-lang/cargo#14954) - fix(cargo-rustc): stabilize higher precedence trailing flags (rust-lang/cargo#14900)
2024-12-20Update cargoWeihang Lo-0/+0
2024-12-21Auto merge of #134590 - matthiaskrgr:rollup-8lz2s62, r=matthiaskrgrbors-186/+779
Rollup of 7 pull requests Successful merges: - #123604 (Abstract `ProcThreadAttributeList` into its own struct) - #128780 (Add `--doctest-compilation-args` option to add compilation flags to doctest compilation) - #133782 (Precedence improvements: closures and jumps) - #134509 (Arbitrary self types v2: niche deshadowing test) - #134524 (Arbitrary self types v2: no deshadow pre feature.) - #134539 (Restrict `#[non_exaustive]` on structs with default field values) - #134586 (Also lint on option of function pointer comparisons) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-21Rollup merge of #134586 - Urgau:fn-ptr-lint-option, r=compiler-errorsMatthias Krüger-2/+50
Also lint on option of function pointer comparisons This PR is the first part of #134536, ie. the linting on `Option<{fn ptr}>` in the `unpredictable_function_pointer_comparisons` lint, which isn't part of the lang nomination that the second part is going trough, and so should be able to be approved independently. Related to https://github.com/rust-lang/rust/issues/134527 r? `@compiler-errors`
2024-12-21Rollup merge of #134539 - estebank:restrict-non_exhaustive, r=jieyouxuMatthias Krüger-3/+78
Restrict `#[non_exaustive]` on structs with default field values Do not allow users to apply `#[non_exaustive]` to a struct when they have also used default field values.
2024-12-21Rollup merge of #134524 - adetaylor:getref, r=compiler-errorsMatthias Krüger-0/+50
Arbitrary self types v2: no deshadow pre feature. The arbitrary self types v2 work introduces a check for shadowed methods, whereby a method in some "outer" smart pointer type may called in preference to a method in the inner referent. This is bad if the outer pointer adds a method later, as it may change behavior, so we ensure we error in this circumstance. It was intended that this new shadowing detection system only comes into play for users who enable the `arbitrary_self_types` feature (or of course everyone later if it's stabilized). It was believed that the new deshadowing code couldn't be reached without building the custom smart pointers that `arbitrary_self_types` enables, and therefore there was no risk of this code impacting existing users. However, it turns out that cunning use of `Pin::get_ref` can cause this type of shadowing error to be emitted now. This commit adds a test for this case. As we want this test to pass without arbitrary_self_types, but fail with it, I've split it into two files (one with run-pass and one without). If there's a better way I can amend it. Part of #44874 r? ```@wesleywiser```
2024-12-21Rollup merge of #134509 - adetaylor:niche-deshadowing-tests, r=wesleywiserMatthias Krüger-0/+63
Arbitrary self types v2: niche deshadowing test Arbitrary self types v2 attempts to detect cases where methods in an "outer" type (e.g. a smart pointer) might "shadow" methods in the referent. There are a couple of cases where the current code makes no attempt to detect such shadowing. Both of these cases only apply if other unstable features are enabled. Add a test, mostly for illustrative purposes, so we can see the shadowing cases that can occur. Part of #44874 r? ```@wesleywiser```
2024-12-21Rollup merge of #133782 - dtolnay:closuresjumps, r=spastorino,traviscrossMatthias Krüger-9/+24
Precedence improvements: closures and jumps This PR fixes some cases where rustc's pretty printers would redundantly parenthesize expressions that didn't need it. <table> <tr><th>Before</th><th>After</th></tr> <tr><td><code>return (|x: i32| x)</code></td><td><code>return |x: i32| x</code></td></tr> <tr><td><code>(|| -> &mut () { std::process::abort() }).clone()</code></td><td><code>|| -> &mut () { std::process::abort() }.clone()</code></td></tr> <tr><td><code>(continue) + 1</code></td><td><code>continue + 1</code></td></tr> </table> Tested by `echo "fn main() { let _ = $AFTER; }" | rustc -Zunpretty=expanded /dev/stdin`. The pretty-printer aims to render the syntax tree as it actually exists in rustc, as faithfully as possible, in Rust syntax. It can insert parentheses where forced by Rust's grammar in order to preserve the meaning of a macro-generated syntax tree, for example in the case of `a * $rhs` where $rhs is `b + c`. But for any expression parsed from source code, without a macro involved, there should never be a reason for inserting additional parentheses not present in the original. For closures and jumps (return, break, continue, yield, do yeet, become) the unneeded parentheses came from the precedence of some of these expressions being misidentified. In the same order as the table above: - Jumps and closures are supposed to have equal precedence. The [Rust Reference](https://doc.rust-lang.org/1.83.0/reference/expressions.html#expression-precedence) says so, and in Syn they do. There is no Rust syntax that would require making a precedence distinction between jumps and closures. But in rustc these were previously 2 distinct levels with the closure being lower, hence the parentheses around a closure inside a jump (but not a jump inside a closure). - When a closure is written with an explicit return type, the grammar [requires](https://doc.rust-lang.org/1.83.0/reference/expressions/closure-expr.html) that the closure body consists of exactly one block expression, not any other arbitrary expression as usual for closures. Parsing of the closure body does not continue after the block expression. So in `|| { 0 }.clone()` the clone is inside the closure body and applies to `{ 0 }`, whereas in `|| -> _ { 0 }.clone()` the clone is outside and applies to the closure as a whole. - Continue never needs parentheses. It was previously marked as having the lowest possible precedence but it should have been the highest, next to paths and loops and function calls, not next to jumps.
2024-12-21Rollup merge of #128780 - GuillaumeGomez:rustflags-doctests, r=rustdocMatthias Krüger-21/+220
Add `--doctest-compilation-args` option to add compilation flags to doctest compilation Fixes #67533. Tracking issue: https://github.com/rust-lang/rust/issues/134172 It's been something I meant to take a look at for a long time and actually completely forgot... The idea is to allow to give more control over how doctests are compiled to users. To do so, this PR adds a new `--doctest-compilation-args` option which provides extra compilation flags. r? `@notriddle`
2024-12-21Rollup merge of #123604 - michaelvanstraten:proc_thread_attribute_list, ↵Matthias Krüger-151/+294
r=ChrisDenton Abstract `ProcThreadAttributeList` into its own struct As extensively discussed in issue #114854, the current implementation of the unstable `windows_process_extensions_raw_attribute` features lacks support for passing a raw pointer. This PR wants to explore the opportunity to abstract away the `ProcThreadAttributeList` into its own struct to for one improve safety and usability and secondly make it possible to maybe also use it to spawn new threads. try-job: x86_64-mingw
2024-12-20Also lint on option of function pointer comparisonsUrgau-2/+50
2024-12-20Add test to ensure passing `--doctest_compilation_args` multiple times workGuillaume Gomez-1/+24
2024-12-20Move test into the `tests.rs` fileGuillaume Gomez-23/+22
2024-12-20Add explanations on how arguments are splitGuillaume Gomez-0/+19
2024-12-20Split arguments from `--doctest-compilation-args` like a shell wouldGuillaume Gomez-8/+64
2024-12-20Update `run-make/rustdoc-default-output` testGuillaume Gomez-2/+4
2024-12-20Auto merge of #134582 - matthiaskrgr:rollup-i0oyqjw, r=matthiaskrgrbors-299/+297
Rollup of 8 pull requests Successful merges: - #134556 ([tiny] fix missing ns units in bootstrap's benchmark rendering) - #134560 (mri: add track_caller to thread spawning methods for better backtraces) - #134561 (Reduce the amount of explicit FatalError.raise()) - #134562 (tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore) - #134567 (Remove some dead code around import library generation) - #134570 (remove reference to dangling from slice::Iter) - #134573 (unimplement `PointerLike` for trait objects) - #134574 (next-solver: disable unnecessary hack) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-20Rollup merge of #134574 - lcnr:opaque-ty-hack-yeet, r=compiler-errorsMatthias Krüger-11/+14
next-solver: disable unnecessary hack the new solver never constrains inference variables to normalizeable aliases, so this is no longer necessary.
2024-12-20Rollup merge of #134573 - lukas-code:unimpl-dyn-pointerlike, r=compiler-errorsMatthias Krüger-93/+217
unimplement `PointerLike` for trait objects Values of type `dyn* PointerLike` or `dyn PointerLike` are not pointer-like so these types should not implement `PointerLike`. After https://github.com/rust-lang/rust/pull/133226, `PointerLike` allows user implementations, so we can't just mark it with `#[rustc_deny_explicit_impl(implement_via_object = false)]`. Instead, this PR splits the `#[rustc_deny_explicit_impl(implement_via_object = ...)]` attribute into two separate attributes `#[rustc_deny_explicit_impl]` and `#[rustc_do_not_implement_via_object]` so that we opt out of the automatic `impl PointerLike for dyn PointerLike` and still allow user implementations. For traits that are marked with `#[do_not_implement_via_object]` but not `#[rustc_deny_explicit_impl]` I've also made it possible to add a manual `impl Trait for dyn Trait`. There is no immediate need for this, but it was one line to implement and seems nice to have. fixes https://github.com/rust-lang/rust/issues/134545 fixes https://github.com/rust-lang/rust/issues/134543 r? `@compiler-errors`
2024-12-20Rollup merge of #134570 - hkBst:patch-3, r=joboetMatthias Krüger-1/+1
remove reference to dangling from slice::Iter This aligns the comment with reality and with IterMut. Also dangling does not seem to take any arguments.
2024-12-20Rollup merge of #134567 - bjorn3:remove_unused_code, r=compiler-errorsMatthias Krüger-78/+0
Remove some dead code around import library generation This was missed when replacing the usage of LLVM for generating import libraries. ``@bors`` rollup
2024-12-20Rollup merge of #134562 - taiki-e:codegen-asm-minicore, r=jieyouxuMatthias Krüger-74/+36
tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore Similar to https://github.com/rust-lang/rust/pull/134385 (for tests/ui/asm) and https://github.com/rust-lang/rust/pull/134436 (for tests/assembly/asm), but for tests/codegen/asm. r? jieyouxu
2024-12-20Rollup merge of #134561 - bjorn3:less_fatal_error_raise, r=compiler-errorsMatthias Krüger-41/+22
Reduce the amount of explicit FatalError.raise() Instead use dcx.abort_if_error() or guar.raise_fatal() instead. These guarantee that an error actually happened previously and thus we don't silently abort.
2024-12-20Rollup merge of #134560 - RalfJung:miri-thread-spawn, r=jhprattMatthias Krüger-0/+6
mri: add track_caller to thread spawning methods for better backtraces This is in preparation for https://github.com/rust-lang/miri/pull/4093
2024-12-20Rollup merge of #134556 - the8472:restore-ns-units, r=jieyouxuMatthias Krüger-1/+1
[tiny] fix missing ns units in bootstrap's benchmark rendering
2024-12-20Auto merge of #134564 - Kobzol:revert-aarch64-runner, r=nikicbors-129/+99
Revert "Auto merge of #133809 - mrkajetanp:ci-aarch64-dist, r=Kobzol" This reverts https://github.com/rust-lang/rust/pull/133809, as it produced broken aarch64 artifacts (https://github.com/rust-lang/rust/issues/134563). `@bors` p=1
2024-12-20next-solver: rm opaque type hacklcnr-11/+14
2024-12-20remove reference to dangling from slice::IterMarijn Schouten-1/+1
This aligns the comment with reality and with IterMut. Also dangling does not seem to take any arguments.
2024-12-20Restrict `#[non_exaustive]` on structs with default field valuesEsteban Küber-3/+78
Do not allow users to apply `#[non_exaustive]` to a struct when they have also used default field values.
2024-12-20fix `PointerLike` docsLukas Markeffsky-2/+2
2024-12-20unimplement `PointerLike` for trait objectsLukas Markeffsky-0/+63
2024-12-20split up `#[rustc_deny_explicit_impl]` attributeLukas Markeffsky-91/+152
This commit splits the `#[rustc_deny_explicit_impl(implement_via_object = ...)]` attribute into two attributes `#[rustc_deny_explicit_impl]` and `#[rustc_do_not_implement_via_object]`. This allows us to have special traits that can have user-defined impls but do not have the automatic trait impl for trait objects (`impl Trait for dyn Trait`).
2024-12-20Remove some dead code around import library generationbjorn3-78/+0
This was missed when replacing the usage of LLVM for generating import libraries.
2024-12-20Revert "Auto merge of #133809 - mrkajetanp:ci-aarch64-dist, r=Kobzol"Jakub Beránek-129/+99
This reverts commit 023521e6825edfa6df01e392520d7cb120eab158, reversing changes made to c434b4b4b6cd20560c5b32e80b2b22618a4da3dd.
2024-12-20Auto merge of #134559 - DianQK:rollup-22iraj9, r=DianQKbors-189/+206
Rollup of 5 pull requests Successful merges: - #134366 (Fix logical error with what text is considered whitespace.) - #134514 (Improve dependency_format a bit) - #134519 (ci: use ubuntu `24` instead of `latest`) - #134551 (coverage: Rename `basic_coverage_blocks` to just `graph`) - #134553 (add member constraints comment) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-20tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by ↵Taiki Endo-74/+36
using minicore
2024-12-20Add explanations about `--doctest-compilation-args` in rustdoc bookGuillaume Gomez-18/+76
2024-12-20Add regression test for `--doctest-compilation-args`Guillaume Gomez-0/+18
2024-12-20Add `--doctest-compilation-args` option to allow passing arguments to ↵Guillaume Gomez-1/+25
doctest compilation
2024-12-20Reduce the amount of explicit FatalError.raise()bjorn3-41/+22
Instead use dcx.abort_if_error() or guar.raise_fatal() instead. These guarantee that an error actually happened previously and thus we don't silently abort.
2024-12-20mri: add track_caller to thread spawning methods for better backtracesRalf Jung-0/+6
2024-12-20Rollup merge of #134553 - lcnr:member-constraints-comment, r=oli-obkDianQK-3/+6
add member constraints comment r? `@oli-obk` i guess
2024-12-20Rollup merge of #134551 - Zalathar:graph, r=lqdDianQK-93/+61
coverage: Rename `basic_coverage_blocks` to just `graph` During coverage instrumentation, this variable always holds the current function's coverage graph, which is a simplified view of its MIR control-flow graph. The new name is clearer in context, and also shorter. --- This is purely a rename, so there is no functional change.
2024-12-20Rollup merge of #134519 - MarcoIeni:ubuntu-latest-to-24, r=KobzolDianQK-5/+5
ci: use ubuntu `24` instead of `latest`
2024-12-20Rollup merge of #134514 - bjorn3:more_driver_refactors, r=jieyouxuDianQK-86/+100
Improve dependency_format a bit * Make `DependencyList` an `IndexVec` rather than emulating one using a `Vec` (which was off-by-one as LOCAL_CRATE was intentionally skipped) * Update some comments for the fact that we now use `#[global_allocator]` rather than `extern crate alloc_system;`/`extern crate alloc_jemalloc;` for specifying which allocator to use. We still use a similar mechanism for the panic runtime, so refer to the panic runtime in those comments instead. * An unrelated refactor to `create_and_enter_global_ctxt` I forgot to include in https://github.com/rust-lang/rust/pull/134302. This refactor is too small to be worth it's own PR.
2024-12-20Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwcoDianQK-2/+34
Fix logical error with what text is considered whitespace. There appears to be a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space. In that case the subtraction will cause a ICE (for a compiler in debug mode) as described in https://github.com/rust-lang/rust/issues/132918.
2024-12-20fix missing ns units in bootstrap's benchmark renderingThe 8472-1/+1
2024-12-20Arbitrary self types v2: no deshadow pre feature.Adrian Taylor-0/+50
The arbitrary self types v2 work introduces a check for shadowed methods, whereby a method in some "outer" smart pointer type may called in preference to a method in the inner referent. This is bad if the outer pointer adds a method later, as it may change behavior, so we ensure we error in this circumstance. It was intended that this new shadowing detection system only comes into play for users who enable the `arbitrary_self_types` feature (or of course everyone later if it's stabilized). It was believed that the new deshadowing code couldn't be reached without building the custom smart pointers that `arbitrary_self_types` enables, and therefore there was no risk of this code impacting existing users. However, it turns out that cunning use of `Pin::get_ref` can cause this type of shadowing error to be emitted now. This commit adds a test for this case.
2024-12-20add commentslcnr-3/+6