Commit Graph

244872 Commits

Author SHA1 Message Date
Jake Goulding
c2573c7574 Use new publicly-available M1 runners
https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
2024-02-04 13:52:05 -05:00
Jake Goulding
f47cb984b6 Re-enable M1 runners on GitHub Actions
This reverts commit 0f9844d10c.
2024-02-04 13:52:00 -05:00
bors
671eb38a4e Auto merge of #120543 - ehuss:macos-ninja, r=Mark-Simulacrum
CI: Use ninja on apple builders

This switches the apple builders to use ninja when building LLVM. My hope is that this should resolve the timeouts we have been experiencing since December. My theory is that something in the image update from [Dec 20](dec20a5272) is causing an issue with our build (or, perhaps more remotely, some [update to LLVM itself](https://github.com/rust-lang/rust/commits/master/src/llvm-project)).

The symptoms are that during the LLVM build it just hangs just before the install step. The last thing it prints is `[100%] Built target llvm-reduce` and then just hangs. Normally the next part should be `Install the project...` where it starts installing LLVM. I'm able to reproduce this without too much difficulty. I've been testing ninja, and it seems to be working better (however, my test isn't quite equivalent, since I'm getting sccache misses, and I can't update the S3 bucket).

Installing ninja takes about 7 to 10 seconds, so it shouldn't impact things. I can't determine if it will affect the overall build timing due to not being able to test with a warm S3 cache.
2024-02-04 15:14:19 +00:00
bors
b11fbfbf35 Auto merge of #120617 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump to 1.78

r? `@Mark-Simulacrum`
2024-02-03 18:21:03 +00:00
Mark Rousskov
8ef369be88 Bump to 1.78 2024-02-03 13:14:34 -05:00
bors
bf3c6c5bed Auto merge of #120447 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? ghost
2024-02-01 22:17:11 +00:00
Eric Huss
2aebe6c302 CI: Use ninja on apple builders 2024-01-31 19:02:58 -08:00
bors
11f32b73e0 Auto merge of #120524 - Nadrieril:rollup-67952ib, r=Nadrieril
Rollup of 9 pull requests

Successful merges:

 - #120207 (check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test)
 - #120321 (pattern_analysis: cleanup the contexts)
 - #120355 (document `FromIterator for Vec` allocation behaviors)
 - #120430 (std: thread_local::register_dtor fix proposal for FreeBSD.)
 - #120469 (Provide more context on derived obligation error primary label)
 - #120472 (Make duplicate lang items fatal)
 - #120490 (Don't hash lints differently to non-lints.)
 - #120495 (Remove the `abi_amdgpu_kernel` feature)
 - #120501 (rustdoc: Correctly handle attribute merge if this is a glob reexport)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-31 15:01:22 +00:00
Nadrieril
4eaf4c2615
Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle
rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes #120487.

The regression was introduced in https://github.com/rust-lang/rust/pull/113091. Only non-glob reexports should have been impacted.

cc `````@Nemo157`````
r? `````@notriddle`````
2024-01-31 12:10:53 +01:00
Nadrieril
573e7f181d
Rollup merge of #120495 - clubby789:remove-amdgpu-kernel, r=oli-obk
Remove the `abi_amdgpu_kernel` feature

The tracking issue (#51575) has been closed for 3 years, with no activity for 5.
2024-01-31 12:10:53 +01:00
Nadrieril
be4f8e2758
Rollup merge of #120490 - nnethercote:Diagnostic-hashing, r=estebank
Don't hash lints differently to non-lints.

`Diagnostic::keys`, which is used for hashing and equating diagnostics, has a surprising behaviour: it ignores children, but only for lints. This was added in #88493 to fix some duplicated diagnostics, but it doesn't seem necessary any more.

This commit removes the special case and only four tests have changed output, with additional errors. And those additional errors aren't exact duplicates, they're just similar. For example, in src/tools/clippy/tests/ui/same_name_method.rs we currently have this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:79:9
   |
LL |         impl T1 for S {}
   |         ^^^^^^^^^^^^^^^^
```
and with this change we also get this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:81:9
   |
LL |         impl T2 for S {}
   |
```
I think printing this second argument is reasonable, possibly even preferable to hiding it. And the other cases are similar.

r? `@estebank`
2024-01-31 12:10:52 +01:00
Nadrieril
032596e34c
Rollup merge of #120472 - Nilstrieb:die, r=compiler-errors
Make duplicate lang items fatal

Prevents terminal spam.
2024-01-31 12:10:52 +01:00
Nadrieril
0313eb2182
Rollup merge of #120469 - estebank:issue-40120, r=TaKO8Ki
Provide more context on derived obligation error primary label

Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote:

```
error[E0277]: the trait bound `i32: Bar` is not satisfied
 --> f100.rs:6:6
  |
6 |     <i32 as Foo>::foo();
  |      ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo`
  |
help: this trait has no implementations, consider adding one
 --> f100.rs:2:1
  |
2 | trait Bar {}
  | ^^^^^^^^^
note: required for `i32` to implement `Foo`
 --> f100.rs:3:14
  |
3 | impl<T: Bar> Foo for T {}
  |         ---  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
```

Fix #40120.
2024-01-31 12:10:51 +01:00
Nadrieril
a7d5382e5c
Rollup merge of #120430 - devnexen:fix_tls_dtor_fbsd, r=cuviper
std: thread_local::register_dtor fix proposal for FreeBSD.

following-up 5d3d347 commit, rust started to spin
__cxa_thread_call_dtors warnings even without any TLS usage. using instead home made TLS destructor handler `register_dtor_fallback`.

close #120413
2024-01-31 12:10:51 +01:00
Nadrieril
03daaa6f07
Rollup merge of #120355 - the8472:doc-vec-fromiter, r=cuviper
document `FromIterator for Vec` allocation behaviors

[t-libs discussion](https://rust-lang.zulipchat.com/#narrow/stream/259402-t-libs.2Fmeetings/topic/Meeting.202024-01-24/near/417686526) about #120091 didn't reach a strong consensus, but it was agreed that if we keep the current behavior it should at least be documented even though it is an implementation detail.

The language is intentionally non-committal. The previous (non-existent) documentation permits a lot of implementation leeway and we want retain that. In some cases we even must retain it to be able to rip out some code paths that rely on unstable features.
2024-01-31 12:10:50 +01:00
Nadrieril
0eaa32fce2
Rollup merge of #120321 - Nadrieril:cleanup-cx, r=compiler-errors
pattern_analysis: cleanup the contexts

This cleans up a bit the various `*Ctxt`s I had left lying around. As a bonus this made it possible to make `PatternColumn` public. I don't have a use for that yet but that could come useful.

`UsefulnessCtxt` looks useless right now but I'll be adding a field or two in subsequent PRs.

r? `````@compiler-errors`````
2024-01-31 12:10:50 +01:00
Nadrieril
bcb709b30f
Rollup merge of #120207 - onur-ozkan:120202-fix, r=clubby789
check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test

Fixes a logical bug in `profile_user_dist` test (explained in #120202).
2024-01-31 12:10:49 +01:00
bors
cdaa12e3df Auto merge of #120358 - tmandry:bump-fuchsia-8c-tests, r=Mark-Simulacrum
Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught https://github.com/rust-lang/rust-clippy/issues/11952 and #119593.

See prior discussion on #119400 about building on 8 cores instead of 16. This PR combines changes from that and #119399, plus clean up.

r? `@Mark-Simulacrum`
2024-01-31 07:40:02 +00:00
bors
d53ddcd8bb Auto merge of #120346 - petrochenkov:ownodes, r=oli-obk
hir: Refactor getters for owner nodes
2024-01-31 05:37:49 +00:00
bors
80deabd098 Auto merge of #120227 - nnethercote:further-improve-space_between, r=petrochenkov
Further improve `space_between`

`space_between` is used by `print_tts` to decide when spaces should be put between  tokens. This PR improves it in two ways:
- avoid unnecessary spaces before semicolons, and
- don't omit some necessary spaces before/after some punctuation symbols.

r? `@petrochenkov`
2024-01-31 02:01:43 +00:00
the8472
39dc3153c5 Apply suggestions from code review
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-01-30 22:37:07 +01:00
The 8472
c780fe6b27 document FromIterator for Vec allocation behaviors 2024-01-30 22:37:07 +01:00
Esteban Küber
6efddac288 Provide more context on derived obligation error primary label
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote:

```
error[E0277]: the trait bound `i32: Bar` is not satisfied
 --> f100.rs:6:6
  |
6 |     <i32 as Foo>::foo();
  |      ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo`
  |
help: this trait has no implementations, consider adding one
 --> f100.rs:2:1
  |
2 | trait Bar {}
  | ^^^^^^^^^
note: required for `i32` to implement `Foo`
 --> f100.rs:3:14
  |
3 | impl<T: Bar> Foo for T {}
  |         ---  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
```

Fix #40120.
2024-01-30 21:28:18 +00:00
Nicholas Nethercote
4225a1e186 Don't hash lints differently to non-lints.
`Diagnostic::keys`, which is used for hashing and equating diagnostics,
has a surprising behaviour: it ignores children, but only for lints.
This was added in #88493 to fix some duplicated diagnostics, but it
doesn't seem necessary any more.

This commit removes the special case and only four tests have changed
output, with additional errors. And those additional errors aren't
exact duplicates, they're just similar. For example, in
src/tools/clippy/tests/ui/same_name_method.rs we currently have this
error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:79:9
   |
LL |         impl T1 for S {}
   |         ^^^^^^^^^^^^^^^^
```
and with this change we also get this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:81:9
   |
LL |         impl T2 for S {}
   |         ^^^^^^^^^^^^^^^^
```
I think printing this second argument is reasonable, possibly even
preferable to hiding it. And the other cases are similar.
2024-01-31 08:25:29 +11:00
bors
cb4d9a1902 Auto merge of #119101 - compiler-errors:outlives, r=lcnr
Normalize region obligation in lexical region resolution with next-gen solver

This normalizes region obligations when we `resolve_regions`, since they may be unnormalized with deferred projection equality.

It's pretty hard to add tests that exercise this without also triggering MIR borrowck errors (because we don't normalize there yet). I've added one test with two revisions that should test that we both 1. normalize region obligations in the param env, and 2. normalize registered region obligations during lexical region resolution.
2024-01-30 19:22:04 +00:00
Guillaume Gomez
024364ac60 Add regression test for #120487 2024-01-30 18:14:09 +01:00
Guillaume Gomez
75f670d57d rustdoc: Correctly handle attribute merge if this is a glob reexport 2024-01-30 18:13:17 +01:00
bors
f3d71c9249 Auto merge of #120496 - GuillaumeGomez:rollup-fmu9jre, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - #117906 (Improve display of crate name when hovered)
 - #118533 (Suppress unhelpful diagnostics for unresolved top level attributes)
 - #120293 (Deduplicate more sized errors on call exprs)
 - #120295 (Remove `raw_os_nonzero` feature.)
 - #120310 (adapt test for v0 symbol mangling)
 - #120342 (Remove various `has_errors` or `err_count` uses)
 - #120434 (Revert outdated version of "Add the wasm32-wasi-preview2 target")
 - #120445 (Fix some `Arc` allocator leaks)
 - #120475 (Improve error message when `cargo build` is used to build the compiler)
 - #120476 (Remove some unnecessary check logic for lang items in HIR typeck)
 - #120485 (add missing potential_query_instability for keys and values in hashmap)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-30 17:01:18 +00:00
onur-ozkan
dfbbdda56e check RUST_BOOTSTRAP_CONFIG in profile_user_dist test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-30 19:19:25 +03:00
Nadrieril
59031429c5 Separate PlaceCtxt from UsefulnessCtxt 2024-01-30 17:07:06 +01:00
Nadrieril
6ef836246b Make PatternColumn part of the public API 2024-01-30 17:06:52 +01:00
Nadrieril
83e88c6dfc Repurpose MatchCtxt for usefulness only 2024-01-30 17:06:51 +01:00
Nadrieril
cb0e8c508c Limit the use of PlaceCtxt 2024-01-30 17:06:30 +01:00
Guillaume Gomez
27bc496564
Rollup merge of #120485 - chenyukang:yukang-add-query-instability-check, r=michaelwoerister
add missing potential_query_instability for keys and values in hashmap

From https://github.com/rust-lang/rust/pull/120435#discussion_r1468883787,

These API are also returning iterator, so we need add `potential_query_instability` for them?
2024-01-30 16:57:51 +01:00
Guillaume Gomez
f3f1472678
Rollup merge of #120476 - compiler-errors:lang-items-yeet, r=Nilstrieb
Remove some unnecessary check logic for lang items in HIR typeck

Obvious bugs with `#[no_core]` do not deserve customized recovery logic, since they are bugs we do not expect users to ever encounter, and if users are experimenting with `#[no_core]`, they should really be familiar with the compiler implementation.

These error recoveries are implemented now only where issues have been reported in the past, rather than systematically validating lang items.

See https://github.com/rust-lang/compiler-team/issues/620
> In particular, one-off fixes for particular assumptions about lang items or intrinsics that introduce additional complexity into the compiler are not accepted.

r? Nilstrieb
2024-01-30 16:57:51 +01:00
Guillaume Gomez
399b81faac
Rollup merge of #120475 - Nilstrieb:cargo-build-my-a-, r=michaelwoerister
Improve error message when `cargo build` is used to build the compiler

Inspired by #76446.

Doing it for `core` is probably higher value but also way harder because tools like cargo or rustc-build-sysroot would need to be fixed first, which I don't feel like doing.
2024-01-30 16:57:50 +01:00
Guillaume Gomez
a5aa355ab3
Rollup merge of #120445 - Nemo157:arc-plug, r=Mark-Simulacrum
Fix some `Arc` allocator leaks

This doesn't matter for the stable `Global` allocator as it is a ZST singleton, but other allocators may rely on all instances being dropped.
2024-01-30 16:57:50 +01:00
Guillaume Gomez
d10f33a8d1
Rollup merge of #120434 - fmease:revert-speeder, r=petrochenkov
Revert outdated version of "Add the wasm32-wasi-preview2 target"

An outdated version of #119616 was merged in rollup #120309.
This reverts those changes to enable #119616 to “retain the intended diff” after a rebase.
```@rylev``` has agreed that this would be the cleanest approach with respect to the history.
Unblocks #119616.

r? ```@petrochenkov``` or compiler or libs
2024-01-30 16:57:49 +01:00
Guillaume Gomez
b28e6f143e
Rollup merge of #120342 - oli-obk:track_errors6, r=nnethercote
Remove various `has_errors` or `err_count` uses

follow up to https://github.com/rust-lang/rust/pull/119895

r? `@nnethercote` since you recently did something similar.

There are so many more of these, but I wanted to get a PR out instead of growing the commit list indefinitely. The commits all work on their own and can be reviewed commit by commit.
2024-01-30 16:57:49 +01:00
Guillaume Gomez
6a1d34f32a
Rollup merge of #120310 - krasimirgg:jan-v0-sym, r=Mark-Simulacrum
adapt test for v0 symbol mangling

No functional changes intended.

Adapts the test to also work under `new-symbol-mangling = true`.
2024-01-30 16:57:48 +01:00
Guillaume Gomez
4f4ceefe16
Rollup merge of #120295 - reitermarkus:remove-ffi-nonzero, r=dtolnay
Remove `raw_os_nonzero` feature.

This feature is superseded by a generic `NonZero` type: https://github.com/rust-lang/rust/issues/120257

Closes https://github.com/rust-lang/rust/issues/82363.
2024-01-30 16:57:48 +01:00
Guillaume Gomez
0a4fd52c91
Rollup merge of #120293 - estebank:issue-102629, r=nnethercote
Deduplicate more sized errors on call exprs

Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-30 16:57:47 +01:00
Guillaume Gomez
ee2e9e1eda
Rollup merge of #118533 - chenyukang:yukang-fix-118455, r=petrochenkov
Suppress unhelpful diagnostics for unresolved top level attributes

Fixes #118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them.

Also fixes #89566, fixes #67107.

r? `@petrochenkov`
2024-01-30 16:57:46 +01:00
Guillaume Gomez
efff26701b
Rollup merge of #117906 - GuillaumeGomez:improve-crate-name-hover, r=fmease,notriddle
Improve display of crate name when hovered

Currently when we hover the crate name, the background is stuck to the version and to the logo (when there is one):

![Screenshot from 2023-11-14 11-42-39](https://github.com/rust-lang/rust/assets/3050060/717190cd-483d-45a1-a462-e9ba342d4376)
![Screenshot from 2023-11-14 11-43-19](https://github.com/rust-lang/rust/assets/3050060/23f8bc9b-1304-4f91-ae1e-96bc508e9da6)

I find it very unpleasant so I reduced the padding size and increased the margin (left and top) to keep the same positioning but not making it stuck anymore:

![Screenshot from 2024-01-29 20-40-11](https://github.com/rust-lang/rust/assets/3050060/82cf266c-7f99-4a46-a62b-ebe2445f52be)
![Screenshot from 2024-01-29 20-48-01](https://github.com/rust-lang/rust/assets/3050060/e7097c10-6e09-4bdc-a37f-070b6dac671d)

[online docs](https://rustdoc.crud.net/imperio/improve-crate-name-hover/std/index.html)

r? `@notriddle`
2024-01-30 16:57:46 +01:00
Nadrieril
0b2579a1b6 Make PatternColumn generic in Cx 2024-01-30 16:57:44 +01:00
clubby789
f6b21e90d1 Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
bors
5ad7454f75 Auto merge of #120491 - GuillaumeGomez:rollup-94wj681, r=GuillaumeGomez
Rollup of 18 pull requests

Successful merges:

 - #119123 (Add triagebot mentions entry for simd intrinsics)
 - #119991 (Reject infinitely-sized reads from io::Repeat)
 - #120172 (bootstrap: add more unit tests)
 - #120250 (rustdoc: Prevent JS injection from localStorage)
 - #120376 (Update codegen test for LLVM 18)
 - #120387 (interpret/memory: fix safety comment for large array memset optimization)
 - #120400 (Bound errors span label cleanup)
 - #120402 (Make the coroutine def id of an async closure the child of the closure def id)
 - #120403 (Add instructions of how to use pre-vendored 'rustc-src')
 - #120424 (raw pointer metadata API: data address -> data pointer)
 - #120425 (Remove unnecessary unit returns in query declarations)
 - #120439 (Move UI issue tests to subdirectories)
 - #120443 (Fixes footnote handling in rustdoc)
 - #120452 (std: Update documentation of seek_write on Windows)
 - #120460 (Be more careful about interpreting a label/lifetime as a mistyped char literal.)
 - #120464 (Add matthewjasper to some review groups)
 - #120467 (Update books)
 - #120488 (Diagnostic lifetimes cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-30 13:49:53 +00:00
Vadim Petrochenkov
db41f4aaa0 hir: Remove hir::Map::{owner,expect_owner} 2024-01-30 15:00:52 +03:00
Vadim Petrochenkov
667d5d325f hir: Add non-optional hir_owner_nodes for real OwnerIds 2024-01-30 15:00:52 +03:00
Vadim Petrochenkov
64b6b5b6ce hir: Simplify hir_owner_nodes query
The query accept arbitrary DefIds, not just owner DefIds.
The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom.
Also rename the query to `opt_hir_owner_nodes`.
2024-01-30 15:00:52 +03:00