Commit Graph

237765 Commits

Author SHA1 Message Date
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
bors
b20f40dba9 Auto merge of #117521 - GuillaumeGomez:impl-on-foreign-order, r=notriddle
Fix order of implementations in the "implementations on foreign types" section

Fixes #117391.

We forgot to run the `sort_by_cached_key` on this section. This fixes it.

r? `@notriddle`
2023-11-02 17:54:29 +00:00
Guillaume Gomez
2e4a36bb53 Add GUI test to ensure that implementations on foreign types are in the expected order 2023-11-02 18:02:14 +01:00
Guillaume Gomez
aa9d1d87fa Fix order of implementations in the "implementations on foreign types" section 2023-11-02 18:02:14 +01:00
bors
c5afe0a61e Auto merge of #117513 - matthiaskrgr:rollup-jvl6y84, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #117394 (use global cache when computing proof trees)
 - #117495 (Clarify `Unsize` documentation)
 - #117509 (Remove support for alias `-Z symbol-mangling-version`)
 - #117512 (Expand mem::offset_of! docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-02 14:46:23 +00:00
Matthias Krüger
6268598dfb
Rollup merge of #117512 - joshlf:patch-8, r=dtolnay
Expand mem::offset_of! docs

Makes progress on #106655
2023-11-02 15:31:22 +01:00
Matthias Krüger
67b51879e3
Rollup merge of #117509 - Zalathar:zsymbol, r=petrochenkov
Remove support for alias `-Z symbol-mangling-version`

