about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-09-16Revert "Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic"Tyler Mandry-7/+3
This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278.
2024-08-31Auto merge of #129817 - matthiaskrgr:rollup-ll2ld5m, r=matthiaskrgrbors-3490/+11015
Rollup of 12 pull requests Successful merges: - #129659 (const fn stability checking: also check declared language features) - #129711 (Expand NLL MIR dumps) - #129730 (f32 docs: define 'arithmetic' operations) - #129733 (Subtree update of `rust-analyzer`) - #129749 (llvm-wrapper: adapt for LLVM API changes) - #129757 (Add a test for trait solver overflow in MIR inliner cycle detection) - #129760 (Make the "detect-old-time" UI test more representative) - #129767 (Remove `#[macro_use] extern crate tracing`, round 4) - #129774 (Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt) - #129785 (Miri subtree update) - #129791 (mark joboet as on vacation) - #129812 (interpret, codegen: tweak some comments and checks regarding Box with custom allocator) Failed merges: - #129777 (Add `unreachable_pub`, round 4) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-31Rollup merge of #129812 - RalfJung:box-custom-alloc, r=compiler-errorsMatthias Krüger-6/+15
interpret, codegen: tweak some comments and checks regarding Box with custom allocator Cc https://github.com/rust-lang/rust/issues/95453
2024-08-31Rollup merge of #129791 - joboet:ich_bin_dann_mal_weg, r=joboetMatthias Krüger-1/+1
mark joboet as on vacation I'll be on vacation for about three weeks and won't have much time for reviewing. r? ````@ghost````
2024-08-31Rollup merge of #129785 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-441/+1197
Miri subtree update r? ```@ghost```
2024-08-31Rollup merge of #129774 - nnethercote:rm-extern-crate-tracing-remainder, ↵Matthias Krüger-10/+49
r=GuillaumeGomez Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt A follow-up to #129767 and earlier PRs doing this for `rustc_*` crates. r? ```@GuillaumeGomez```
2024-08-31Rollup merge of #129767 - nnethercote:rm-extern-crate-tracing-4, r=jieyouxuMatthias Krüger-18/+211
Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from #124511, #124914, and #125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```
2024-08-31Rollup merge of #129760 - cuviper:old-timey, r=compiler-errorsMatthias Krüger-8/+16
Make the "detect-old-time" UI test more representative The test code did have an inference failure, but that would have failed on Rust 1.79 and earlier too. Now it is rewritten to be specifically affected by 1.80's `impl FromIterator<_> for Box<str>`.
2024-08-31Rollup merge of #129757 - saethlin:half-a-recursion, r=compiler-errorsMatthias Krüger-0/+32
Add a test for trait solver overflow in MIR inliner cycle detection This test is a combination of the reproducer posted here: https://github.com/rust-lang/rust/issues/128887#issuecomment-2314198229 and the existing test for polymorphic recursion: https://github.com/rust-lang/rust/blob/784d444733d65c3d305ce5edcbb41e3d0d0aee2e/tests/mir-opt/inline/polymorphic_recursion.rs r? ```@compiler-errors```
2024-08-31Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikicMatthias Krüger-3/+7
llvm-wrapper: adapt for LLVM API changes No functional changes intended. Updates the wrapper for https://github.com/5c4lar/llvm-project/commit/21eddfac3d75879b3e0b09c5bc848526dcab6ab0. ````@rustbot```` label: +llvm-main r? ````@nikic````
2024-08-31Rollup merge of #129733 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-2888/+9203
Subtree update of `rust-analyzer` r? ````@ghost````
2024-08-31Rollup merge of #129730 - RalfJung:float-arithmetic, r=workingjubileeMatthias Krüger-44/+48
f32 docs: define 'arithmetic' operations r? ````@workingjubilee```` Fixes https://github.com/rust-lang/rust/issues/129699
2024-08-31Rollup merge of #129711 - lqd:nll-mir-dumps, r=compiler-errorsMatthias Krüger-64/+214
Expand NLL MIR dumps This PR is a first step to clean up and expand NLL MIR dumps: - by restoring the "mir-include-spans" comments which are useful for `-Zdump-mir=nll` - by adding the list of borrows to NLL MIR dumps, where they are introduced in the CFG and in which region Comments in MIR dumps were turned off in #112346, but as shown in #114652 they were still useful for us working with NLL MIR dumps. So this PR pulls `-Z mir-include-spans` into its own options struct, so that passes dumping MIR can override them if need be. The rest of the compiler is not affected, only the "nll" pass dumps have these comments enabled again. The CLI still has priority when specifying the flag, so that we can explicitly turn them off in the `mir-opt` tests to keep blessed dumps easier to work with (which was one of the points of #112346). Then, as part of a couple steps to improve NLL/polonius MIR dumps and `.dot` visualizations, I've also added the list of borrows and where they're introduced. I'm doing all this to help debug some polonius scope issues in my prototype location-sensitive analysis :3. I'll probably add member constraints soon.
2024-08-31Rollup merge of #129659 - RalfJung:const-fn-lang-feat, r=fee1-deadMatthias Krüger-7/+22
const fn stability checking: also check declared language features Fixes https://github.com/rust-lang/rust/issues/129656 `@oli-obk` I assume it is just an oversight that this didn't use `features().declared()`? Or is there a deep reason that this must only check `declared_lib_features`?
2024-08-31const fn stability checking: also check declared language featuresRalf Jung-7/+22
2024-08-31interpret, codegen: tweak some comments and checks regarding Box with custom ↵Ralf Jung-6/+15
allocator
2024-08-31Auto merge of #129809 - matthiaskrgr:rollup-cyygnxh, r=matthiaskrgrbors-2693/+2833
Rollup of 15 pull requests Successful merges: - #120221 (Don't make statement nonterminals match pattern nonterminals) - #126183 (Separate core search logic with search ui) - #129123 (rustdoc-json: Add test for `Self` type) - #129366 (linker: Synchronize native library search in rustc and linker) - #129527 (Don't use `TyKind` in a lint) - #129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - #129640 (Re-enable android tests/benches in alloc/core) - #129642 (Bump backtrace to 0.3.74~ish) - #129675 (allow BufReader::peek to be called on unsized types) - #129723 (Simplify some extern providers) - #129724 (Remove `Option<!>` return types.) - #129725 (Stop using `ty::GenericPredicates` for non-predicates_of queries) - #129731 (Allow running `./x.py test compiler`) - #129751 (interpret/visitor: make memory order iteration slightly more efficient) - #129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-31Rollup merge of #129754 - alexcrichton:fix-wasi-long-sleep, r=workingjubileeMatthias Krüger-30/+31
wasi: Fix sleeping for `Duration::MAX` This commit fixes an assert in the WASI-specific implementation of thread sleep to ensure that sleeping for a very large period of time blocks instead of panicking. This can come up when testing programs that sleep "forever", for example. I'll note that I haven't included a test for this since it's sort of difficult to test. I've tested this locally though that long sleeps do indeed block and short sleeps still only sleep for a short amount of time.
2024-08-31Rollup merge of #129751 - RalfJung:interpret-visit-field-order, ↵Matthias Krüger-17/+15
r=compiler-errors interpret/visitor: make memory order iteration slightly more efficient Finally I know enough about RPIT to write this iterator signature correctly. :D This means memory-order iteration now needs an allocation, but it avoids quadratic complexity (where it has to do a linear scan n times to find the n-th field in memory order), so that seems like a win overall. The changed code only affects Miri; the rustc changes are NOPs.
2024-08-31Rollup merge of #129731 - ferrocene:x-test-compiler, r=onur-ozkanMatthias Krüger-8/+3
Allow running `./x.py test compiler`
2024-08-31Rollup merge of #129725 - compiler-errors:predicates-of, r=fmeaseMatthias Krüger-98/+101
Stop using `ty::GenericPredicates` for non-predicates_of queries `GenericPredicates` is a struct of several parts: A list of of an item's own predicates, and a parent def id (and some effects related stuff, but ignore that since it's kinda irrelevant). When instantiating these generic predicates, it calls `predicates_of` on the parent and instantiates its predicates, and appends the item's own instantiated predicates too: https://github.com/rust-lang/rust/blob/acb4e8b6251f1d8da36f08e7a70fa23fc581839e/compiler/rustc_middle/src/ty/generics.rs#L407-L413 Notice how this should result in a recursive set of calls to `predicates_of`... However, `GenericPredicates` is *also* misused by a bunch of *other* queries as a convenient way of passing around a list of predicates. For these queries, we don't ever set the parent def id of the `GenericPredicates`, but if we did, then this would be very easy to mistakenly call `predicates_of` instead of some other intended parent query. Given that footgun, and the fact that we don't ever even *use* the parent def id in the `GenericPredicates` returned from queries like `explicit_super_predicates_of`, It really has no benefit over just returning `&'tcx [(Clause<'tcx>, Span)]`. This PR additionally opts to wrap the results of `EarlyBinder`, as we've tended to use that in the return type of these kinds of queries to properly convey that the user has params to deal with, and it also gives a convenient way of iterating over a slice of things after instantiating.
2024-08-31Rollup merge of #129724 - nnethercote:rm-Option-bang, r=fee1-deadMatthias Krüger-66/+68
Remove `Option<!>` return types. Several compiler functions have `Option<!>` for their return type. That's odd. The only valid return value is `None`, so why is this type used? Because it lets you write certain patterns slightly more concisely. E.g. if you have these common patterns: ``` let Some(a) = f() else { return }; let Ok(b) = g() else { return }; ``` you can shorten them to these: ``` let a = f()?; let b = g().ok()?; ``` Huh. An `Option` return type typically designates success/failure. How should I interpret the type signature of a function that always returns (i.e. doesn't panic), does useful work (modifying `&mut` arguments), and yet only ever fails? This idiom subverts the type system for a cute syntactic trick. Furthermore, returning `Option<!>` from a function F makes things syntactically more convenient within F, but makes things worse at F's callsites. The callsites can themselves use `?` with F but should not, because they will get an unconditional early return, which is almost certainly not desirable. Instead the return value should be ignored. (Note that some of callsites of `process_operand`, `process_immedate`, `process_assign` actually do use `?`, though the early return doesn't matter in these cases because nothing of significance comes after those calls. Ugh.) When I first saw this pattern I had no idea how to interpret it, and it took me several minutes of close reading to understand everything I've written above. I even started a Zulip thread about it to make sure I understood it properly. "Save a few characters by introducing types so weird that compiler devs have to discuss it on Zulip" feels like a bad trade-off to me. This commit replaces all the `Option<!>` return values and uses `else`/`return` (or something similar) to replace the relevant `?` uses. The result is slightly more verbose but much easier to understand. r? ``````@cjgillot``````
2024-08-31Rollup merge of #129723 - compiler-errors:extern-providers, r=lcnrMatthias Krüger-43/+21
Simplify some extern providers Simplifies some extern crate providers: 1. Generalize the `ProcessQueryValue` identity impl to work on non-`Option` types. 2. Allow `ProcessQueryValue` to wrap its output in an `EarlyBinder`, to simplify `explicit_item_bounds`/`explicit_item_super_predicates`. 3. Use `{ table }` and friends more when possible.
2024-08-31Rollup merge of #129675 - lolbinarycat:bufreader_peek_unsized, r=workingjubileeMatthias Krüger-0/+2
allow BufReader::peek to be called on unsized types #128405
2024-08-31Rollup merge of #129642 - workingjubilee:bump-backtrace-fc37b22, ↵Matthias Krüger-0/+0
r=workingjubilee Bump backtrace to 0.3.74~ish Commit: https://github.com/rust-lang/backtrace-rs/commit/230570f This should help with backtraces on Android, QNX NTO 7.0, and Windows. It addresses a case of backtrace incurring undefined behavior on Android.
2024-08-31Rollup merge of #129640 - saethlin:unignore-android-in-alloc, r=tgross35Matthias Krüger-25/+5
Re-enable android tests/benches in alloc/core This is basically a revert of https://github.com/rust-lang/rust/pull/73729. These tests better work on android now; it's been 4 years and we don't use dlmalloc on that target anymore. And I've validated that they should pass now with a try-build :)
2024-08-31Rollup merge of #129534 - workingjubilee:ratchet-wasm-c-abi-fcw-to-deny, ↵Matthias Krüger-1/+1
r=daxpedda,alexcrichton Deny `wasm_c_abi` lint to nudge the last 25% This shouldn't affect projects indirectly depending on wasm-bindgen because cargo passes `--cap-lints=allow` when building dependencies. The motivation is that the ecosystem has mostly taken up the versions of wasm-bindgen that are compatible in general, but ~25% or so of recent downloads remain on lower versions. However, this change might still be unnecessarily disruptive. I mostly propose it as a discussion point.
2024-08-31Rollup merge of #129527 - compiler-errors:lint-nit, r=NadrierilMatthias Krüger-20/+14
Don't use `TyKind` in a lint Allows us to remove an inherent method from `TyKind` from the type ir crate.
2024-08-31Rollup merge of #129366 - petrochenkov:libsearch, r=jieyouxuMatthias Krüger-62/+130
linker: Synchronize native library search in rustc and linker Also search for static libraries with alternative naming (`libname.a`) on MSVC when producing executables or dynamic libraries, and not just rlibs. This unblocks https://github.com/rust-lang/rust/pull/123436. try-job: x86_64-msvc
2024-08-31Rollup merge of #129123 - aDotInTheVoid:rustdoc-json-self, r=fmeaseMatthias Krüger-0/+58
rustdoc-json: Add test for `Self` type Inspired by #128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one. I've also manually checked locally that this test passes on 29e924841f06bb181d87494eba2783761bc1ddec, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in #128522) Updates #81359 r? ````````@fmease````````
2024-08-31Rollup merge of #126183 - Folyd:search-core, r=GuillaumeGomez,notriddleMatthias Krüger-2281/+2319
Separate core search logic with search ui Currenty, the `search.js` mixed with UI/DOM manipulation codes and search logic codes, I propose to extract the search logic to a class for following benefits: - Clean code. Separation of DOM manipulation and search logic can lead better code maintainability and easy code testings. - Easy share the search logic for third party to utilize the search function, such as [Rust Search Extension](https://rust.extension.sh), https://query.rs. This PR added a new class called `DocSearch`, which mainly expose following methods: ```js class DocSearch { // Dependency inject searchIndex, rootPath and searchState constructor(rawSearchIndex, rootPath, searchState) { // build search index... } static parseQuery(userQuery) { } async execQuery(parsedQuery, filterCrates, currentCrate) { } } ```
2024-08-31Rollup merge of #120221 - compiler-errors:statements-are-not-patterns, ↵Matthias Krüger-42/+65
r=nnethercote Don't make statement nonterminals match pattern nonterminals Right now, the heuristic we use to check if a token may begin a pattern nonterminal falls back to `may_be_ident`: https://github.com/rust-lang/rust/blob/ef71f1047e04438181d7cb925a833e2ada6ab390/compiler/rustc_parse/src/parser/nonterminal.rs#L21-L37 This has the unfortunate side effect that a `stmt` nonterminal eagerly matches against a `pat` nonterminal, leading to a parse error: ```rust macro_rules! m { ($pat:pat) => {}; ($stmt:stmt) => {}; } macro_rules! m2 { ($stmt:stmt) => { m! { $stmt } }; } m2! { let x = 1 } ``` This PR fixes it by more accurately reflecting the set of nonterminals that may begin a pattern nonterminal. As a side-effect, I modified `Token::can_begin_pattern` to work correctly and used that in `Parser::nonterminal_may_begin_with`.
2024-08-31Auto merge of #129797 - workingjubilee:cleanup-apple-ci, r=workingjubileebors-8/+23
Try to reduce space usage in dist CI We have had recurrent CI problems as a result of GitHub adding a new version of Xcode to its runners[^0], which has consumed ~40GB of space which served as padding. Try to reduce the number of Xcodes on our systems, because we only use Xcode 14 in actual practice. Also, try to move files instead of pointlessly copy them when we're at the end of the job. I could not resist addressing a few shellcheck lints while I was at it. [^0]: https://github.com/actions/runner-images/issues/10511
2024-08-30ci: Take tail instead of head to avoid broken pipesJubilee Young-3/+1
2024-08-30ci: Avoid legacy backticks in upload-artifacts.shJubilee Young-1/+1
2024-08-30ci: Use mv instead of cp in upload stepJubilee Young-4/+4
2024-08-30ci: Try to remove unused Xcode dirsJubilee Young-0/+17
2024-08-30mark joboet as on vacationjoboet-1/+1
2024-08-30enumerate the two parts of the NaN rulesRalf Jung-20/+21
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_hir_typeck`.Nicholas Nethercote-3/+29
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_trait_selection`.Nicholas Nethercote-3/+48
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_hir_analysis`.Nicholas Nethercote-3/+31
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_borrowck`.Nicholas Nethercote-3/+38
2024-08-30add borrows to NLL MIR dumpsRémy Rakic-1/+24
explicitly disable `-Zmir-include-spans` in mir-opt tests This will override the NLL default of true, and keep the blessed dumps easier to work with.
2024-08-30refactor NLL MIR dump entry pointRémy Rakic-15/+23
2024-08-30enable extra comments in NLL MIR dumpsRémy Rakic-21/+40
2024-08-30make `-Z mir-include-spans` a dedicated enumRémy Rakic-7/+44
We want to allow setting this on the CLI, override it only in MIR passes, and disable it altogether in mir-opt tests. The default value is "only for NLL MIR dumps", which is considered off for all intents and purposes, except for `rustc_borrowck` when an NLL MIR dump is requested.
2024-08-30introduce `PrettyPrintMirOptions` for cosmetic MIR dump optionsRémy Rakic-29/+92
initially starting with `-Z mir-include-spans` because we want them in the NLL mir dump pass
2024-08-30add hyphen in floating-pointRalf Jung-12/+12
2024-08-30Auto merge of #3853 - rust-lang:rustup-2024-08-30, r=saethlinbors-1101/+2363
Automatic Rustup