forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#68568 - pietroalbini:stable-next, r=pietroalbini
[stable] Rust 1.41.0 stable release This PR produces the 1.41.0 stable release, backporting the following PRs as well: * rust-lang#68494: Make pointers to statics internal * rust-lang#67928: Update RELEASES.md for 1.41.0 r? @ghost
- Loading branch information
Showing
8 changed files
with
207 additions
and
36 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
33 changes: 33 additions & 0 deletions
33
src/test/ui/async-await/issues/issue-67611-static-mut-refs.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,33 @@ | ||
// build-pass | ||
// edition:2018 | ||
|
||
static mut A: [i32; 5] = [1, 2, 3, 4, 5]; | ||
|
||
fn is_send_sync<T: Send + Sync>(_: T) {} | ||
|
||
async fn fun() { | ||
let u = unsafe { A[async { 1 }.await] }; | ||
unsafe { | ||
match A { | ||
i if async { true }.await => (), | ||
_ => (), | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
let index_block = async { | ||
let u = unsafe { A[async { 1 }.await] }; | ||
}; | ||
let match_block = async { | ||
unsafe { | ||
match A { | ||
i if async { true }.await => (), | ||
_ => (), | ||
} | ||
} | ||
}; | ||
is_send_sync(index_block); | ||
is_send_sync(match_block); | ||
is_send_sync(fun()); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/ui/generator/static-mut-reference-across-yield.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,29 @@ | ||
// build-pass | ||
#![feature(generators)] | ||
|
||
static mut A: [i32; 5] = [1, 2, 3, 4, 5]; | ||
|
||
fn is_send_sync<T: Send + Sync>(_: T) {} | ||
|
||
fn main() { | ||
unsafe { | ||
let gen_index = static || { | ||
let u = A[{ | ||
yield; | ||
1 | ||
}]; | ||
}; | ||
let gen_match = static || match A { | ||
i if { | ||
yield; | ||
true | ||
} => | ||
{ | ||
() | ||
} | ||
_ => (), | ||
}; | ||
is_send_sync(gen_index); | ||
is_send_sync(gen_match); | ||
} | ||
} |