about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-12More accurate incorrect use of `await` suggestionEsteban Küber-56/+76
2024-07-12Use more accurate span for `:` to `::` suggestionEsteban Küber-8/+12
2024-07-12Tweak tests to avoid confusing suggestion outputEsteban Küber-12/+12
2024-07-12Make `impl` and `!` removal suggestion `short`Esteban Küber-28/+6
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-786/+3197
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-11Auto merge of #127614 - matthiaskrgr:rollup-8geziwi, r=matthiaskrgrbors-409/+447
Rollup of 8 pull requests Successful merges: - #124599 (Suggest borrowing on fn argument that is `impl AsRef`) - #127572 (Don't mark `DEBUG_EVENT` struct as `repr(packed)`) - #127588 (core: Limit remaining f16 doctests to x86_64 linux) - #127591 (Make sure that labels are defined after the primary span in diagnostics) - #127598 (Allows `#[diagnostic::do_not_recommend]` to supress trait impls in suggestions as well) - #127599 (Rename `lazy_cell_consume` to `lazy_cell_into_inner`) - #127601 (check is_ident before parse_ident) - #127605 (Remove extern "wasm" ABI) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-11Auto merge of #127609 - flip1995:clippy-subtree-update, r=Manishearthbors-2494/+4147
Clippy subtree update r? `@Manishearth`
2024-07-11Rollup merge of #127605 - nikic:remove-extern-wasm, r=oli-obkMatthias Krüger-382/+87
Remove extern "wasm" ABI Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked in #83788). As discussed in https://github.com/rust-lang/rust/pull/127513#issuecomment-2220410679 and following, this ABI is a failed experiment that did not end up being used for anything. Keeping support for this ABI in LLVM 19 would require us to switch wasm targets to the `experimental-mv` ABI, which we do not want to do. It should be noted that `Abi::Wasm` was internally used for two things: The `-Z wasm-c-abi=legacy` ABI that is still used by default on some wasm targets, and the `extern "wasm"` ABI. Despite both being `Abi::Wasm` internally, they were not the same. An explicit `extern "wasm"` additionally enabled the `+multivalue` feature. I've opted to remove `Abi::Wasm` in this patch entirely, instead of keeping it as an ABI with only internal usage. Both `-Z wasm-c-abi` variants are now treated as part of the normal C ABI, just with different different treatment in adjust_for_foreign_abi.
2024-07-11Rollup merge of #127601 - trevyn:issue-127600, r=compiler-errorsMatthias Krüger-2/+12
check is_ident before parse_ident Closes #127600
2024-07-11Rollup merge of #127599 - tgross35:lazy_cell_consume-rename, r=workingjubileeMatthias Krüger-4/+4
Rename `lazy_cell_consume` to `lazy_cell_into_inner` Name this something that is less confusable with an atomic consume API for `{Lazy,Once}Lock`.
2024-07-11Rollup merge of #127598 - ↵Matthias Krüger-0/+80
weiznich:diagnostic_do_not_recommend_also_skips_help, r=compiler-errors Allows `#[diagnostic::do_not_recommend]` to supress trait impls in suggestions as well This commit changes the error reporting mechanism for not implemented traits to skip impl marked as `#[diagnostic::do_not_recommend]` in the help part of the error message ("the following other types implement trait `Foo`:"). The main use case here is to allow crate authors to skip non-meaningful confusing suggestions. A common example for this are fully generic impls on tuples. Related to https://github.com/rust-lang/rust/issues/51992 r? `@compiler-errors`
2024-07-11Rollup merge of #127591 - compiler-errors:label-after-primary, r=lcnrMatthias Krüger-1/+24
Make sure that labels are defined after the primary span in diagnostics Putting a `#[label]` before a `#[primary_span]` results in that label being overwritten, due to the semantics of `Diagnostic::span` and the fact that labels are stored in the `MultiSpan` of the diagnostic. This isn't possible to fix in general, since a lot of code actually *relies* in this overwriting behavior (e.g. `rustc_on_unimplemented`). However, it's useful to enforce this for derive-diagnostics, since this is certainly never what you intend to do in a derived diagnostic, where all the fields are meaningful parts of the diagnostic being rendered. This only matters for `#[label]`, since those are the ones stored in the `MultiSpan` of the error. We could also make this "just work" by sorting the attrs or processing the primary span attr first, however I think it's kinda pointless to do. There was 1 case where this mattered, but we literally didn't have a test exercising that diagnostic 🙃
2024-07-11Rollup merge of #127588 - uweigand:s390x-f16-doctests, r=tgross35Matthias Krüger-0/+15
core: Limit remaining f16 doctests to x86_64 linux On s390x, every use of the f16 data type will currently ICE due to https://github.com/llvm/llvm-project/issues/50374, causing doctest failures on the platform. Most doctests were already restricted to certain platforms, so fix this by likewise restricting the remaining five.
2024-07-11Rollup merge of #127572 - tbu-:pr_debug_event_nonpacked, r=jhprattMatthias Krüger-1/+1
Don't mark `DEBUG_EVENT` struct as `repr(packed)` That would give it alignment of 1 which is ABI-incompatible with its C definition.
2024-07-11Rollup merge of #124599 - estebank:issue-41708, r=wesleywiserMatthias Krüger-19/+224
Suggest borrowing on fn argument that is `impl AsRef` When encountering a move conflict, on an expression that is `!Copy` passed as an argument to an `fn` that is `impl AsRef`, suggest borrowing the expression. ``` error[E0382]: use of moved value: `bar` --> f204.rs:14:15 | 12 | let bar = Bar; | --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait 13 | foo(bar); | --- value moved here 14 | let baa = bar; | ^^^ value used here after move | help: borrow the value to avoid moving it | 13 | foo(&bar); | + ``` Fix #41708
2024-07-11Auto merge of #127487 - tgross35:f16-f128-simd, r=Amanieubors-0/+2
Add `f16` and `f128` as simd types in LLVM `@sayantn` is working on adding SIMD for `f16` and hitting the `FloatingPointVector` error. This should fix it and unblock adding support for `simd_fma` and `simd_fabs` in stdarch.
2024-07-11Merge commit 'b794b8e08c16517a941dc598bb1483e8e12a8592' into ↵Philipp Krones-2494/+4147
clippy-subtree-update
2024-07-11Auto merge of #13086 - flip1995:rustup, r=flip1995bors-64/+70
Rustup r? `@ghost` changelog: none
2024-07-11Bump nightly version -> 2024-07-11Philipp Krones-1/+1
2024-07-11Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-2527/+4199
2024-07-11Auto merge of #127311 - oli-obk:do_not_count_errors, r=compiler-errorsbors-211/+37
Avoid follow-up errors and ICEs after missing lifetime errors on data structures Tuple struct constructors are functions, so when we call them typeck will use the signature tuple struct constructor function to provide type hints. Since typeck mostly ignores and erases lifetimes, we end up never seeing the error lifetime in writeback, thus not tainting the typeck result. Now, we eagerly taint typeck results by tainting from `resolve_vars_if_possible`, which is called all over the place. I did not carry over all the `crashes` test suite tests, as they are really all the same cause (missing or unknown lifetime names in tuple struct definitions or generic arg lists). fixes #124262 fixes #124083 fixes #125155 fixes #125888 fixes #125992 fixes #126666 fixes #126648 fixes #127268 fixes #127266 fixes #127304
2024-07-11Avoid follow-up errors and ICEs after missing lifetime errors on data structuresOli Scherer-211/+37
2024-07-11Remove extern "wasm" ABINikita Popov-382/+87
Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked in #83788). As discussed in https://github.com/rust-lang/rust/pull/127513#issuecomment-2220410679 and following, this ABI is a failed experiment that did not end up being used for anything. Keeping support for this ABI in LLVM 19 would require us to switch wasm targets to the `experimental-mv` ABI, which we do not want to do. It should be noted that `Abi::Wasm` was internally used for two things: The `-Z wasm-c-abi=legacy` ABI that is still used by default on some wasm targets, and the `extern "wasm"` ABI. Despite both being `Abi::Wasm` internally, they were not the same. An explicit `extern "wasm"` additionally enabled the `+multivalue` feature. I've opted to remove `Abi::Wasm` in this patch entirely, instead of keeping it as an ABI with only internal usage. Both `-Z wasm-c-abi` variants are now treated as part of the normal C ABI, just with different different treatment in adjust_for_foreign_abi.
2024-07-11Auto merge of #126777 - Zalathar:normalize-colon, r=lcnrbors-245/+235
Require a colon in `//@ normalize-*:` test headers The previous parser for `//@ normalize-*` headers (before #126370) was so lax that it did not require `:` after the header name. As a result, the test suite contained a mix of with-colon and without-colon normalize headers, both numbering in the hundreds. This PR updates the without-colon headers to add a colon (matching the style used by other headers), and then updates the parser to make the colon mandatory. (Because the normalization parser only runs *after* the header system identifies a normalize header, this will detect and issue an error for relevant headers that lack the colon.) Addresses one of the points of #126372.
2024-07-11check is_ident before parse_identtrevyn-2/+12
2024-07-11Rename `lazy_cell_consume` to `lazy_cell_into_inner`Trevor Gross-4/+4
Name this something that is less confusable with an atomic consume API for `{Lazy,Once}Lock`.
2024-07-11Auto merge of #127097 - compiler-errors:async-closure-lint, r=oli-obkbors-20/+242
Implement simple, unstable lint to suggest turning closure-of-async-block into async-closure We want to eventually suggest people to turn `|| async {}` to `async || {}`. This begins doing that. It's a pretty rudimentary lint, but I wanted to get something down so I wouldn't lose the code. Tracking: * #62290
2024-07-11Allows `#[diagnostic::do_not_recommend]` to supress trait impls in ↵Georg Semmler-0/+80
suggestions as well This commit changes the error reporting mechanism for not implemented traits to skip impl marked as `#[diagnostic::do_not_recommend]` in the help part of the error message ("the following other types implement trait `Foo`:"). The main use case here is to allow crate authors to skip non-meaningful confusing suggestions. A common example for this are fully generic impls on tuples.
2024-07-11Auto merge of #127575 - chenyukang:yukang-fix-struct-fields-ice, ↵bors-32/+131
r=compiler-errors Avoid "no field" error and ICE on recovered ADT variant Fixes https://github.com/rust-lang/rust/issues/126744 Fixes https://github.com/rust-lang/rust/issues/126344, a more general fix compared with https://github.com/rust-lang/rust/pull/127426 r? `@oli-obk` From `@compiler-errors` 's comment https://github.com/rust-lang/rust/pull/127502#discussion_r1669538204 Seems most of the ADTs don't have taint, so maybe it's not proper to change `TyCtxt::type_of` query.
2024-07-11Require a colon in `//@ normalize-*:` headersZalathar-17/+7
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-228/+228
2024-07-11Auto merge of #127538 - Oneirical:the-sacred-tests, r=jieyouxubors-68/+78
Migrate `issue-83112-incr-test-moved-file`, `type-mismatch-same-crate-name` and `issue-109934-lto-debuginfo` `run-make` tests to rmake or ui Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). I have noticed that the new UI test `debuginfo-lto-alloc` is outputting artifacts that aren't getting cleaned up because of its `-C incremental`. That might be the justification needed to keep it as a run-make test? Try it on: // try-job: test-various // previously passed try-job: armhf-gnu try-job: aarch64-apple try-job: x86_64-msvc
2024-07-10Fix diagnostic and add a test for itMichael Goulet-1/+15
2024-07-10Make sure that labels are defined after the primary span in diagnosticsMichael Goulet-0/+9
2024-07-10Auto merge of #127560 - oli-obk:safe_clobber, r=nnethercotebors-14/+3
Make `visit_clobber`'s impl safe This was originally introduced in #58061 but I didn't see any perf discussion about it, so let's see what perf says. r? `@nnethercote`
2024-07-10core: Limit remaining f16 doctests to x86_64 linuxUlrich Weigand-0/+15
On s390x, every use of the f16 data type will currently ICE due to https://github.com/llvm/llvm-project/issues/50374, causing doctest failures on the platform. Most doctests were already restricted to certain platforms, so fix this by likewise restricting the remaining five.
2024-07-10Auto merge of #13081 - GuillaumeGomez:fix-iter_next_loop.rs, r=y21bors-5/+7
Fix `iter_next_loop.rs` ui test I'm uncovering bugs while working on https://github.com/rust-lang/rust-clippy/pull/11421. ^^' changelog: none
2024-07-10Auto merge of #127419 - trevyn:issue-125446, r=fee1-deadbors-147/+309
Add suggestions for possible missing `fn`, `struct`, or `enum` keywords Closes #125446 Closes #65381
2024-07-10Auto merge of #12984 - bitfield:fix_doc_nits_c, r=Alexendoobors-191/+197
Fix doc nits More tender love and polish for the documentation and suggestion texts: adding formatting, links, full stops, tweaking wording for readability, changing 'which' to 'that' where appropriate, and other standard copyediting changes. changelog: Docs [ `await_holding_lock` ]: fix doc nits changelog: Docs [ `await_holding_refcell_ref` ]: fix doc nits changelog: Docs [ `await_holding_invalid_type` ]: fix doc nits changelog: Docs [ `cast_precision_loss` ]: fix doc nits changelog: Docs [ `cast_sign_loss` ]: fix doc nits changelog: Docs [ `cast_possible_truncation` ]: fix doc nits changelog: Docs [ `cast_possible_wrap` ]: fix doc nits changelog: Docs [ `cast_lossless` ]: fix doc nits changelog: Docs [ `unnecessary_cast` ]: fix doc nits changelog: Docs [ `cast_ptr_alignment` ]: fix doc nits changelog: Docs [ `fn_to_numeric_cast` ]: fix doc nits changelog: Docs [ `fn_to_numeric_cast_with_truncation` ]: fix doc nits changelog: Docs [ `fn_to_numeric_cast_any` ]: fix doc nits changelog: Docs [ `char_lit_as_u8` ]: fix doc nits changelog: Docs [ `ptr_as_ptr` ]: fix doc nits changelog: Docs [ `ptr_cast_constness` ]: fix doc nits changelog: Docs [ `as_ptr_cast_mut` ]: fix doc nits changelog: Docs [ `little_endian_bytes` ]: fix doc nits changelog: Docs [ `big_endian_bytes` ]: fix doc nits changelog: Docs [ `bind_instead_of_map` ]: fix doc nits changelog: Docs [ `same_name_method` ]: fix doc nits
2024-07-11report pat no field error no recoverd struct variantyukang-32/+131
2024-07-10Auto merge of #127580 - matthiaskrgr:rollup-pjw1xmj, r=matthiaskrgrbors-320/+224
Rollup of 7 pull requests Successful merges: - #126476 (Fix running bootstrap tests with a local Rust toolchain as the stage0) - #127094 (E0191 suggestion correction, inserts turbofish) - #127554 ( do not run test where it cannot run) - #127564 (Temporarily remove me from review rotation.) - #127568 (instantiate higher ranked goals in candidate selection again) - #127569 (Fix local download of Docker caches from CI) - #127570 ( small normalization improvement) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-10Rollup merge of #127570 - lcnr:normalize-cool, r=compiler-errorsMatthias Krüger-13/+10
small normalization improvement r? `@compiler-errors`
2024-07-10Rollup merge of #127569 - Kobzol:ci-fix-docker-local-rebuild, r=nikicMatthias Krüger-1/+1
Fix local download of Docker caches from CI https://github.com/rust-lang/rust/pull/127312 broke local downloads of Docker caches from CI, when you wanted to build a Docker image locally. This PR fixes that. r? `@nikic` (Can you please check if the cache works for you with this PR?)
2024-07-10Rollup merge of #127568 - lcnr:undo-leakcheck, r=oli-obkMatthias Krüger-299/+121
instantiate higher ranked goals in candidate selection again This reverts #119820 as that PR has a significant impact and breaks code which *feels like it should work*. The impact ended up being larger than we expected during the FCP and we've ended up with some ideas for how we can work around this issue in the next solver. This has been discussed in the previous high bandwidth t-types meeting: https://rust-lang.zulipchat.com/#narrow/stream/326132-t-types.2Fmeetings/topic/2024-07-09.20high.20bandwidth.20meeting. We'll therefore keep this inconsistency between the two solvers for now and will have to deal with it before stabilizating the use of the new solver outside of coherence: https://github.com/rust-lang/trait-system-refactor-initiative/issues/120. fixes #125194 after a beta-backport. The pattern which is more widely used than expected and feels like it should work, especially without deep knowledge of the type system is ```rust trait Trait<'a> {} impl<'a, T> Trait<'a> for T {} fn trait_bound<T: for<'a> Trait<'a>>() {} // A function with a where-bound which is more restrictive than the impl. fn function1<T: Trait<'static>>() { // stable: ok // with #119820: error as we prefer the where-bound over the impl // with this PR: back to ok trait_bound::<T>(); } ``` r? `@rust-lang/types`
2024-07-10Rollup merge of #127564 - m-ou-se:review-rotation, r=joboetMatthias Krüger-1/+0
Temporarily remove me from review rotation.
2024-07-10Rollup merge of #127554 - ferrocene:tshepang-add-missing-attribute, ↵Matthias Krüger-0/+1
r=pietroalbini do not run test where it cannot run This was seen on Ferrocene, where we have a custom test target that does not have unwind support
2024-07-10Rollup merge of #127094 - Borgerr:E0191-suggestion-correction, r=fmeaseMatthias Krüger-4/+47
E0191 suggestion correction, inserts turbofish closes #91997
2024-07-10Rollup merge of #126476 - ferrocene:pa-bootstrap-test-local-rustc, r=onur-ozkanMatthias Krüger-2/+44
Fix running bootstrap tests with a local Rust toolchain as the stage0 When configuring a local Rust toolchain as the stage0 (with `build.rustc` and `build.cargo` in `config.toml`) we noticed there were test failures (both on the Python and the Rust side) due to bootstrap not being able to find rustc and Cargo. This was due to those two `config.toml` settings not being propagated in the tests. This PR fixes the issue by ensuring rustc and cargo are always configured in tests, using the parent bootstrap's `initial_rustc` and `initial_cargo`. try-job: x86_64-msvc Fixes https://github.com/rust-lang/rust/issues/105766
2024-07-10Fix `iter_next_loop.rs` ui testGuillaume Gomez-5/+7
2024-07-10simplify and future-proof `needs_normalization`lcnr-13/+10