Commit Graph

237942 Commits

Author SHA1 Message Date
bors
1b2e4a9c94 Auto merge of #3154 - rust-lang:rustup-2023-11-04, r=RalfJung
Automatic Rustup
2023-11-04 08:10:57 +00:00
The Miri Conjob Bot
5b187039e4 fmt 2023-11-04 05:10:30 +00:00
The Miri Conjob Bot
fad85369c0 Merge from rustc 2023-11-04 05:08:02 +00:00
The Miri Conjob Bot
99417f2146 Preparing for merge from rustc 2023-11-04 04:59:51 +00:00
bors
3aaa0f57b7 Auto merge of #115274 - bjorn3:tidy_improvements, r=davidtwco
Run tidy license checker on more workspaces

The license checker didn't run on several workspaces before this PR. The same applied to the "external package sources" check. There were also two missing lockfiles which I have added now.
2023-11-04 02:28:17 +00:00
bors
f1b104f523 Auto merge of #117540 - matthiaskrgr:baby_dont_clone_me_dont_clone_me_no_more, r=est31
clone less
2023-11-04 00:29:52 +00:00
bors
5020f7c3b8 Auto merge of #116412 - nnethercote:rm-plugin-support, r=bjorn3
Remove support for compiler plugins.

They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`.

Closes #29597.

r? `@ghost`
2023-11-03 22:32:56 +00:00
Nicholas Nethercote
5c462a32bd Remove support for compiler plugins.
They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in
  `compiler/rustc_driver_impl/src/lib.rs` and
  `compiler/rustc_lint/src/context.rs`. External lints are now called
  "loaded" lints, rather than "plugins" to avoid confusion with the old
  plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in
  `tests/ui-fulldeps/plugin/`.

Closes #29597.
2023-11-04 08:50:46 +11:00
Nicholas Nethercote
ab161d1f5d Update rust-lang/book.
To 5b6c1ceaa62ecbd6caef08df39b33b3938e99deb, for this commit:

- Prepare for removal of compiler plugin support. (rust-lang/book#3764)
2023-11-04 08:50:25 +11:00
bors
1bb6553b96 Auto merge of #115333 - joshlf:patch-5, r=RalfJung
Guarantee representation of None in NPO

This allows users to soundly transmute zeroes into `Option` types subject to the null pointer optimization (NPO). It unblocks https://github.com/google/zerocopy/issues/293.
2023-11-03 20:29:13 +00:00
bors
9c20ddd956 Auto merge of #117507 - nnethercote:rustc_span, r=Nilstrieb
`rustc_span` cleanups

Just some things I found while looking over this crate.

r? `@oli-obk`
2023-11-03 14:57:40 +00:00
bors
a026bd49e1 Auto merge of #117538 - matthiaskrgr:rollup-63u77xb, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #117434 (delegate `<Box<E> as Error>::provide` to `<E as Error>::provide`)
 - #117505 (Fix incorrect trait bound restriction suggestion)
 - #117520 (Clippy subtree update)
 - #117523 (oli-obk is on vacation)
 - #117533 (Revert "bootstrap: do not purge docs on CI environment")

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-03 12:45:01 +00:00
Matthias Krüger
1ba97cb1cc clone less 2023-11-03 13:23:26 +01:00
Matthias Krüger
c0fa97c3d6
Rollup merge of #117533 - onur-ozkan:revert-117471, r=onur-ozkan
Revert "bootstrap: do not purge docs on CI environment"

This reverts commit 6198e881d3.

ref https://github.com/rust-lang/rust/issues/117430#issuecomment-1791609163, https://github.com/rust-lang/rust/pull/117471#issuecomment-1791937529
2023-11-03 12:44:53 +01:00
Matthias Krüger
7a0df44799
Rollup merge of #117523 - compiler-errors:oli-vacation, r=compiler-errors
oli-obk is on vacation

`@oli-obk` is away and asked me to put him in the vacation list 😸
2023-11-03 12:44:52 +01:00
Matthias Krüger
9028ce3580
Rollup merge of #117520 - flip1995:clippyup, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2023-11-03 12:44:50 +01:00
Matthias Krüger
6cb627b681
Rollup merge of #117505 - estebank:issue-117501, r=TaKO8Ki
Fix incorrect trait bound restriction suggestion

Suggest

```
error[E0308]: mismatched types
  --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12
   |
LL | pub fn foo<A: MyTrait, B>(a: A) -> B {
   |                        -           - expected `B` because of return type
   |                        |
   |                        expected this type parameter
LL |     return a.bar();
   |            ^^^^^^^ expected type parameter `B`, found associated type
   |
   = note: expected type parameter `B`
             found associated type `<A as MyTrait>::T`
help: consider further restricting this bound
   |
LL | pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B {
   |                      +++++++
```

instead of

```
error[E0308]: mismatched types
  --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12
   |
LL | pub fn foo<A: MyTrait, B>(a: A) -> B {
   |                        -           - expected `B` because of return type
   |                        |
   |                        expected this type parameter
LL |     return a.bar();
   |            ^^^^^^^ expected type parameter `B`, found associated type
   |
   = note: expected type parameter `B`
             found associated type `<A as MyTrait>::T`
help: consider further restricting this bound
   |
LL | pub fn foo<A: MyTrait + <T = B>, B>(a: A) -> B {
   |                      +++++++++
```

Fix #117501.
2023-11-03 12:44:50 +01:00
Matthias Krüger
958a6af147
Rollup merge of #117434 - BugenZhao:box-error-provide, r=cuviper
delegate `<Box<E> as Error>::provide` to `<E as Error>::provide`

Fix #117432.
2023-11-03 12:44:49 +01:00
bors
adda05fe3e Auto merge of #117535 - RalfJung:revert-cranelift, r=onur-ozkan
Revert "Auto merge of #117328 - lqd:cranelift-rocket, r=Mark-Simulacrum"

This reverts commit 1dfb6b162b, reversing changes made to bcb5798dd8.

That commit broke generating nightly rustc docs. Revert it until we can figure out how to have both, cranelift and docs.

Fixes https://github.com/rust-lang/rust/issues/117430
2023-11-03 10:41:36 +00:00
bors
49112241e9 Auto merge of #117510 - elichai:patch-3, r=cuviper
Add track_caller to transmute_copy

Currently if `size_of::<Src>() < size_of::<Dst>()` you will see the following error:
```rust
thread 'test' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/mem/mod.rs:1056:5:
cannot transmute_copy if Dst is larger than Src
```
This fixes it so it will show the invocation location
2023-11-03 08:41:59 +00:00
Ralf Jung
f38849841b Revert "Auto merge of #117328 - lqd:cranelift-rocket, r=Mark-Simulacrum"
This reverts commit 1dfb6b162b, reversing
changes made to bcb5798dd8.

That commit broke generating nightly rustc docs. Revert it until we can figure out how to have both, cranelift and docs.
2023-11-03 08:03:28 +01:00
onur-ozkan
fedfca71ed Revert "bootstrap: do not purge docs on CI environment"
This reverts commit 6198e881d3.
2023-11-03 09:15:26 +03:00
bors
1d6f05fd37 Auto merge of #116439 - compiler-errors:on-unimplemented, r=davidtwco
Pretty print `Fn` traits in `rustc_on_unimplemented`

I don't think that users really ever should need to think about `Fn*` traits' tupled args for a simple trait error.

r? diagnostics
2023-11-03 06:08:03 +00:00
bors
2429818b20 Auto merge of #117508 - nnethercote:symbols-FxIndexSet, r=cuviper
Use `FxIndexSet` in the symbol interner.

It makes the code a little nicer.

r? `@ghost`
2023-11-03 04:07:42 +00:00
bors
6b9d6dedd0 Auto merge of #117313 - GuillaumeGomez:cg_gcc-tests, r=onur-ozkan
Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to #112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
2023-11-03 02:05:06 +00:00
bors
2520ca8566 Auto merge of #117131 - compiler-errors:projection-oops, r=lcnr
Add all RPITITs when augmenting param-env with GAT bounds in `check_type_bounds`

When checking that associated type definitions actually satisfy their associated type bounds in `check_type_bounds`, we construct a "`normalize_param_env`" which adds a projection predicate that allows us to assume that we can project the GAT to the definition we're checking. For example, in:

```rust
type Foo {
  type Bar: Display = i32;
}
```

We would add `<Self as Foo>::Bar = i32` as a projection predicate when checking that `i32: Display` holds.

That `normalize_param_env` was, for some reason, only being used to normalize the predicate before it was registered. This is sketchy, because a nested obligation may require the GAT bound to hold, and also the projection cache is broken and doesn't differentiate projection cache keys that differ by param-envs 😿.

This `normalize_param_env` is also not sufficient when we have nested RPITITs and default trait methods, since we need to be able to assume we can normalize both the RPITIT and all of its child RPITITs to sufficiently prove all of its bounds. This is the cause of #117104, which only starts to fail for RPITITs that are nested 3 and above due to the projection-cache bug above.[^1]

## First fix

Use the `normalize_param_env` everywhere in `check_type_bounds`. This is reflected in a test I've constructed that fixes a GAT-only failure.

## Second fix

For RPITITs, install projection predicates for each RPITIT in the same function in `check_type_bounds`. This fixes #117104.

not sure who to request, so...
r? `@lcnr` hehe feel free to reassign :3

[^1]: The projection cache bug specifically occurs because we try normalizing the `assumed_wf_types` with the non-normalization param-env. This causes us to insert a projection cache entry that keeps the outermost RPITIT rigid, and it trivially satisifes all its own bounds. Super sketchy![^2]

[^2]: I haven't actually gone and fixed the projection cache bug because it's only marginally related, but I could, and it should no longer be triggered here.
2023-11-03 00:02:44 +00:00
Guillaume Gomez
c890dd66b3 Set some environment variables value only if ENABLE_GCC_CODEGEN is set 2023-11-03 00:05:12 +01:00
bors
a2f5f9691b Auto merge of #117134 - lcnr:dropck_outlives-coroutine, r=compiler-errors
dropck_outlives check whether generator witness needs_drop

see https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.23116242.3A.20Code.20no.20longer.20compiles.20after.20-Zdrop-tracking-mir.20.E2.80.A6/near/398311627 for an explanation.

Fixes #116242 (or well, the repro by `@jamuraa` in https://github.com/rust-lang/rust/issues/116242#issuecomment-1739802047). I did not add a regression test as it depends on other crates. We do have 1 test going from fail to pass, showing the intended behavior.

r? types
2023-11-02 22:03:38 +00:00
Michael Goulet
c83f642f12 Pretty print Fn traits in rustc_on_unimplemented 2023-11-02 20:57:05 +00:00
Michael Goulet
dd571e472a Add all RPITITs when augmenting param-env with GAT bounds in check_type_bounds 2023-11-02 20:47:10 +00:00
Michael Goulet
bb74d7e97d Use the normalizing param-env always in check_type_bounds 2023-11-02 20:47:05 +00:00
Nicholas Nethercote
94a36d2ce5 Use FxIndexSet in the symbol interner.
It makes the code a little nicer.

As part of this, the interner's `Default` impl is removed and `prefill`
is used in a test instead.
2023-11-03 07:19:41 +11:00
Guillaume Gomez
30a07094a6 Add comment explaining why the ENABLE_GCC_CODEGEN env variable is needed 2023-11-02 21:03:28 +01:00
Guillaume Gomez
2dbe7d8d5b Fix invalid enabling of gcc backend in run.sh 2023-11-02 21:03:27 +01:00
Guillaume Gomez
a141b6975b Rename SKIP_CODEGEN_TESTS into ENABLE_GCC_CODEGEN 2023-11-02 21:03:27 +01:00
Guillaume Gomez
25a96ca0e5 Don't include GCC backend if SKIP_CODEGEN_TESTS is not enabled 2023-11-02 21:03:27 +01:00
Guillaume Gomez
13f7f052d8 Run codegen tests outside if not llvm-15 2023-11-02 21:03:27 +01:00
Guillaume Gomez
260d91bd41 Add FIXME header for two comments in cg_gcc and cg_clif boostrap types 2023-11-02 21:03:27 +01:00
Guillaume Gomez
43290933a4 Remove libc dependency in cg_gcc alloc_system example 2023-11-02 21:03:27 +01:00
Guillaume Gomez
c5ff230b55 Skip codegen tests in llvm-15 CI check 2023-11-02 21:03:27 +01:00
Guillaume Gomez
a1902a81d9 Force mangling version for rustc_codegen_gcc 2023-11-02 21:03:27 +01:00
Guillaume Gomez
4b290d40a5 Only run cg_gcc tests on linux x86_64 2023-11-02 21:03:27 +01:00
Guillaume Gomez
edfd67b598 Pass --sysroot option 2023-11-02 21:03:27 +01:00
Guillaume Gomez
7f6aa4422c Add comment explaning when to uncomment the prepare command code 2023-11-02 21:03:27 +01:00
Guillaume Gomez
05a84760f6 Fix rustc_codegen_gcc lto issue 2023-11-02 21:03:27 +01:00
Guillaume Gomez
3c58feaa08 Fix config.sh script 2023-11-02 21:03:27 +01:00
Guillaume Gomez
ead5dffeec Fix missing error libgccjit in CI 2023-11-02 21:03:27 +01:00
Guillaume Gomez
ded81de066 Fix compilation errors in rustc_codegen_gcc examples 2023-11-02 21:03:27 +01:00
Guillaume Gomez
42bdc873e5 Disable master feature by default when building rustc_codegen_gcc 2023-11-02 21:03:27 +01:00
Guillaume Gomez
c6ace5c564 Run rustc_codegen_gcc tests in the CI 2023-11-02 21:03:27 +01:00