compiletest: Use remap-path-prefix only in CI
This makes jump-to-definition work in most IDEs, as well as being easier to understand for contributors.
Fixes https://github.com/rust-lang/rust/issues/109725. cc `@TimNN`
Fix a couple ICEs in the new `CastKind::Transmute` code
Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.
Fixes#110005Fixes#109992Fixes#110032
cc `@matthiaskrgr`
prioritize param env candidates if they don't guide type inference
intended to supersede #109579. We disable the prioritization during coherence to maintain completeness.
Long term we can hopefully replace this hack with adding OR to external constraints at which point the only relevant part when merging responses is whether they guide type inference in the same way.
Reuses `try_merge_responses` for assembly and the cleanest way to impl that was to actually split that so that `try_merge_responses` returns `None` if we fail to merge them and then add `flounder` which is used afterwards which is allowed to lower the certainty of our responses.
If, in the future, we add the ability to merge candidates `YES: ?0 = Vec<u32>` and `YES: ?0 = Vec<i32>` to `AMBIG: ?0 = Vec<?1>`, this should happen in `flounder`.
r? `@compiler-errors` `@BoxyUwU`
Fix macOS and Windows installers when rust-docs is not available.
This fixes the macOS `.pkg` and Windows `.msi` installers to work when rust-docs is not available. If the rust-docs component is not built, then the installer would fail. This adds the rust-docs component to the filtering mechanism so that the rust-docs line of the distribution definition aren't included.
I tested installing and uninstalling both with and without the rust-docs component available.
This happens on the aarch64-apple-darwin distribution provided by rust-lang since we currently disable the rust-docs component due to long build times. An alternate solution would be to just enable the rust-docs component on aarch64-apple-darwin since there are faster build systems.
Fixes#109877
Migrate remainder of rustc_ty_utils to `SessionDiagnostic`
This moves the remaining errors in `rust_ty_utils` to `SessionsDiagnostic`.
r? ``@davidtwco``
Instantiate instead of erasing binder when probing param methods
Fixes#108836
There is a really old comment saying that a `WhereClauseCandidate` probe candidate "should not contain any inference variables", but I'm not really confident that that comment applies anymore. In contrast, other candidates that we assemble during method probe contain inference variables in their substitutions (e.g. `InherentImplCandidate`)...
Since this change is made only to support a nightly feature, I'm happy to gate the new behavior behind this feature flag or discuss it further.
r? types
The shadowing lead to an incorrect comparison. Rename it and compare it
properly. compiler-errors told me that I should just include the fix
here without a test.
Better diagnostic when pattern matching tuple structs
Fixes#108284
When trying to pattern match a tuple struct we might get a flawed error message if there are missing fields. E.g.
```
let x = Foo(100, 200);
if let Foo { 0: bar } = x { ... }
```
Produces this error:
```
error[E0769]: tuple variant `Foo` written as struct variant
--> hello.rs:5:12
|
5 | if let Foo { 0: foo } = x {
| ^^^^^^^^^^^^^^
|
help: use the tuple variant pattern syntax instead
|
5 | if let Foo(_, _) = x {
| ~~~~~~
```
Which doesn't highlight that we can still use the struct syntax but we need to fill missing fields. This pr changes this error to:
```
error[E0027]: pattern does not mention field `1`
--> hello.rs:5:12
|
5 | if let Foo { 0: foo } = x {
| ^^^^^^^^^^^^^^ missing field `1`
|
help: include the missing field in the pattern
|
5 | if let Foo { 0: foo, 1: _ } = x {
| ~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
5 | if let Foo { 0: foo, .. } = x {
| ~~~~~~
```
[missing_const_for_fn] fix#7121
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: [`missing_const_for_fn`] note about removing const may break compatibility
fix#7121
Add `max_line_length` to `.editorconfig`, matching `rustfmt.toml`
Add `max_line_length` to `.editorconfig` to match the `max_width` in `rustfmt.toml`.
changelog: none