about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-31raw_eq: using it on bytes with provenance is not UB (outside const-eval)Ralf Jung-35/+9
2024-07-31Auto merge of #128435 - matthiaskrgr:rollup-l76vu3i, r=matthiaskrgrbors-1030/+1415
Rollup of 9 pull requests Successful merges: - #126454 (bump-stage0: use IndexMap for determinism) - #127681 (derive(SmartPointer): rewrite bounds in where and generic bounds) - #127830 (When an archive fails to build, print the path) - #128151 (Structured suggestion for `extern crate foo` when `foo` isn't resolved in import) - #128387 (More detailed note to deprecate ONCE_INIT) - #128388 (Match LLVM ABI in `extern "C"` functions for `f128` on Windows) - #128402 (Attribute checking simplifications) - #128412 (Remove `crate_level_only` from `ELIDED_LIFETIMES_IN_PATHS`) - #128430 (Use a separate pattern type for `rustc_pattern_analysis` diagnostics ) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-31Rollup merge of #128430 - Zalathar:print-pat, r=NadrierilMatthias Krüger-204/+216
Use a separate pattern type for `rustc_pattern_analysis` diagnostics The pattern-analysis code needs to print patterns, as part of its user-visible diagnostics. But it never actually tries to print "real" patterns! Instead, it only ever prints synthetic patterns that it has reconstructed from its own internal represenations. We can therefore simultaneously remove two obstacles to changing `thir::Pat`, by having the pattern-analysis code use its own dedicated type for building printable patterns, and then making `thir::Pat` not printable at all. r? `@Nadrieril`
2024-07-31Rollup merge of #128412 - compiler-errors:crate-level-only, r=cjgillotMatthias Krüger-2/+32
Remove `crate_level_only` from `ELIDED_LIFETIMES_IN_PATHS` As far as I can tell, we provide the right node id to the `ELIDED_LIFETIMES_IN_PATHS` lint: https://github.com/rust-lang/rust/blob/f8060d282d42770fadd73905e3eefb85660d3278/compiler/rustc_resolve/src/late.rs#L2015-L2027 So I've gone ahead and removed the restriction from this lint.
2024-07-31Rollup merge of #128402 - oli-obk:checked_attrs, r=compiler-errorsMatthias Krüger-367/+179
Attribute checking simplifications remove an unused boolean and then merge two big matches into one I was reviewing some attributes and realized we don't really check this list against the list of builtin attributes, so we "may" totally be missing some attributes that we should be checking (like the `coroutine` attribute, which you can just apply to random stuff) ```rust #![feature(coroutines)] #[coroutine] struct Foo; ``` just compiles for example. Unless we check that the fallthrough match arm is never reached for builtin attributes, we're just going to keep forgetting to add them here, too. I can do that without the changes in this PR, but it seemed like a nice cleanup
2024-07-31Rollup merge of #128388 - beetrees:f16-f128-slightly-improve-windows-abi, ↵Matthias Krüger-4/+49
r=tgross35 Match LLVM ABI in `extern "C"` functions for `f128` on Windows As MSVC doesn't support `_Float128`, x86-64 Windows doesn't have a defined ABI for `f128`. Currently, Rust will pass and return `f128` indirectly for `extern "C"` functions. This is inconsistent with LLVM, which passes and returns `f128` in XMM registers, meaning that e.g. the ABI of `extern "C"` compiler builtins won't match. This PR fixes this discrepancy by making the x86-64 Windows `extern "C"` ABI pass `f128` directly through to LLVM, so that Rust will follow whatever LLVM does. This still leaves the difference between LLVM and GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054) but this PR is still an improvement as at least Rust is now consistent with it's primary codegen backend and compiler builtins from `compiler-builtins` will now work. I've also fixed the x86-64 Windows `has_reliable_f16` match arm in `std` `build.rs` to refer to the correct target, and added an equivalent match arm to `has_reliable_f128` as the LLVM-GCC ABI difference affects both `f16` and `f128`. Tracking issue: #116909 try-job: x86_64-msvc try-job: x86_64-mingw
2024-07-31Rollup merge of #128387 - liigo:patch-14, r=tgross35Matthias Krüger-1/+1
More detailed note to deprecate ONCE_INIT
2024-07-31Rollup merge of #128151 - estebank:missing-extern-crate, r=petrochenkovMatthias Krüger-64/+192
Structured suggestion for `extern crate foo` when `foo` isn't resolved in import When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate. When encountering `_` in an import, do not suggest `extern crate _;`. ``` error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-3.rs:2:9 | LL | use spam::*; | ^^^^ maybe a missing crate `spam`? | help: consider importing the `spam` crate | LL + extern crate spam; | ```
2024-07-31Rollup merge of #127830 - tgross35:archive-failure-message, r=BoxyUwUMatthias Krüger-6/+12
When an archive fails to build, print the path Currently the output on failure is as follows: Compiling block-buffer v0.10.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling sha2 v0.10.8 Compiling xz2 v0.1.7 error: failed to build archive: No such file or directory error: could not compile `bootstrap` (lib) due to 1 previous error Change this to print which file is being constructed, to give some hint about what is going on. error: failed to build archive at `path/to/output`: No such file or directory
2024-07-31Rollup merge of #127681 - dingxiangfei2009:smart-ptr-bounds, r=compiler-errorsMatthias Krüger-17/+371
derive(SmartPointer): rewrite bounds in where and generic bounds Fix #127647 Due to the `Unsize` bounds, we need to commute the bounds on the pointee type to the new self type. cc ```@Darksonn```
2024-07-31Rollup merge of #126454 - cuviper:deterministic-bump, r=KobzolMatthias Krüger-365/+363
bump-stage0: use IndexMap for determinism When it used `HashMap`, `bump-stage0` would change `src/stage0` every time it ran, whereas `IndexMap` will keep insertion order -- matching the manifest file. I included an actual bump here mainly to reset the order, but that did update to a new rustfmt nightly too.
2024-07-31Auto merge of #127513 - nikic:llvm-19, r=cuviperbors-46/+53
Update to LLVM 19 The LLVM 19.1.0 final release is planned for Sep 3rd. The rustc 1.82 stable release will be on Oct 17th. The unstable MC/DC coverage support is temporarily broken by this update. It will be restored by https://github.com/rust-lang/rust/pull/126733. The implementation changed substantially in LLVM 19, and there are no plans to support both the LLVM 18 and LLVM 19 implementation at the same time. Compatibility note for wasm: > WebAssembly target support for the `multivalue` target feature has changed when upgrading to LLVM 19. Support for generating functions with multiple returns no longer works and `-Ctarget-feature=+multivalue` has a different meaning than it did in LLVM 18 and prior. The WebAssembly target features `multivalue` and `reference-types` are now both enabled by default, but generated code is not affected by default. These features being enabled are encoded in the `target_features` custom section and may affect downstream tooling such as `wasm-opt` consuming the module, but the actual generated WebAssembly will continue to not use either `multivalue` or `reference-types` by default. There is no longer any supported means to generate a module that has a function with multiple returns. Related changes: * https://github.com/rust-lang/rust/pull/127605 * https://github.com/rust-lang/rust/pull/127613 * https://github.com/rust-lang/rust/pull/127654 * https://github.com/rust-lang/rust/pull/128141 * https://github.com/llvm/llvm-project/pull/98933 Fixes https://github.com/rust-lang/rust/issues/121444. Fixes https://github.com/rust-lang/rust/issues/128212.
2024-07-31Auto merge of #128420 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 5 commits in b5d44db1daf0469b227a6211b987162a39a54730..257b72b8adfb1f2aa9916cefca67285c21666276 2024-07-26 21:27:12 +0000 to 2024-07-30 15:08:27 +0000 - chore: Update toml (rust-lang/cargo#14324) - dont call wrap in a no-op source_id::with* (rust-lang/cargo#14318) - Partial revert of 3085b548ecbd7d29d40c6180609ea3c224bad857 (rust-lang/cargo#14319) - chore(deps): update msrv (rust-lang/cargo#14303) - Fix warnings building tests on Windows (rust-lang/cargo#14315) r? ghost
2024-07-31Use a separate pattern type for `rustc_pattern_analysis` diagnosticsZalathar-169/+209
The pattern-analysis code needs to print patterns, as part of its user-visible diagnostics. But it never actually tries to print "real" patterns! Instead, it only ever prints synthetic patterns that it has reconstructed from its own internal represenations. We can therefore simultaneously remove two obstacles to changing `thir::Pat`, by having the pattern-analysis code use its own dedicated type for building printable patterns, and then making `thir::Pat` not printable at all.
2024-07-31Revert "Make `thir::Pat` not implement `fmt::Display` directly"Zalathar-46/+19
This reverts commit ae0ec731a86ac6a2f6d8d08c4996bb8a438afdc2. The original change in #128304 was intended to be a step towards being able to print `thir::Pat` even after switching to `PatId`. But because the only patterns that need to be printed are the synthetic ones created by pattern analysis (for diagnostic purposes only), it makes more sense to completely separate the printable patterns from the real THIR patterns.
2024-07-31Print `thir::PatRange`, not its surrounding `thir::Pat`Zalathar-8/+7
This further reduces the amount of code that relies on `thir::Pat` being printable.
2024-07-30Update cargoWeihang Lo-0/+0
2024-07-30Bless coverage/mcdc for line number changesJosh Stone-42/+42
2024-07-31Auto merge of #128075 - Oneirical:try-your-damnetest, r=jieyouxubors-96/+224
Migrate `rlib-format-packed-bundled-libs-2`, `native-link-modifier-whole-archive` and `no-builtins-attribute` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: test-various try-job: armhf-gnu try-job: aarch64-apple try-job: x86_64-gnu-llvm-18
2024-07-30Bump src/stage0 with determinismJosh Stone-361/+361
2024-07-30bump-stage0: use IndexMap for determinismJosh Stone-4/+2
When it used `HashMap`, `bump-stage0` would change `src/stage0` every time it ran, whereas `IndexMap` will keep insertion order -- matching the manifest file.
2024-07-30Auto merge of #128413 - matthiaskrgr:rollup-nrfcvdq, r=matthiaskrgrbors-40/+162
Rollup of 7 pull requests Successful merges: - #128357 (Detect non-lifetime binder params shadowing item params) - #128367 (CI: rfl: build the generated doctests and documentation) - #128376 (Mark `Parser::eat`/`check` methods as `#[must_use]`) - #128379 (the output in stderr expects panic-unwind) - #128380 (make `///` doc comments compatible with naked functions) - #128382 (cargo-miri: better error when we seem to run inside bootstrap but something is wrong) - #128398 (tidy: Fix quote in error message) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-30Rollup merge of #128398 - awilfox:awilfox/fix-tidy-quote, r=jieyouxuMatthias Krüger-1/+1
tidy: Fix quote in error message I noticed that the backticks around the error code wasn't done properly in this string when I was building Rust 1.80.0 and found it is still this way in nightly. Example: ``` warning: Error code `E0595` needs to have at least one UI test in the `tests/error-codes/` directory`! warning: Error code E0602`` has a UI test file, but doesn't contain its own error code! warning: Error code `E0619` needs to have at least one UI test in the `tests/error-codes/` directory`! ``` This commit fixes it to match the other warning strings.
2024-07-30Rollup merge of #128382 - RalfJung:cargo-miri-assert, r=oli-obkMatthias Krüger-1/+4
cargo-miri: better error when we seem to run inside bootstrap but something is wrong Cc https://github.com/rust-lang/miri/issues/3775
2024-07-30Rollup merge of #128380 - folkertdev:naked-compatible-doc-comment, r=bjorn3Matthias Krüger-0/+9
make `///` doc comments compatible with naked functions tracking issue: https://github.com/rust-lang/rust/issues/90957 reported in https://github.com/rust-lang/rust/pull/127853#issuecomment-2257323333 it turns out `/// doc comment` and `#[doc = "doc comment"]` are represented differently, at least at the point where we perform the check for what should be allowed. The `///` style doc comment is now also allowed. r? ``@bjorn3`` cc ``@hsanzg``
2024-07-30Rollup merge of #128379 - Dajamante:aïssata_needs_unwind, r=pietroalbiniMatthias Krüger-2/+3
the output in stderr expects panic-unwind r​? ``@pietroalbini``
2024-07-30Rollup merge of #128376 - compiler-errors:finish-ur-vegetables, r=jieyouxuMatthias Krüger-18/+51
Mark `Parser::eat`/`check` methods as `#[must_use]` These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists). I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay. This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
2024-07-30Rollup merge of #128367 - ojeda:rfl-ci-build-doctests-and-docs, r=KobzolMatthias Krüger-1/+5
CI: rfl: build the generated doctests and documentation Cc ``@tgross35`` r? ``@Kobzol`` try-job: x86_64-rust-for-linux
2024-07-30Rollup merge of #128357 - compiler-errors:shadowed-non-lifetime-binder, ↵Matthias Krüger-17/+89
r=petrochenkov Detect non-lifetime binder params shadowing item params We should check that `for<T>` shadows `T` from an item in the same way that `for<'a>` shadows `'a` from an item. r? ``@petrochenkov`` since you're familiar w the nuances of rib kinds
2024-07-30Remove crate_level_only from ELIDED_LIFETIMES_IN_PATHSMichael Goulet-2/+32
2024-07-30Match LLVM ABI in `extern "C"` functions for `f128` on Windowsbeetrees-4/+49
2024-07-30derive(SmartPointer): rewrite bounds in where and generic boundsDing Xiang Fei-17/+371
2024-07-30Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68bors-635/+511
Bump bootstrap compiler to new beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30Auto merge of #124339 - oli-obk:supports_feature, r=wesleywiserbors-0/+27
allow overwriting the output of `rustc --version` Our wonderful bisection folk [have to work around](https://github.com/rust-lang/rust/issues/123276#issuecomment-2075001510) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for. This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by * choosing when to update rustc * choosing when to update dependencies * choosing which nightly features they are willing to take the breakage for The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency. This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too. This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by https://github.com/rust-lang/cargo-bisect-rustc/pull/335. I mainly want to establish a compiler team policy: > We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to. Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection. I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
2024-07-30Revert "opt-dist: dont overrwite config.toml when verifying"Mark Rousskov-14/+17
This reverts commit c81a40bbc02bb44aa99b3a94322dbf07e7a62ce1.
2024-07-30Attribute checking simplificationsOli Scherer-367/+179
remove an unused boolean and then merge two big matches into one
2024-07-30tidy: Fix quote in error messageA. Wilcox-1/+1
2024-07-30Suppress must_use on eat calls in rustfmtMichael Goulet-5/+7
2024-07-30Make RUSTC_OVERRIDE_VERSION_STRING overwrite the rendered version output, tooOli Scherer-1/+10
2024-07-30Test RUSTC_OVERRIDE_VERSION_STRINGOli Scherer-0/+18
2024-07-30Auto merge of #127955 - ↵bors-10/+55
chenyukang:yukang-fix-mismatched-delimiter-issue-12786, r=nnethercote Add limit for unclosed delimiters in lexer diagnostic Fixes #127868 The first commit shows the original diagnostic, and the second commit shows the changes.
2024-07-30More detailed note to deprecate ONCE_INITLiigo Zhuang-1/+1
2024-07-30Auto merge of #125929 - Bryanskiy:delegation-generics-3, r=petrochenkovbors-233/+702
Delegation: support generics for delegation from free functions (The PR was split from https://github.com/rust-lang/rust/pull/123958, explainer - https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) This PR implements generics inheritance from free functions to free functions and trait methods. #### free functions to free functions: ```rust fn to_reuse<T: Clone>(_: T) {} reuse to_reuse as bar; // desugaring: fn bar<T: Clone>(x: T) { to_reuse(x) } ``` Generics, predicates and signature are simply copied. Generic arguments in paths are ignored during generics inheritance: ```rust fn to_reuse<T: Clone>(_: T) {} reuse to_reuse::<u8> as bar; // desugaring: fn bar<T: Clone>(x: T) { to_reuse::<u8>(x) // ERROR: mismatched types } ``` Due to implementation limitations callee path is lowered without modifications. Therefore, it is a compilation error at the moment. #### free functions to trait methods: ```rust trait Trait<'a, A> { fn foo<'b, B>(&self, x: A, y: B) {...} } reuse Trait::foo; // desugaring: fn foo<'a, 'b, This: Trait<'a, A>, A, B>(this: &This, x: A, y: B) { Trait::foo(this, x, y) } ``` The inheritance is similar to the previous case but with some corrections: - `Self` parameter converted into `T: Trait` - generic parameters need to be reordered so that lifetimes go first Arguments are similarly ignored. --- In the future, we plan to support generic inheritance for delegating from all contexts to all contexts (from free/trait/impl to free/trait /impl). These cases were considered first as the simplest from the implementation perspective.
2024-07-30make `///` doc comments compatible with naked functionsFolkert-0/+9
2024-07-30cargo-miri: better error when we seem to run inside bootstrap but something ↵Ralf Jung-1/+4
is wrong
2024-07-30Crash test for issue 121444 has been fixedNikita Popov-2/+4
2024-07-30Disable MC/DC tests on LLVM 19Krasimir Georgiev-1/+6
Disable the tests and generate an error if MC/DC is used on LLVM 19. The support will be ported separately, as it is substantially different on LLVM 19, and there are no plans to support both versions.
2024-07-30Update to LLVM 19Nikita Popov-1/+1
2024-07-30Auto merge of #128336 - Bryanskiy:inst-binder-with-fresh, r=lcnrbors-24/+22
Use Vec in instantiate_binder_with_fresh_vars `FxHashMap` was replaced with a pre-computed `Vec` of infer vars. r? `@lcnr`
2024-07-30the output in stderr expects panic-unwindaissata-2/+3