Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #106632

Closed
wants to merge 34 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RedDocMD and others added 30 commits December 13, 2022 15:57
If we have a call such as `foo(&mut buf)` and after reference
collapsing the type is inferred as `&T` where-as the required type is
`&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically
and the issue lies elsewhere, not in the borrow.

Fixes rust-lang#105645
A number of tests under ui/const-ptr and ui/consts are currently
failing on big-endian platforms as the binary encoding of some
constants is hard-coded in the stderr test files.  Fix this by
providing a normalize-stderr-test rule that strips out the
raw bytes hex dump, so the comparison can be done in an
endianness-independent manner.  Note that in most cases, this
means the tests are now also independent of word size, so the
32bit and 64bit cases can be re-unified.

To keep tests that verify the details of those raw bytes dumps,
a new test case raw-bytes.rs performs the tests where the hex
dumps were stripped out a second time, but only on little-
endian platforms.

In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes
an endian-specific difference in this diagnostic output:
   constructing invalid value at .<deref>[0]: encountered 0x11,
   but expected a boolean
depending on which byte of D0 is not a boolean value (0 or 1).
Fixed this by choosing a value of D0 that differs from 0 or 1
in all bytes.

Fixes part of rust-lang#105383.
Fuchsia already uses SCS by default for C/C++ code on ARM hardware.
This patch allows SCS to be used for Rust code as well.
Instead of just switching to a probe, check for different matches, and see how many there are.
If one, unify it, otherwise return true and let it be unified later.
This prevents an ICE due to a value not actually being evaluatable later.
Simplify match statement

Add multiple tests
- 1 test for checking `N + 1 + 1` does not unify with `N+1`
- 2 tests for checking that a function that uses two parameters only returns the parameter that
  is actually used.
- Check exact repeat predicates
…yUwU

Change a commit_if_ok call to probe

Removes an over-eager `commit_if_ok` which makes inference worse.

I'm not entirely sure whether it's ok to remove the check that types are the same, because casting seems to cause equality checks with incorrect types?

Fixes rust-lang#105037

r? `@BoxyUwU`
Remove invalid case for mutable borrow suggestion

If we have a call such as `foo(&mut buf)` and after reference
collapsing the type is inferred as `&T` where-as the required type is
`&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically
and the issue lies elsewhere, not in the borrow.

Fixes rust-lang#105645
…r=oli-obk

Fix ui constant tests for big-endian platforms

A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files.

Fix this by a combination of two types of changes:

- Where possible (i.e. where the particular value of a constant does not affect the purpose of the test), choose constant values that have the same encoding on big- and little-endian platforms.

- Where this is not possible, provide a normalize-stderr-test rule that transforms the printed big-endian encoding of such constants into the corresponding little-endian form.

Fixes part of rust-lang#105383.
Enable Shadow Call Stack for Fuchsia on AArch64

Fuchsia already uses SCS by default for C/C++ code on ARM hardware. This patch allows SCS to be used for Rust code as well.
…, r=oli-obk

Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`

Makes sense for this function to live with its sibling `resolve_regions_and_report_errors`, around which it's basically just a wrapper.
Fix incorrect suggestion for extra `&` in pattern

Closes rust-lang#106182
…didates, r=oli-obk

Prefer non-`[type error]` candidates during selection

Fixes rust-lang#102130
Fixes rust-lang#106351

r? types

note: Alternatively we could filter out error where-clauses during param-env construction? But we still need to filter out impls with errors during `match_impl`, I think.
…r=lcnr

Simplify some canonical type alias names

* delete the `Canonicalized<'tcx>` type alias in favor for `Canonical<'tcx>`
* `CanonicalizedQueryResponse` -> `CanonicalQueryResponse`

I don't particularly care about the latter, but it should be consistent. We could alternatively delete the first alias and rename the struct to `Canonicalized`, and then keep the name of `CanonicalizedQueryResponse` untouched.
Yuki Okushi added 4 commits January 9, 2023 21:38
…=lcnr

Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`

I have no idea how to test this reliably, but I've **manually** verified it fixes the instability in rust-lang#106417 that isn't due to dtolnay/trybuild#212.

Fixes rust-lang#106417
…ters-borrowck, r=estebank

Use fmt named parameters in rustc_borrowck
…erbose, r=estebank

Render missing generics suggestion verbosely

It's a bit easier to read like this, especially ones that are appending new generics onto an existing list, like ": `, T`" which render somewhat poorly inline.

Also don't suggest `dyn` as a type parameter to add, even if technically that's valid in edition 2015.
…aumeGomez

error-code docs improvements (No. 2)

- Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord.
- Wrote docs and UI test for `E0711`, again with the header.
- `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though.

r? `@GuillaumeGomez`
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 9, 2023
@JohnTitor
Copy link
Member Author

@bors r+ p=12 rollup=never

@bors
Copy link
Contributor

bors commented Jan 9, 2023

📌 Commit f76045e has been approved by JohnTitor

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2023
@Noratrieb
Copy link
Member

CI failed some tests, I doubt that the rollup will succeed, right?

@JohnTitor
Copy link
Member Author

Yes, recreated a new one, thanks!

@JohnTitor JohnTitor closed this Jan 9, 2023
@JohnTitor JohnTitor deleted the rollup-o7akraf branch January 9, 2023 14:37
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.............................iii........................................................ 14080/14132
....................................................
failures:

---- [ui] src/test/ui/traits/ignore-err-impls.rs stdout ----

2   --> $DIR/ignore-err-impls.rs:6:14
3    |
3    |
4 LL | impl Generic<Type> for S {}
-    |     |
-    |     |
-    |     help: you might be missing a type parameter: `<Type>`
+    |
+ help: you might be missing a type parameter
+    |
+    |
+ LL | impl<Type> Generic<Type> for S {}
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
8 
9 error: aborting due to previous error
10 
---
To only update this specific test, also pass `--test-args traits/ignore-err-impls.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/ignore-err-impls.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/ignore-err-impls" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/ignore-err-impls/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0412]: cannot find type `Type` in this scope
  --> /checkout/src/test/ui/traits/ignore-err-impls.rs:6:14
   |
LL | impl Generic<Type> for S {}
   |
help: you might be missing a type parameter
   |
   |
LL | impl<Type> Generic<Type> for S {}

error: aborting due to previous error

For more information about this error, try `rustc --explain E0412`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.