-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generator layout: ignore fake borrows
- Loading branch information
Showing
3 changed files
with
42 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// check-pass | ||
// edition: 2021 | ||
|
||
// regression test for #117059 | ||
struct SendNotSync(*const ()); | ||
unsafe impl Send for SendNotSync {} | ||
// impl !Sync for SendNotSync {} // automatically disabled | ||
|
||
struct Inner { | ||
stream: SendNotSync, | ||
state: bool, | ||
} | ||
|
||
struct SendSync; | ||
impl std::ops::Deref for SendSync { | ||
type Target = Inner; | ||
fn deref(&self) -> &Self::Target { | ||
todo!(); | ||
} | ||
} | ||
|
||
async fn next() { | ||
let inner = SendSync; | ||
match inner.state { | ||
true if false => {} | ||
false => async {}.await, | ||
_ => {} | ||
} | ||
} | ||
|
||
fn is_send<T: Send>(_: T) {} | ||
fn main() { | ||
is_send(next()) | ||
} |