(This is very similar to the removal of `-Z instrument-coverage` in #117111.)

`-C symbol-mangling-version` was stabilized back in rustc 1.59.0 (2022-02-24) via #90128, with the old unstable flag kept around (with a warning) as an alias to ease migration.
2023-11-02 15:31:21 +01:00
Matthias Krüger
9575625835
Rollup merge of #117495 - compiler-errors:unsize-docs, r=lcnr
Clarify `Unsize` documentation

The documentation erroneously says that:

```rust
/// - Types implementing a trait `Trait` also implement `Unsize<dyn Trait>`.
/// - Structs `Foo<..., T, ...>` implement `Unsize<Foo<..., U, ...>>` if all of these conditions
///   are met:
///   - `T: Unsize<U>`.
///   - Only the last field of `Foo` has a type involving `T`.
///   - `Bar<T>: Unsize<Bar<U>>`, where `Bar<T>` stands for the actual type of that last field.
```

Specifically, `T: Unsize<U>` is not required to hold -- only the final field must implement `FinalField<T>: Unsize<FinalField<U>>`. This can be demonstrated by the test I added.

---

Second commit fleshes out the documentation a lot more.
2023-11-02 15:31:21 +01:00
Matthias Krüger
298edd6d46
Rollup merge of #117394 - lcnr:proof-tree-cache4, r=compiler-errors
use global cache when computing proof trees

we're writing the solver while relying on the existence of the global cache to avoid exponential blowup. By disabling the global cache when building proof trees, it is easy to get hangs, e.g. when computing intercrate ambiguity causes.

Removes the unstable `-Zdump_solver_proof_tree_use_cache` option, as we now always return a full proof tree.

r? `@compiler-errors`
2023-11-02 15:31:20 +01:00
Joshua Liebow-Feeser
2cc92e666f
Update mod.rs 2023-11-02 06:45:32 -07:00
Joshua Liebow-Feeser
9cf1a48599
Update mod.rs 2023-11-02 05:57:31 -07:00
bors
b800c30352 Auto merge of #117466 - compiler-errors:alias-bound, r=aliemjay
Don't check for alias bounds in liveness when aliases have escaping bound vars

I actually have no idea how we *should* be treating aliases with escaping bound vars here... but the simplest behavior is just doing what we used to do before.

r? aliemjay

Fixes #117455
2023-11-02 12:47:14 +00:00
Joshua Liebow-Feeser
ec7996df7c
Remove trailing space 2023-11-02 05:35:08 -07:00
Joshua Liebow-Feeser
9bfd1c4bdb
Expand mem::offset_of! docs
Makes progress on #106655
2023-11-02 05:25:57 -07:00
Michael Goulet
4d5d763e05 Don't check for alias bounds in liveness when aliases have escaping bound vars 2023-11-02 10:25:57 +00:00
bors
62270fb4d6 Auto merge of #117204 - nnethercote:rustc_ast_passes, r=compiler-errors
Minor improvements to `rustc_ast_passes`

Some improvements I found while looking at this code.

r? `@compiler-errors`
2023-11-02 10:08:53 +00:00
lcnr
15ae59ba03 use global cache when computing proof trees 2023-11-02 10:41:27 +01:00
bors
46455dc650 Auto merge of #117386 - roblabla:fix-switch-stdio-win7, r=ChrisDenton
Fix switch_stdout_to on Windows7

The `switch_stdout_to` test was broken on Windows7, as deleting the temporary test folder would fail since the `switch-stdout-output` file we redirected the stdout to is never closed, and it's impossible on Win7 to delete an opened file.

To fix this issue, we make `switch_stdout_to` return the previous handle. Using this, we add a new `switch_stdout_to` call at the end of the test to return the stdio handles to their original state, and recover the handle to the file we opened. This handle is automatically closed at the end of the function, which should allow the temporary test folder to be deleted properly.
2023-11-02 07:58:38 +00:00
Zalathar
76103a8f6e Remove support for alias -Z symbol-mangling-version 2023-11-02 18:41:33 +11:00
Zalathar
a9e1e43b56 Add UI tests for values accepted by -C symbol-mangling-version 2023-11-02 18:20:42 +11:00
bors
42e1e1208b Auto merge of #117506 - massivebird:ord-typo, r=ChrisDenton
fixes: typo in `std::cmp::Ord` trait docs

Pluralizes the word "sequence"
2023-11-02 04:58:24 +00:00
massivebird
5b342b7953 fixes: typo in std::cmp::Ord trait docs 2023-11-01 23:23:34 -04:00
bors
722b3eeb72 Auto merge of #117498 - matthiaskrgr:rollup-z7mg4ck, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #117298 (Recover from missing param list in function definitions)
 - #117373 (Avoid the path trimming ICE lint in error reporting)
 - #117441 (Do not assert in op_to_const.)
 - #117488 (Update minifier-rs version to 0.3.0)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-01 22:37:24 +00:00
Matthias Krüger
effc27dea4
Rollup merge of #117488 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier-rs version to 0.3.0

It fixes https://github.com/GuillaumeGomez/minifier-rs/issues/105.

r? ```@notriddle```
2023-11-01 21:40:06 +01:00
Matthias Krüger
4e437be044
Rollup merge of #117441 - cjgillot:diag-noassert, r=oli-obk,RalfJung
Do not assert in op_to_const.

`op_to_const` is used in `try_destructure_mir_constant_for_diagnostics`, which may encounter invalid constants created by optimizations and debugging.

r? ``@oli-obk``

Fixes https://github.com/rust-lang/rust/issues/117368
2023-11-01 21:40:06 +01:00
Matthias Krüger
3087b63d1f
Rollup merge of #117373 - saethlin:avoid-ice-lint, r=compiler-errors
Avoid the path trimming ICE lint in error reporting

Types or really anything in MIR should never be formatted without path trimming disabled, because its formatting often tries to construct trimmed paths. In this case, the lint turns a nice error report into an irrelevant ICE.
2023-11-01 21:40:05 +01:00
Matthias Krüger
2b2360abb1
Rollup merge of #117298 - clubby789:fn-missing-params, r=petrochenkov
Recover from missing param list in function definitions

Addresses the other issue mentioned in #108109
2023-11-01 21:40:05 +01:00
bors
75b064d269 Auto merge of #117029 - rmehri01:mir_opt_filecheck_inline_tests, r=cjgillot
Add FileCheck annotations to MIR-opt inlining tests

Part of #116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`.

I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop.

r? cjgillot
2023-11-01 20:37:38 +00:00
Michael Goulet
1221b7b652 Rework unsize documentation 2023-11-01 20:16:24 +00:00
Michael Goulet
6af30ec720 Remove a false statement from Unsize docs, add a test 2023-11-01 20:16:11 +00:00
Camille GILLOT
f512f91258 Comment for_diagnostics flag. 2023-11-01 19:01:55 +00:00
bors
b0a07595b5 Auto merge of #117289 - estebank:issue-72298, r=cjgillot
Account for `ref` and `mut` in the wrong place for pattern ident renaming

If the user writes `S { ref field: name }` instead of `S { field: ref name }`, we suggest the correct code.

Fix #72298.
2023-11-01 18:39:01 +00:00
Camille GILLOT
224e29030a Specify diagnostic path. 2023-11-01 18:36:38 +00:00
Camille GILLOT
0f8f77fcc2 Rebase fallout. 2023-11-01 16:55:18 +00:00
Camille GILLOT
3a55c283d0 Rename hook. 2023-11-01 16:49:18 +00:00
Camille GILLOT
a2e151ca4b Make ui into mir-opt test. 2023-11-01 16:49:18 +00:00
Camille GILLOT
c2f49e9edf Do not assert in op_to_const. 2023-11-01 16:49:18 +00:00
bors
f3457dbf84 Auto merge of #117307 - taiki-e:espidf-atomic-64, r=Amanieu
Set max_atomic_width for riscv32*-esp-espidf to 32

Fixes #117305

> Since riscv32 does not have 64-bit atomic instructions, I do not believe there is any way to fix this problem other than setting max_atomic_width of these targets to 32.

This is a breaking change because Atomic\*64 will become unavailable, but all affected targets are tier 3, and the current Atomic*64 violates the standard library's API contract and can cause problems with code that rely on the standard library's atomic types being lock-free.

r? `@Amanieu`
cc `@ivmarkov` `@MabezDev`
2023-11-01 16:39:22 +00:00
Ryan Mehri
5f75326d74 fix spans for inline_couroutine panic-abort 2023-11-01 07:58:19 -07:00
Ben Kimock
88f0688530 Avoid the path trimming ICE lint in error reporting 2023-11-01 10:54:07 -04:00
clubby789
ca1bcb6466 Recover from missing param list in function definitions 2023-11-01 14:48:20 +00:00
Guillaume Gomez
d6666e2ccc Update minifier-rs version to 0.3.0 2023-11-01 15:18:41 +01:00
bors
146dafa262 Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiser
Support enum variants in offset_of!

This MR implements support for navigating through enum variants in `offset_of!`, placing the enum variant name in the second argument to `offset_of!`. The RFC placed it in the first argument, but I think it interacts better with nested field access in the second, as you can then write things like

```rust
offset_of!(Type, field.Variant.field)
```

Alternatively, a syntactic distinction could be made between variants and fields (e.g. `field::Variant.field`) but I'm not convinced this would be helpful.

[RFC 3308 # Enum Support](https://rust-lang.github.io/rfcs/3308-offset_of.html#enum-support-offset_ofsomeenumstructvariant-field_on_variant)
Tracking Issue #106655.
2023-11-01 14:17:56 +00:00
bors
11cd1f0026 Auto merge of #117482 - matthiaskrgr:rollup-doc6jgm, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #115626 (Clean up unchecked_math, separate out unchecked_shifts)
 - #117397 (Don't emit delayed good-path bugs on panic)
 - #117401 (Refactor: move suggestion functions from demand to suggestions)
 - #117475 (Inline and remove `create_session`.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-01 12:18:36 +00:00
Matthias Krüger
515fdbf687
Rollup merge of #117475 - nnethercote:rm-create_session, r=oli-obk
Inline and remove `create_session`.

Currently the parts of session initialization that happen within `rustc_interface` are split between `run_compiler` and `create_session`. This split isn't necessary and obscures what's happening.

This commit merges the two functions. I think a single longer function is much clearer than splitting this code across two functions in different modules, especially when `create_session` has 13 parameters, and is misnamed (it also creates the codegen backend). The net result is 43 fewer lines of code.

r? ``@oli-obk``
2023-11-01 11:29:42 +01:00
Matthias Krüger
6c893e6673
Rollup merge of #117401 - chenyukang:yukang-cleanup-hir-typeck-suggestions, r=compiler-errors
Refactor: move suggestion functions from demand to suggestions

follow-up from
https://github.com/rust-lang/rust/pull/116841#discussion_r1370506700
2023-11-01 11:29:42 +01:00
Matthias Krüger
6bbe22c966
Rollup merge of #117397 - compiler-errors:dont-emit-good-path-on-panic, r=TaKO8Ki
Don't emit delayed good-path bugs on panic

This should fix #117381, cc ``@RalfJung``

As opposed to delayed bugs, delayed *good path* bugs really don't make sense to show on panics.
2023-11-01 11:29:41 +01:00
Matthias Krüger
260e07b0cb
Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomcc
Clean up unchecked_math, separate out unchecked_shifts

Tracking issue: #85122

Changes:

1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised.
2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result.
3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO.

The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-11-01 11:29:41 +01:00
bors
d1611e39c4 Auto merge of #117436 - nikic:update-llvm-16, r=cuviper
Update to LLVM 17.0.4

Fixes #116668.
Fixes #116941.
Fixes #116976.

r? `@cuviper`
2023-11-01 10:16:58 +00:00