Commit Graph

260277 Commits

Author SHA1 Message Date
trevyn
09b3fcebf4
Correct description of E0502 2024-07-06 09:13:14 +03:00
Jason Newcomb
d8fb164a7c Rename any_parent_is_automatically_derived to in_automatically_derived. Only check for the attribute on an impl block. 2024-07-06 00:24:48 -04:00
bors
51917e2e69 Auto merge of #127403 - compiler-errors:rollup-x2yb5t0, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #123600 (impl PathBuf::add_extension and Path::with_added_extension)
 - #127107 (Improve dead code analysis)
 - #127221 (Improve well known value check-cfg diagnostic for the standard library)
 - #127333 (Split `SolverDelegate` back out from `InferCtxtLike`)
 - #127363 (Improve readability of some fmt code examples)
 - #127366 (Use `ControlFlow` results for visitors that are only looking for a single value)
 - #127368 (Added dots at the sentence ends of rustc AST doc)
 - #127393 (Remove clubby789 from review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-06 02:48:17 +00:00
Michael Goulet
b73a790904
Rollup merge of #127393 - clubby789:unreview, r=workingjubilee
Remove clubby789 from review rotation

These days I'm unfortunately too busy to be able to take up reviews, and it looks like some PRs have been blocked on this 😓
2024-07-05 20:49:35 -04:00
Michael Goulet
aeb1a65dbf
Rollup merge of #127368 - YohDeadfall:dots-in-docs, r=fmease
Added dots at the sentence ends of rustc AST doc

Just a tiny improvement for the AST documentation by bringing consistency to sentence ends. I intentionally didn't terminate every sentence, there are still some members not having them, but at least there's no mixing style on the type level.
2024-07-05 20:49:34 -04:00
Michael Goulet
a3535b963b
Rollup merge of #127366 - oli-obk:falliblevisitor, r=compiler-errors
Use `ControlFlow` results for visitors that are only looking for a single value

These visitors all had a `Option<Value>` or `bool` field, that, once set, was never unset or modified again. They have been refactored by removing the field and returning `ControlFlow` directly from the visitor
2024-07-05 20:49:34 -04:00
Michael Goulet
521d451bc4
Rollup merge of #127363 - GuillaumeGomez:improve-fmt-code-readability, r=Amanieu
Improve readability of some fmt code examples

Some indent was weird. Some examples were too long (overall better to keep it to maximum 80 columns, but only changed the most outstanding ones).

r? ```@Amanieu```
2024-07-05 20:49:33 -04:00
Michael Goulet
16ba4b773d
Rollup merge of #127333 - compiler-errors:infer_ctxt_like-again, r=lcnr
Split `SolverDelegate` back out from `InferCtxtLike`

This is because in order to uplift things like the `Generalizer` and other `TypeRelation`s, we want to be able to interface with `InferCtxtLike` (and `InferCtxt` as its implementation), rather that `SolverDelegate`, which only really exists as a hack to be able to define some downstream methods in `rustc_type_ir`.

r? lcnr
2024-07-05 20:49:32 -04:00
Michael Goulet
865518d1f2
Rollup merge of #127221 - Urgau:check-cfg-std-diag, r=pnkfelix
Improve well known value check-cfg diagnostic for the standard library

This PR adjust the current logic for hidding the rustc/Cargo suggestion to add a value to a well-known name to exclude the standard library and rustc crates.

This is done in order to improve the contributor experience, in particular when adding a new target, which often requires adding some cfgs like `target_os` which may not be available yet in stage0.

<details>

The diagnostic code would look like this.

```text
error: unexpected `cfg` condition value: `blable`
   --> library/core/src/lib.rs:369:7
    |
369 | #[cfg(target_os = "blable")]
    |       ^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, and `windows` and 2 more
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("blable"))'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(target_os, values(\"blable\"))");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `-D unexpected-cfgs` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
```

</details>
2024-07-05 20:49:32 -04:00
Michael Goulet
31fe9628cf
Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
Improve dead code analysis

Fixes #120770

1. check impl items later if self ty is private although the trait method is public, cause we must use the ty firstly if it's private
2. mark the adt live if it appears in pattern, like generic argument, this implies the use of the adt
3. based on the above, we can handle the case that private adts impl Default, so that we don't need adding rustc_trivial_field_reads on Default, and the logic in should_ignore_item

r? ``@pnkfelix``
2024-07-05 20:49:31 -04:00
Michael Goulet
f20307851e
Rollup merge of #123600 - tisonkun:path_with_extension, r=dtolnay
impl PathBuf::add_extension and Path::with_added_extension

See the ACP for motivation and discussions - https://github.com/rust-lang/libs-team/issues/368
2024-07-05 20:49:31 -04:00
bors
5c08cc765a Auto merge of #127364 - DianQK:update-llvm, r=nikic
Update LLVM submodule

Fixes #127260. Fixes #127286.

r? `@nikic`
2024-07-06 00:23:38 +00:00
Michael Goulet
99429a6a18 Split out transitive_bounds_that_define_assoc_item 2024-07-05 20:21:16 -04:00
Camille GILLOT
b97f83b27f Verify that allocations output by GVN are sufficiently aligned. 2024-07-05 22:59:10 +00:00
Camille GILLOT
6aebb2cfec Add test. 2024-07-05 22:58:54 +00:00
y21
ecbb2d7ba9 remove internal compiler_lint_functions lint 2024-07-06 00:51:58 +02:00
Peter Jaszkowiak
ffea65bf61 add new_range_api for RFC 3550
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC.
Having `From` is highly convenient and the assertion is unlikely to be a problem in practice.

This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum.

Currently the iterators are just wrappers around the old range types,
and most other trait impls delegate to the old rage types as well.

Also includes an `.iter()` shorthand for `.clone().into_iter()`
2024-07-05 16:33:58 -06:00
clubby789
9f66af4319 Remove clubby789 from review rotation 2024-07-05 22:08:13 +01:00
Esteban Küber
75692056e1 Use verbose suggestion for changing arg type 2024-07-05 20:58:33 +00:00
Michael Goulet
27588d1de3 Split SolverDelegate back out from InferCtxtLike 2024-07-05 16:39:39 -04:00
Esteban Küber
fca286a39e Use verbose suggestion for ptr::null_mut() 2024-07-05 20:38:21 +00:00
Maybe Lapkin
073f3a263b Equate types instead of using Unsize 2024-07-05 22:35:14 +02:00
antoyo
98ed962c7d
Merge pull request #535 from rust-lang/sync_from_rust_2024_07_02
Sync from rust 2024/07/02
2024-07-05 16:09:54 -04:00
bors
524d806c62 Auto merge of #127312 - Kobzol:ci-org-agnostic, r=jdno
Make CI more agnostic of the owning GitHub organization

This should make it possible to switch running `auto` and `try` builds from `rust-lang-ci` to `rust-lang`.

r? `@jdno`
2024-07-05 20:06:15 +00:00
Michael Goulet
e5412da723 Supertrait elaboration doesn't need to use Predicates 2024-07-05 15:51:53 -04:00
Esteban Küber
8e9a3661a8 Use verbose style for argument removal suggestion 2024-07-05 19:40:09 +00:00
Antoni Boucher
5681c3cf68 Cleanup 2024-07-05 15:35:57 -04:00
Antoni Boucher
0b5be441cf Fix for gcc-13 without int128 2024-07-05 14:58:07 -04:00
bors
3ed690f07a Auto merge of #12974 - alex-semenyuk:rename_thread_local_initializer_can_be_made_const, r=Alexendoo
Rename thread_local_initializer_can_be_made_const to missing_const_for_thread_local

Close #12934
As discussed at #12934 name `thread_local_initializer_can_be_made_const` sounds against convention for other lints which describe the issue/wrong code but not suggestion and it is quite long. The new name take example from existing lint `missing_const_for_fn`

changelog: `thread_local_initializer_can_be_made_const` : Rename to [`missing_const_for_thread_local`]
2024-07-05 17:50:06 +00:00
bors
6e2780775f Auto merge of #126957 - Oneirical:artestic-inspiration, r=jieyouxu,kobzol
Migrate `pgo-gen`, `pgo-use` and `profile` `run-make` tests to rmake.rs

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: aarch64-apple
try-job: x86_64-msvc
2024-07-05 17:46:11 +00:00
Antoni Boucher
14d327a265 Disable run-make tests 2024-07-05 13:44:25 -04:00
tison
3aa2abdd3d
add unit tests for extra extension feature
Signed-off-by: tison <wander4096@gmail.com>
2024-07-05 10:44:15 -07:00
Oneirical
48a9d4b68a rewrite track-path-dep-info to rmake 2024-07-05 13:33:51 -04:00
tison
a0f4114ba9
update comments
Signed-off-by: tison <wander4096@gmail.com>
2024-07-05 10:29:35 -07:00
Michael Howell
fbb6300fc2 rustdoc-search: stop constructing pointless arrays in decode
I'm not sure why I ever thought that would be okay. This is
clearly hot code, and should avoid Array.prototype.map when
it's not needed. In any case, it shows up in the profiler.

rustdoc-js-profiler:
https://notriddle.com/rustdoc-html-demo-11/decode-opt-1/index.html

Firefox profiler:
[Before](https://share.firefox.dev/3RRH2fR)
[After](https://share.firefox.dev/3Wblcq8)
2024-07-05 10:23:59 -07:00
Oneirical
8daf82fece rewrite and rename issue-37839 to rmake 2024-07-05 13:20:32 -04:00
Oneirical
9f994b633a rewrite pass-linker-flags-from-dep to rmake 2024-07-05 12:47:19 -04:00
Michael Goulet
465e7d546e Rework receiver_is_valid 2024-07-05 11:59:54 -04:00
Michael Goulet
fb8d5f1e13 Actually just make can_eq process obligations (almost) everywhere 2024-07-05 11:59:54 -04:00
Michael Goulet
fdde66acee Process alias-relate obligations when proving receiver_is_valid 2024-07-05 11:59:52 -04:00
Antoni Boucher
fe054be06e Second attempt at fixing LTO tests
FIXME: we now have fat LTO objects even when only bitcode is requested.
2024-07-05 11:55:08 -04:00
Antoni Boucher
bc8520d98e Revert "Fix LTO tests"
This reverts commit 2d123d08c9.
2024-07-05 11:35:16 -04:00
Jules Bertholet
76da7aebe4
Match ergonomics 2024: test type inference 2024-07-05 11:17:49 -04:00
Jules Bertholet
5a35fc446e
Match ergonomics 2024: & matches &mut on old editions 2024-07-05 11:17:13 -04:00
Yoh Deadfall
291ed596f7 Added dots at the sentence ends of rustc AST doc 2024-07-05 18:10:05 +03:00
Jules Bertholet
5fd5b65093
Rename edition 2021 fail test 2024-07-05 11:06:18 -04:00
Oli Scherer
7dca61b68b Use ControlFlow results for visitors that are only looking for a single value 2024-07-05 15:00:40 +00:00
Chris Denton
7566f41209
Run alloc sync tests 2024-07-05 14:48:39 +00:00
xFrednet
25bb612538
Lintcheck: Add --warn-all and make it the CI default 2024-07-05 16:42:20 +02:00
Antoni Boucher
2d123d08c9 Fix LTO tests
FIXME: we now have fat LTO objects even when only bitcode is requested.
2024-07-05 10:42:03 -04:00