Commit Graph

260397 Commits

Author SHA1 Message Date
bors
0c81f94b9a Auto merge of #127419 - trevyn:issue-125446, r=fee1-dead
Add suggestions for possible missing `fn`, `struct`, or `enum` keywords

Closes #125446
Closes #65381
2024-07-10 18:27:32 +00:00
bors
8d3b1f9e30 Auto merge of #12984 - bitfield:fix_doc_nits_c, r=Alexendoo
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-10 17:55:08 +00:00
yukang
07e6dd95bd report pat no field error no recoverd struct variant 2024-07-11 00:18:47 +08:00
bors
c092b28976 Auto merge of #127580 - matthiaskrgr:rollup-pjw1xmj, r=matthiaskrgr
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-10 16:12:47 +00:00
Matthias Krüger
22df186d6f
Rollup merge of #127570 - lcnr:normalize-cool, r=compiler-errors
small normalization improvement

r? `@compiler-errors`
2024-07-10 17:54:29 +02:00
Matthias Krüger
31639193ec
Rollup merge of #127569 - Kobzol:ci-fix-docker-local-rebuild, r=nikic
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-10 17:54:28 +02:00
Matthias Krüger
7faef5d5ed
Rollup merge of #127568 - lcnr:undo-leakcheck, r=oli-obk
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-10 17:54:28 +02:00
Matthias Krüger
bbb0f66a0f
Rollup merge of #127564 - m-ou-se:review-rotation, r=joboet
Temporarily remove me from review rotation.
2024-07-10 17:54:27 +02:00
Matthias Krüger
aae262cafa
Rollup merge of #127554 - ferrocene:tshepang-add-missing-attribute, 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-10 17:54:26 +02:00
Matthias Krüger
a7fe30d82a
Rollup merge of #127094 - Borgerr:E0191-suggestion-correction, r=fmease
E0191 suggestion correction, inserts turbofish

closes #91997
2024-07-10 17:54:26 +02:00
Matthias Krüger
d17e0cfc5d
Rollup merge of #126476 - ferrocene:pa-bootstrap-test-local-rustc, r=onur-ozkan
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-10 17:54:25 +02:00
Guillaume Gomez
a987c308cd Fix iter_next_loop.rs ui test 2024-07-10 17:18:05 +02:00
lcnr
e00fd781c9 simplify and future-proof needs_normalization 2024-07-10 15:56:20 +02:00
Tobias Bucher
45ad522e87 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-10 15:47:24 +02:00
bors
b215beb567 Auto merge of #127566 - GuillaumeGomez:sync-cg_gcc, r=GuillaumeGomez
Sync rustc_codegen_gcc

Follow-up of https://github.com/rust-lang/rustc_codegen_gcc/pull/535.

cc `@antoyo`
2024-07-10 13:25:26 +00:00
Jakub Beránek
e7bd16e6c8 Fix local download of Docker caches 2024-07-10 14:45:14 +02:00
lcnr
f77394fdf3 instantiate higher ranked goals in candidate selection
reverts #119820
2024-07-10 14:13:16 +02:00
Guillaume Gomez
8bf65c69f7 Update GCC version 2024-07-10 13:39:39 +02:00
bors
d81987661a Auto merge of #126690 - andyolivares:feature/show_window, r=dtolnay
Exposing STARTUPINFOW.wShowWindow in CommandExt trait

Hi:

