-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #123869 - matthiaskrgr:rollup-9kif9c9, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #123654 (typeck: fix `?` suggestion span) - #123807 (Remove `sys_common::thread`) - #123834 (Don't do coroutine-closure-specific upvar analysis if tainted by errors) - #123847 (Suppress `let else` suggestion for uninitialized refutable `let`s) - #123857 (std::net: TcpListener shrinks the backlog argument to 32 for Haiku.) - #123858 (zkvm: fix path to cmath in zkvm module) - #123867 (Add `unsafe` to two functions with safety invariants) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
23 changed files
with
230 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//@ edition: 2021 | ||
|
||
#![feature(async_closure)] | ||
|
||
struct DropMe; | ||
|
||
trait Impossible {} | ||
fn trait_error<T: Impossible>() {} | ||
|
||
pub fn main() { | ||
let b = DropMe; | ||
let async_closure = async move || { | ||
// Type error here taints the environment. This causes us to fallback all | ||
// variables to `Error`. This means that when we compute the upvars for the | ||
// *outer* coroutine-closure, we don't actually see any upvars since `MemCategorization` | ||
// and `ExprUseVisitor`` will bail early when it sees error. This means | ||
// that our underlying assumption that the parent and child captures are | ||
// compatible ends up being broken, previously leading to an ICE. | ||
trait_error::<()>(); | ||
//~^ ERROR the trait bound `(): Impossible` is not satisfied | ||
let _b = b; | ||
}; | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0277]: the trait bound `(): Impossible` is not satisfied | ||
--> $DIR/dont-ice-when-body-tainted-by-errors.rs:19:23 | ||
| | ||
LL | trait_error::<()>(); | ||
| ^^ the trait `Impossible` is not implemented for `()` | ||
| | ||
help: this trait has no implementations, consider adding one | ||
--> $DIR/dont-ice-when-body-tainted-by-errors.rs:7:1 | ||
| | ||
LL | trait Impossible {} | ||
| ^^^^^^^^^^^^^^^^ | ||
note: required by a bound in `trait_error` | ||
--> $DIR/dont-ice-when-body-tainted-by-errors.rs:8:19 | ||
| | ||
LL | fn trait_error<T: Impossible>() {} | ||
| ^^^^^^^^^^ required by this bound in `trait_error` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/ui/let-else/uninitialized-refutable-let-issue-123844.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// https://github.com/rust-lang/rust/issues/123844 | ||
// An uninitialized refutable let should not suggest `let else`, as it can't be used with deferred | ||
// initialization. | ||
|
||
fn main() { | ||
let Some(x); //~ ERROR refutable pattern in local binding | ||
x = 1; | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/ui/let-else/uninitialized-refutable-let-issue-123844.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0005]: refutable pattern in local binding | ||
--> $DIR/uninitialized-refutable-let-issue-123844.rs:6:9 | ||
| | ||
LL | let Some(x); | ||
| ^^^^^^^ pattern `None` not covered | ||
| | ||
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant | ||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html | ||
= note: the matched value is of type `Option<i32>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0005`. |
Oops, something went wrong.