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 11 pull requests #82036

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
86a4b27
Increment `self.index` before calling `Iterator::self.a.__iterator_ge…
sdroege Feb 4, 2021
f82315a
Don't release Miri if its tests only failed on Windows
Feb 2, 2021
f87afe5
Extend the comment of `check_toolstate()` to clarify that the tool wo…
Feb 6, 2021
55ca27f
use rwlock for accessing ENV
the8472 Feb 6, 2021
406fd3a
silence dead code warnings on windows
the8472 Feb 7, 2021
c7d9bff
HWASan support
Jan 23, 2021
9c34c14
HWASan documentation
Feb 8, 2021
2200cf1
avoid &mut on the read path since it now allows concurrent readers
the8472 Feb 8, 2021
44abad5
introduce StaticRWLock wrapper to make methods safe
the8472 Feb 8, 2021
1d9ac3c
Fix const generics in GAT
BoxyUwU Feb 9, 2021
4fc181d
split guard into read and write types
the8472 Feb 9, 2021
2c4337a
Comments :3
BoxyUwU Feb 10, 2021
0422745
Fix comment smol mistakes
BoxyUwU Feb 10, 2021
0ffa2da
comma...
BoxyUwU Feb 10, 2021
d64b749
Allow casting mut array ref to mut ptr
osa1 Jan 28, 2021
7ca96ed
rewrite the comments
BoxyUwU Feb 10, 2021
01f5a2a
Ensures `make` tests run under /bin/dash, like CI, and fixes a Makefile
richkadel Feb 4, 2021
625803d
Set SHELL = /bin/dash only if it exists
richkadel Feb 6, 2021
b211acf
Re-blessed the partial_eq.rs coverage test
richkadel Feb 11, 2021
02ffe9e
Fix injected errors when running doctests on a crate named after a ke…
jyn514 Dec 6, 2020
fda71d6
Push a `char` instead of a `str` with len one into a String
LingMan Feb 12, 2021
f546633
Remove unnecessary lint allow attrs on example
MikailBag Feb 12, 2021
fde59a8
Use `Iterator::all` instead of open-coding it
LingMan Feb 12, 2021
c2ac7cf
Rollup merge of #79775 - jyn514:doctest, r=GuillaumeGomez
Dylan-DPC Feb 12, 2021
7946b80
Rollup merge of #81479 - osa1:issue24151, r=lcnr
Dylan-DPC Feb 12, 2021
a1b0549
Rollup merge of #81506 - vo4:hwasan, r=nagisa
Dylan-DPC Feb 12, 2021
abafbf3
Rollup merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simul…
Dylan-DPC Feb 12, 2021
b92d132
Rollup merge of #81734 - richkadel:fixfordash, r=pnkfelix
Dylan-DPC Feb 12, 2021
a79a1da
Rollup merge of #81741 - sdroege:zip-trusted-random-access-specializa…
Dylan-DPC Feb 12, 2021
8683bff
Rollup merge of #81850 - the8472:env-rwlock, r=m-ou-se
Dylan-DPC Feb 12, 2021
172adb4
Rollup merge of #81911 - BoxyUwU:constgenericgaticefix, r=nikomatsakis
Dylan-DPC Feb 12, 2021
a88ae80
Rollup merge of #82022 - LingMan:single_char, r=jonas-schievink
Dylan-DPC Feb 12, 2021
3db4afd
Rollup merge of #82023 - MikailBag:boxed-docs-unallow, r=jyn514
Dylan-DPC Feb 12, 2021
3c50257
Rollup merge of #82030 - LingMan:init_directly, r=varkor
Dylan-DPC Feb 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Increment self.index before calling `Iterator::self.a.__iterator_ge…
…t_unchecked` in `Zip` `TrustedRandomAccess` specialization

Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the
index would not have been incremented yet and another call to
`Iterator::next` would read from the same index again, which is not
allowed according to the API contract of `TrustedRandomAccess` for
`!Clone`.

Fixes #81740
sdroege committed Feb 4, 2021
commit 86a4b27475aab52b998c15f5758540697cc9cff0
7 changes: 4 additions & 3 deletions library/core/src/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
@@ -198,12 +198,13 @@ where
Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i)))
}
} else if A::may_have_side_effect() && self.index < self.a.size() {
let i = self.index;
self.index += 1;
// match the base implementation's potential side effects
// SAFETY: we just checked that `self.index` < `self.a.len()`
// SAFETY: we just checked that `i` < `self.a.len()`
unsafe {
self.a.__iterator_get_unchecked(self.index);
self.a.__iterator_get_unchecked(i);
}
self.index += 1;
None
} else {
None