Rollup merge of #68348 - xfix:patch-14, r=nagisa
Make iter::Empty<T> Send and Sync for any T Continuing from #57682 It's quite funny, when I initially submitted this pull request, I said "Likely nobody will be using that property of `iter::empty`", but then a year later I got a compilation error because it wasn't `Send` and `Sync`. Unfortunately, `PhantomData<fn() -> T>` still errors out. Oh well. I proposed ` struct PhantomFnWorkaround<T>(fn() -> T);`, but dtolnay did not like it, so using explicit implementations.
This commit is contained in:
commit
d276e6942e
2 changed files with 6 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ fn main() {
|
|||
is_sync_send!((1..));
|
||||
is_sync_send!(repeat(1));
|
||||
is_sync_send!(empty::<usize>());
|
||||
is_sync_send!(empty::<*mut i32>());
|
||||
is_sync_send!(once(1));
|
||||
|
||||
// for option.rs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue