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 9 pull requests #110976

Closed
wants to merge 24 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 24 commits April 18, 2023 19:44
We really shouldn't be naming functions `fn check_*` unless they're
doing *typechecking*. It's especially misleading when we're doing this
inside of HIR typeck.
This updates the `openssl-sys` crate to 0.9.87 to support building the
toolchain against the system libraries provided by LibreSSL version 3.7.x.

LibreSSL 3.7.x has been supported since `openssl-sys` version 0.9.85.
… r=cjgillot

Tweak borrow suggestion span

Avoids a `span_to_snippet` call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a `&` was prevented me from using `// run-rustfix` in another PR (rust-lang#110432 (comment)).

Also some drive-by renames of functions that have been annoying me for a bit.
…w-response, r=lcnr

Clear response values for overflow in new solver

When we have an overflow, return a trivial query response. This fixes an ICE with the code described in rust-lang#110544:

```rust
trait Trait {}

struct W<T>(T);

impl<T, U> Trait for W<(W<T>, W<U>)>
where
    W<T>: Trait,
    W<U>: Trait,
{}

fn impls<T: Trait>() {}

fn main() {
    impls::<W<_>>()
}
```

Where, while proving `W<?0>: Trait`, we overflow but still apply the query response of `?0 = (W<?1>, W<?2>)`. Then while re-processing the query to validate that our evaluation result was stable, we get a different query response that looks like `?1 = (W<?3>, W<?4>), ?2 = (W<?5>, W<?6>)`, and so we trigger the ICE.

Also, by returning a trivial query response we also avoid the infinite-loop/OOM behavior of the old solver.

r? `@lcnr`
…sts, r=Mark-Simulacrum

Update tests for libtest `--format json`

This PR makes the test work on beta and stable, and adds a test ensuring the option is not available on beta and stable. Backported these commits from rust-lang#110414.
…rk-Simulacrum

Bump libffi-sys to 2.3.0

Bump libffi-sys to 2.3.0 that includes LoongArch support.

Thanks

Related: rust-lang/miri#2858
include source error for LoadLibraryExW

In rust-lang#107595, we added retry behavior for LoadLibraryExW on Windows. If it fails we do not print the underlying error that Windows returned. This made rust-lang#110889 a little harder to debug.

In this PR I am adding the source error in the message if it is available.
…crum

Add support for LibreSSL 3.7.x

This updates the `openssl-sys` crate to 0.9.87 to support building the toolchain against the system libraries provided by LibreSSL version 3.7.x.

LibreSSL 3.7.x has been supported since `openssl-sys` version 0.9.85.
… r=cuviper

Make sure that some stdlib method signatures aren't accidental refinements

In the process of implementing https://rust-lang.github.io/rfcs/3245-refined-impls.html, I found a bunch of stdlib implementations that accidentally "refined" their method signatures by dropping  (unnecessary) bounds.

This isn't currently a problem, but may become one if/when method  signature refining is stabilized in the future. Shouldn't hurt to make these signatures a bit more accurate anyways.

NOTE (just to be clear lol): This does not affect behavior at all, since we don't actually take advantage of refined implementations yet!
… r=cjgillot

Don't duplicate anonymous lifetimes for async fn in traits

`record_lifetime_params_for_async` needs to be called outside of the scope of the function, or else it'll end up collecting anonymous lifetimes twice (those on the function and those within the `AnonymousCreateParameter` rib). This matches how `record_lifetime_params_for_async` is being used for functions with bodies below.

This fixes (partially) rust-lang#110963 when the lifetimes are late-bound, but does not do so when the lifetimes are early-bound (as seen from the known-bug that I added).
@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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative labels Apr 29, 2023
@rustbot rustbot added the rollup A PR which is a rollup label Apr 29, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Apr 29, 2023

📌 Commit e8a3d8c has been approved by matthiaskrgr

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 Apr 29, 2023
@bors
Copy link
Contributor

bors commented Apr 29, 2023

⌛ Testing commit e8a3d8c with merge 927ab3c2f491ec8eff16974a00da72ab6e3d9bbb...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] tests/ui/typeck/bad-index-due-to-nested.rs stdout ----
diff of stderr:

36 LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
38 LL |     map[k]
-    |         ^
-    |         |
-    |         |
-    |         expected `&K`, found type parameter `K`
-    |         help: consider borrowing here: `&k`
+    |         ^ expected `&K`, found type parameter `K`
44    = note:   expected reference `&K`
45            found type parameter `K`

+ help: consider borrowing here
+ help: consider borrowing here
+    |
+ LL |     map[&k]
46 
47 error[E0308]: mismatched types
48   --> $DIR/bad-index-due-to-nested.rs:20:5


50 LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
51    |                 - this type parameter               ----- expected `&'a V` because of return type
52 LL |     map[k]
-    |     |
-    |     |
-    |     expected `&V`, found type parameter `V`
-    |     help: consider borrowing here: `&map[k]`
+    |     ^^^^^^ expected `&V`, found type parameter `V`
58    = note:   expected reference `&'a V`
59            found type parameter `V`

+ help: consider borrowing here
+ help: consider borrowing here
+    |
+ LL |     &map[k]
60 
61 error: aborting due to 4 previous errors
62 

---
To only update this specific test, also pass `--test-args typeck/bad-index-due-to-nested.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/typeck/bad-index-due-to-nested.rs" "-Zthreads=1" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--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" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/bad-index-due-to-nested" "-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/typeck/bad-index-due-to-nested/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `K: Hash` is not satisfied
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
LL |     map[k]
LL |     map[k]
   |     ^^^ the trait `Hash` is not implemented for `K`
   |
note: required by a bound in `<HashMap<K, V> as Index<&K>>`
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:9:8
LL |     K: Hash,
LL |     K: Hash,
   |        ^^^^ required by this bound in `<HashMap<K, V> as Index<&K>>`
help: consider restricting type parameter `K`
   |
LL | fn index<'a, K: std::hash::Hash, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {


error[E0277]: the trait bound `V: Copy` is not satisfied
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
LL |     map[k]
   |     ^^^ the trait `Copy` is not implemented for `V`
   |
   |
note: required by a bound in `<HashMap<K, V> as Index<&K>>`
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:10:8
LL |     V: Copy,
LL |     V: Copy,
   |        ^^^^ required by this bound in `<HashMap<K, V> as Index<&K>>`
help: consider restricting type parameter `V`
   |
LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V {

error[E0308]: mismatched types
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:9
   |
   |
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
LL |     map[k]
LL |     map[k]
   |         ^ expected `&K`, found type parameter `K`
   = note:   expected reference `&K`
           found type parameter `K`
help: consider borrowing here
   |
   |
LL |     map[&k]
   |         +

error[E0308]: mismatched types
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
   |
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
   |                 - this type parameter               ----- expected `&'a V` because of return type
LL |     map[k]
   |     ^^^^^^ expected `&V`, found type parameter `V`
   = note:   expected reference `&'a V`
           found type parameter `V`
help: consider borrowing here
   |

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] tests/ui/typeck/bad-index-due-to-nested.rs stdout ----
diff of stderr:

36 LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
38 LL |     map[k]
-    |         ^
-    |         |
-    |         |
-    |         expected `&K`, found type parameter `K`
-    |         help: consider borrowing here: `&k`
+    |         ^ expected `&K`, found type parameter `K`
44    = note:   expected reference `&K`
45            found type parameter `K`

+ help: consider borrowing here
+ help: consider borrowing here
+    |
+ LL |     map[&k]
46 
47 error[E0308]: mismatched types
48   --> $DIR/bad-index-due-to-nested.rs:20:5


50 LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
51    |                 - this type parameter               ----- expected `&'a V` because of return type
52 LL |     map[k]
-    |     |
-    |     |
-    |     expected `&V`, found type parameter `V`
-    |     help: consider borrowing here: `&map[k]`
+    |     ^^^^^^ expected `&V`, found type parameter `V`
58    = note:   expected reference `&'a V`
59            found type parameter `V`

+ help: consider borrowing here
+ help: consider borrowing here
+    |
+ LL |     &map[k]
60 
61 error: aborting due to 4 previous errors
62 

---
To only update this specific test, also pass `--test-args typeck/bad-index-due-to-nested.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/typeck/bad-index-due-to-nested.rs" "-Zthreads=1" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--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" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/bad-index-due-to-nested" "-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/typeck/bad-index-due-to-nested/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `K: Hash` is not satisfied
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
LL |     map[k]
LL |     map[k]
   |     ^^^ the trait `Hash` is not implemented for `K`
   |
note: required by a bound in `<HashMap<K, V> as Index<&K>>`
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:9:8
LL |     K: Hash,
LL |     K: Hash,
   |        ^^^^ required by this bound in `<HashMap<K, V> as Index<&K>>`
help: consider restricting type parameter `K`
   |
LL | fn index<'a, K: std::hash::Hash, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {


error[E0277]: the trait bound `V: Copy` is not satisfied
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
LL |     map[k]
   |     ^^^ the trait `Copy` is not implemented for `V`
   |
   |
note: required by a bound in `<HashMap<K, V> as Index<&K>>`
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:10:8
LL |     V: Copy,
LL |     V: Copy,
   |        ^^^^ required by this bound in `<HashMap<K, V> as Index<&K>>`
help: consider restricting type parameter `V`
   |
LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V {

error[E0308]: mismatched types
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:9
   |
   |
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
LL |     map[k]
LL |     map[k]
   |         ^ expected `&K`, found type parameter `K`
   = note:   expected reference `&K`
           found type parameter `K`
help: consider borrowing here
   |
   |
LL |     map[&k]
   |         +

error[E0308]: mismatched types
  --> fake-test-src-base/typeck/bad-index-due-to-nested.rs:20:5
   |
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
   |                 - this type parameter               ----- expected `&'a V` because of return type
LL |     map[k]
   |     ^^^^^^ expected `&V`, found type parameter `V`
   = note:   expected reference `&'a V`
           found type parameter `V`
help: consider borrowing here
   |

@bors
Copy link
Contributor

bors commented Apr 29, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2023
@matthiaskrgr matthiaskrgr deleted the rollup-hxwb09u branch March 16, 2024 18:19
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-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants