summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-08-21Revert "Fix `x test lint-docs` when download-rustc is enabled"jyn-7/+0
This was not the correct fix. The problem was two-fold: - `download-rustc` didn't respect `llvm.assertions` - `rust-dev` was missing a bump to `download-ci-llvm-stamp` The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`.
2023-08-211.72.0 releaseMark Rousskov-1/+1
2023-08-17Auto merge of #11069 - y21:issue11063, r=Alexendoobors-6/+5
[`missing_fields_in_debug`]: make sure self type is an adt Fixes #11063, another ICE that can only happen in core. This lint needs the `DefId` of the implementor to get its fields, but that ICEs if the implementor does not have a `DefId` (as is the case with primitive types, e.g. `impl Debug for bool`), which is where this ICE comes from. This PR changes the check I added in #10897 to be more... robust against `Debug` implementations we don't want to lint. Instead of just checking if the self type is a type parameter and "special casing" one specific case we don't want to lint, we should probably rather just check that the self type is either a struct, an enum or a union and only then continue. That prevents weird edge cases like this one that can only happen in core. Again, I don't know if it's even possible to add a test case for this since one cannot implement `Debug` for primitive types outside of the crate that defined `Debug` (core). I did make sure that this PR no longer ICEs on `impl<T> Debug for T` and `impl Debug for bool`. Maybe writing such a test is possible with `#![no_core]` and then re-defining the `Debug` trait or something like that...? changelog: [`missing_fields_in_debug`]: make sure self type is an adt (fixes an ICE in core) r? `@Alexendoo` (reviewed the last PRs for this lint)
2023-08-17Auto merge of #11070 - y21:issue11065, r=flip1995bors-13/+72
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro Fixes #11065 (which is actually two issues: an ICE and a false positive) It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099). It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore) changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP) r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-17Auto merge of #11106 - syvb:literal_unwrap_ice, r=dswijbors-118/+293
[`unnecessary_literal_unwrap`]: Fix ICE on None.unwrap_or_default() Fixes #11099 Fixes #11064 I'm running into #11099 (cc `@y21)` on my Rust codebase. Clippy ICEs on this code when evaluating the `unnecessary_literal_unwrap` lint: ```rust fn main() { let val1: u8 = None.unwrap_or_default(); } ``` This fixes that ICE and adds an message specifically for that case: ``` error: used `unwrap_or_default()` on `None` value --> $DIR/unnecessary_literal_unwrap.rs:26:5 | LL | None::<String>.unwrap_or_default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()` ``` This PR also fixes the same ICE with `None.unwrap_or_else` (by giving the generic error message for the lint in that case). changelog: Fix ICE in `unnecessary_literal_unwrap` on `None.unwrap_or_default()`
2023-08-17Auto merge of #11130 - smoelius:fix-10535, r=Jarchobors-11/+40
Fix ICE in #10535 Fixes #10535 r? `@Jarcho` changelog: Eliminate ICE described in #10535
2023-08-17Auto merge of #11191 - Alexendoo:redundant-type-annotations-ice, r=llogiqbors-21/+38
redundant_type_annotations: only pass certain def kinds to type_of Fixes #11190 Fixes rust-lang/rust#113516 Also adds an `is_lint_allowed` check to skip the lint when it's not needed changelog: none
2023-08-17Auto merge of #11104 - Alexendoo:arc-with-non-send-sync, r=Centri3bors-43/+73
`arc_with_non_send_sync`: reword and move to `suspicious` Fixes #11079 changelog: [`arc_with_non_send_sync`]: move to complexity
2023-08-17Auto merge of #11077 - y21:issue11076, r=Manishearthbors-2/+9
[`arc_with_non_send_sync`]: don't lint if type has nested type parameters Fixes #11076 changelog: [`arc_with_non_send_sync`]: don't lint if type has nested type parameters r? `@Manishearth`
2023-08-17Auto merge of #11172 - Alexendoo:tuple-array-conversions-nursery, r=xFrednetbors-1/+1
Move tuple_array_conversions to nursery changelog: Move [`tuple_array_conversions`] to `nursery` (Now allow-by-default) <!-- FIY: Ignore this change, if the commit gets backported and also https://github.com/rust-lang/rust-clippy/pull/11146 --> [#11172](https://github.com/rust-lang/rust-clippy/pull/11172) The nursery change got lost in #11146 and it ended up in pedantic, this puts it in nursery and gives something to backport r? `@xFrednet`
2023-08-16[beta] Update cargoWeihang Lo-0/+0
2023-08-12Auto merge of #114726 - DianQK:beta, r=cuviperbors-0/+0
[beta] Update LLVM to resolve a miscompilation found in 114312. Related issue: #114312 . After the master updates the LLVM, we will add the same test cases. In the meantime, close the issue.
2023-08-12[beta-1.72] Update LLVM to resolve a miscompilation found in 114312.DianQK-0/+0
2023-08-11Ignore flaky clippy tests.Eric Huss-0/+9
(cherry picked from commit fb5efd7008c698a821e9c50c3f3a04d48abd8295)
2023-08-11bootstrap: config: fix version comparison bugAriadne Conill-1/+2
Rust requires a previous version of Rust to build, such as the current version, or the previous version. However, the version comparison logic did not take patch releases into consideration when doing the version comparison for the current branch, e.g. Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version match, or the previous version. Adjust the version comparison logic to tolerate mismatches in the patch version. Signed-off-by: Ariadne Conill <ariadne@dereferenced.org> (cherry picked from commit 31a81a08786826cc6e832bd0b49fb8b934e29648)
2023-08-11Revert "fix: :bug: etc/bash_complettion -> src/etc/... to avoid copy error"ekusiadadus-5/+1
This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878. (cherry picked from commit 05bc71cfaf9eb35caab425126d4fa8dcb8c62072)
2023-08-11Rename cast_ref_to_mut to invalid_reference_casting (clippy side)Urgau-6/+6
(cherry picked from commit fa15df6f5a85ceb5919a47bb721a337c7b8f0adc)
2023-08-11Rename cast_ref_to_mut lint to invalid_reference_castingUrgau-2/+2
(cherry picked from commit 3dbbf23e29516218863bda29d2983bd503e6b7fd)
2023-08-03[beta-1.72] Update cargoWeihang Lo-0/+0
2023-08-01Auto merge of #114279 - weihanglo:update-beta-cargo, r=weihanglobors-0/+0
[beta-1.72] Update cargo 1 commits in dd6536b8ed28f73c0e82089c72ef39a03bc634be..11ffe0e500346b26e3de1ba115482b4da586dfac 2023-07-18 14:02:13 +0000 to 2023-07-30 20:44:11 +0000 - [beta-1.72] backport rust-lang/cargo#12411 (rust-lang/cargo#12417) r? `@ghost`
2023-08-01Auto merge of #113786 - Kobzol:ci-disable-dist-tests, r=Mark-Simulacrumbors-4/+5
Disable dist tests on beta/stable Should resolve the beta/stable part of https://github.com/rust-lang/rust/issues/113784. To be extra safe, I also made the read of `RUST_RELEASE_CHANNEL` optional, just in case it was missing. r? `@Mark-Simulacrum`
2023-07-31[beta] Update cargoWeihang Lo-0/+0
2023-07-21Bump to released stable compilerMark Rousskov-412/+297
2023-07-18[beta] Update cargoWeihang Lo-0/+0
2023-07-17Disable dist tests on beta/stableJakub Beránek-4/+5
2023-07-10Use channel name in artifact -- fixes beta buildsMark Rousskov-5/+6
This likely will break on stable promotion because stable artifacts are named with stable version rather than channel name; we'll want to figure out the right fix for that in a follow-up.
2023-07-10Bump channel to betaMark Rousskov-1/+1
2023-07-08Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgrbors-3/+3
Rollup of 7 pull requests Successful merges: - #112931 (Enable zlib in LLVM on aarch64-apple-darwin) - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test) - #113173 (CI: include workflow name in concurrency group) - #113335 (Reveal opaques in new solver) - #113390 (CGU formation tweaks) - #113399 (Structurally normalize again for byte string lit pat checking) - #113412 (Add basic types to SMIR) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-08Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995bors-19/+4
Fail the build if clippy tests don't pass This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master). Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime r? flip1995
2023-07-08Delete `to_string_in_format_args_incremental.rs`Nilstrieb-19/+0
It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here.
2023-07-08Fail the build if clippy tests don't passNilstrieb-0/+4
This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master).
2023-07-08Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbiniMatthias Krüger-1/+1
CI: include workflow name in concurrency group Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group. Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606).
2023-07-08Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-SimulacrumMatthias Krüger-2/+2
Enable zlib in LLVM on aarch64-apple-darwin Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156 This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now
2023-07-08Auto merge of #113376 - ↵bors-9/+9
Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane. This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing. r? oli-obk
2023-07-07Rollup merge of #113466 - weihanglo:update-cargo, r=weihangloMichael Goulet-0/+0
Update cargo 1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7 2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000 - docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323) r? ``@ghost``
2023-07-07Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obkMichael Goulet-0/+43
miri: check that assignments do not self-overlap r? `````@oli-obk`````
2023-07-07Update cargoWeihang Lo-0/+0
2023-07-07Fix failing clippy testsAlex Macleod-41/+21
Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334 Fixes https://github.com/rust-lang/rust-clippy/issues/11121
2023-07-07Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`Nilstrieb-9/+9
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-07miri: check that assignments do not self-overlapRalf Jung-0/+43
2023-07-07Use new std::simd fn in miri testsJubilee Young-1/+1
Old fn were slightly divergent.
2023-07-07Auto merge of #112816 - Amanieu:llvm-riscv-arch, r=cuviperbors-0/+0
Update LLVM submodule This adds https://github.com/rust-lang/llvm-project/pull/147.
2023-07-07Auto merge of #112796 - Kobzol:ci-merge-msvc-cargo-tools, r=pietroalbinibors-9/+3
CI: merge msvc cargo and tools jobs The `x86_64-msvc-cargo` and `x86_64-msvc-tools` jobs both run for ~1 hour, but most of that time is actually spent in building LLVM and `rustc`, so I want to try merging them. ![image](https://github.com/rust-lang/rust/assets/4539057/8652fa2a-b8b7-41d0-8f16-555d31acd9a5)
2023-07-06Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbinibors-76/+40
CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221).
2023-07-06Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514bors-2/+7
Use `llvm-config` instead of `download-ci-llvm` in PGO script This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI. r? `@jyn514`
2023-07-06Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgrbors-2/+5
Rollup of 4 pull requests Successful merges: - #112295 (Fix the tests-listing-format-json test on Windows) - #113246 (fix compiletest crash) - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver) - #113402 (Diagnose unsorted CGUs.) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-06Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbiniMatthias Krüger-1/+1
fix compiletest crash ### Motivation When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes > panicked-at-attempt-to-subtract-with-overflow ```rust let mut head = replace(bytes, Vec::new()); let mut middle = head.split_off(HEAD_LEN); // The following line will panic let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice(); let skipped = new_len - HEAD_LEN - TAIL_LEN; ``` ### Background The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB. The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general. When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes. ### Note This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks). Note that an early out makes sense here: If the real data is too small, it does not sense to split it.
2023-07-06Rollup merge of #112295 - ↵Matthias Krüger-1/+4
ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini Fix the tests-listing-format-json test on Windows tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag.
2023-07-06Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errorsbors-31/+35
Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Part of rust-lang/compiler-team#616 turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S r? `@oli-obk`
2023-07-06Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-deadbors-13/+25
Rollup of 9 pull requests Successful merges: - #111119 (style-guide: Add chapter about formatting for nightly-only syntax) - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`) - #113145 (style-guide: Document newline rules for assignment operators) - #113163 (Add a regression test for #112895) - #113332 (resolve: Use `Interned` for some interned structures) - #113334 (Revert the lexing of `c"…"` string literals) - #113350 (Fix the issue of wrong diagnosis for extern pub fn) - #113371 (Fix submodule handling when the current branch is named after a tag) - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change)) r? `@ghost` `@rustbot` modify labels: rollup