I needed a way to control how a new process's window is displayed in Windows (normal, minimized, maximized, etc).
I noticed that there is no direct way to do that (I even searched for crates doing this, but didn't find any).

Inspecting the standard library source code, I figured that it would be a good addition to CommandExt trait that allows some Windows specific customization to a Command.

This is my first time contributing to Rust, so please bear with me if I'm not following the rules :)
2024-07-10 11:09:31 +00:00
Guillaume Gomez
541b32c8ab Update Cargo.lock and remove duplicated impl 2024-07-10 13:02:26 +02:00
Guillaume Gomez
7cbe50e209 Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into master 2024-07-10 12:44:23 +02:00
Mara Bos
c8e44471b8 Temporarily remove me from review rotation. 2024-07-10 11:56:56 +02:00
bors
b012421501 Auto merge of #12944 - Jarcho:overflow_check, r=y21
Fix and rename `overflow_check_conditional`

fixes #2457

Other changes:
* Limit the lint to unsigned types.
* Actually check if the operands are the same rather than using only the first part of the path.
* Allow the repeated expression to be anything as long as there are no side effects.

changelog: Rename `overflow_check_conditional` to `panicking_overflow_check` and move to `correctness`
2024-07-10 09:02:11 +00:00
bors
0fdfb61795 Auto merge of #127006 - Oneirical:holmes-the-detestive, r=Kobzol
Migrate `extern-flag-pathless`, `silly-file-names`, `metadata-dep-info`, `cdylib-fewer-symbols` and `symbols-include-type-name` `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).

`cdylib-fewer-symbols` demands a Windows try-job. (Almost guaranteed to fail, but 7 years is a long time)

try-job: x86_64-gnu-distcheck
try-job: x86_64-msvc
try-job: aarch64-apple
2024-07-10 08:51:20 +00:00
Oli Scherer
3562ec74ca Make visit_clobber's impl safe 2024-07-10 07:54:17 +00:00
Pietro Albini
9cd1d253a6
use utils::helpers::exe 2024-07-10 09:27:30 +02:00
bors
ab7c910590 Auto merge of #13079 - sandersaares:u/sasaares/no-epsilon-guidance, r=y21
Fix guidance of [`float_cmp`] and [`float_cmp_const`] to not incorrectly recommend `f__::EPSILON` as the error margin.

Using `f32::EPSILON` or `f64::EPSILON` as the floating-point equality comparison error margin is incorrect, yet `float_cmp` has until now recommended this be done. This change fixes the given guidance (both in docs and compiler hints) to not reference these unsuitable constants.

Instead, the guidance now clarifies that the scenarios in which an absolute error margin is usable, provides a sample implementation for using a user-defined absolute error margin (as an absolute error margin can only be used-defined and may be different for different comparisons) and references the floating point guide for a reference implementation of relative error based equality comparison for cases where absolute error margins cannot be identified.

changelog: [`float_cmp`] Fix guidance to not incorrectly recommend `f__::EPSILON` as the error margin.
changelog: [`float_cmp_const`] Fix guidance to not incorrectly recommend `f__::EPSILON` as the error margin.

Fixes #6816
2024-07-10 06:36:10 +00:00
bors
649feb9c1a Auto merge of #127549 - jhpratt:rollup-o1mbmhr, r=jhpratt
Rollup of 8 pull requests

Successful merges:

 - #124211 (Bump `elided_lifetimes_in_associated_constant` to deny)
 - #125627 (migration lint for `expr2024` for the edition 2024)
 - #127091 (impl FusedIterator and a size hint for the error sources iter)
 - #127461 (Fixup failing fuchsia tests)
 - #127484 (`#[doc(alias)]`'s doc: say that ASCII spaces are allowed)
 - #127508 (small search graph refactor)
 - #127521 (Remove spastorino from SMIR)
 - #127532 (documentation: update cmake version)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-10 06:35:04 +00:00
onur-ozkan
0134bd2e67 remove unnecessary git usages
`Config::src` already contains the top-level path, so we don't need to
add git overhead just to reach this path.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-10 09:04:26 +03:00
Sander Saares
e42a380afc Revert accidental "Why restrict this?" change 2024-07-10 08:10:35 +03:00
Jacob Pratt
08cb4628a8
Rollup merge of #127532 - simonLeary42:patch-1, r=Nilstrieb
documentation: update cmake version

Previously discussed here: https://github.com/rust-lang/rust/issues/127531
2024-07-10 00:37:13 -04:00
Jacob Pratt
103a77202a
Rollup merge of #127521 - spastorino:remove-myself-from-smir-pings, r=lqd
Remove spastorino from SMIR

r? ```@oli-obk```
2024-07-10 00:37:13 -04:00
Jacob Pratt
64695adbd7
Rollup merge of #127508 - lcnr:search-graph-prep, r=compiler-errors
small search graph refactor

small improvements which shouldn't impact behavior.

r? ``````@compiler-errors``````
2024-07-10 00:37:12 -04:00
Jacob Pratt
85bd32cd69
Rollup merge of #127484 - ShE3py:rustdoc-doc-alias-whitespace-doc, r=fmease
`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR #77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
7fdefb804e/compiler/rustc_passes/src/check_attr.rs (L693-L704)

``````@rustbot`````` label +A-docs
2024-07-10 00:37:12 -04:00
Jacob Pratt
74907296d8
Rollup merge of #127461 - c6c7:fixup-failing-fuchsia-tests, r=tmandry
Fixup failing fuchsia tests

The Fuchsia platform passes all tests with these changes. Two tests are ignored because they rely on Fuchsia not returning a status code upon a process aborting. See #102032 and #58590 for more details on that topic.

Many formatting changes are also included in this PR.

r? tmandry
r? erickt
2024-07-10 00:37:11 -04:00
Jacob Pratt
e71d3d5238
Rollup merge of #127091 - Sky9x:fused-error-sources-iter, r=dtolnay
impl FusedIterator and a size hint for the error sources iter

cc tracking issue #58520
2024-07-10 00:37:11 -04:00
Jacob Pratt
21a0e86234
Rollup merge of #125627 - vincenzopalazzo:macros/cargo-fix-expr2024, r=compiler-errors,eholk
migration lint for `expr2024` for the edition 2024

This is adding a migration lint for the current (in the 2021 edition and previous)
to move expr to expr_2021 from expr

Issue https://github.com/rust-lang/rust/issues/123742

I created also a repository to test out the migration https://github.com/vincenzopalazzo/expr2024-cargo-fix-migration

Co-Developed-by: ``@eholk``
2024-07-10 00:37:10 -04:00
Jacob Pratt
de143cf992
Rollup merge of #124211 - compiler-errors:bump-elided_lifetimes_in_associated_constant, r=BoxyUwU
Bump `elided_lifetimes_in_associated_constant` to deny

It's been 5 versions since this was last bumped. Let's bump it up again.
2024-07-10 00:37:10 -04:00
bors
7caf6726db Auto merge of #127496 - tgross35:f16-f128-pattern-fixme, r=Nadrieril
Update `f16`/`f128` FIXMEs that needed `(NEG_)INFINITY`

Just a small fix to the pattern matching tests now that we can. Also contains a small unrelated comment tweak.
2024-07-10 04:20:32 +00:00
Andres Olivares
b8b6d14de9 Fixed doc links 2024-07-09 22:09:13 -04:00
Andres Olivares
e82ad2e622 Few changes to doc comments. Added tracking issue number. 2024-07-09 22:09:13 -04:00
Andres Olivares
06d76c3156 Exposing STARTUPINFOW.wShowWindow in CommandExt (show_window function) to control how a new process should display its window (normal, minimized, maximized, etc) 2024-07-09 22:09:13 -04:00
bors
956deab788 Auto merge of #127495 - compiler-errors:more-trait-error-reworking, r=lcnr
More trait error reworking

More work on #127492, specifically those sub-bullets under "Move trait error reporting to `error_reporting::traits`". Stacked on top of #127493.

This does introduce new `TypeErrCtxt.*Ext` traits, but those will be deleted soon. Splitting this work into bite-sized pieces is the only way that it's gonna be feasible to both author and review ❤️

r? lcnr
2024-07-10 02:08:19 +00:00
Ashton Hunt
7c88bda1cb E0191 suggestion correction, inserts turbofish without dyn (#91997) 2024-07-09 17:21:31 -06:00
bors
7d640b670e Auto merge of #127358 - oli-obk:taint_itemctxt, r=fmease
Automatically taint when reporting errors from ItemCtxt

This isn't very robust yet, as you need to use `itemctxt.dcx()` instead of `tcx.dcx()` for it to take effect, but it's at least more convenient than sprinkling `set_tainted_by_errors` calls in individual places.

based on https://github.com/rust-lang/rust/pull/127357

r? `@fmease`
2024-07-09 23:03:01 +00:00
Tshepang Mbambo
af3aa36d60
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-10 01:00:55 +02:00
Charles Celerier
479b0cdb89 Ignore fuchsia tests implicitly relying on a signal upon abort
Both test-panic-abort-nocapture.rs and test-panic-abort.rs assert the
stderr output of the test. On Fuchsia, if a test fails an assertion,
this output will contain a line noting the process returned the code
-1028 (ZX_TASK_RETCODE_EXCEPTION_KILL). But the asserted stderr output
lacks this note. Presumably this is because other platforms implement
-Cpanic=abort by killing the process instead of returned a status
code.
2024-07-09 14:20:52 -07:00
Oneirical
2adfa147d7 rewrite issue-109934-lto-debuginfo as an ui test 2024-07-09 16:52:17 -04:00
Nadrieril
42772e98e0 Address review comments 2024-07-09 22:47:35 +02:00
Nadrieril
3e030b38ef Return the otherwise_block instead of passing it as argument
This saves a few blocks and matches the common `unpack!` paradigm.
2024-07-09 22:47:35 +02:00