Skip to content

Rollup of 10 pull requests #81493

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

Merged
merged 30 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8553aee
Use -target when linking binaries for Mac Catalyst
visigoth Dec 20, 2020
63a1eee
Reset LateContext enclosing body in nested items
camsteffen Jan 18, 2021
21fb586
Query for TypeckResults in LateContext::qpath_res
camsteffen Jan 18, 2021
eaba3da
Remove qpath_res util function
camsteffen Jan 18, 2021
f241c10
Improve flatten-fuse tests
SkiFire13 Jan 23, 2021
5aa625b
Manually fuse the inner iterator in FlattenCompat
SkiFire13 Jan 23, 2021
48f9dbf
clean up some const error reporting around promoteds
RalfJung Jan 24, 2021
26b4baf
Point to span of upvar making closure FnMut
sledgehammervampire Jan 18, 2021
c689b97
Split JSON into separately versioned crate
CraftSpider Jan 22, 2021
428bc14
Update cargo.lock
CraftSpider Jan 22, 2021
28f6cab
Allow rustc::default_hash_types in the offending statement
CraftSpider Jan 22, 2021
3c28069
Move into src/etc
CraftSpider Jan 22, 2021
cca4eea
Simplify conversion
CraftSpider Jan 22, 2021
3076e25
`src/etc/json-types` -> `src/rustdoc-json-types`
CraftSpider Jan 24, 2021
67b78a0
Update crate name and add README
CraftSpider Jan 25, 2021
74f26a1
Fix rustdoc page title text selection
probablykasper Jan 28, 2021
cd8dcee
rustdoc: Render HRTB correctly for bare functions
camelid Dec 12, 2020
f902551
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint
Aaron1011 Dec 7, 2020
3aa8456
Fix README typo
CraftSpider Jan 28, 2021
a124043
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
alexcrichton Nov 30, 2020
d9e56f4
Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3
JohnTitor Jan 29, 2021
4003a73
Rollup merge of #79819 - Aaron1011:feature/macro-trailing-semicolon, …
JohnTitor Jan 29, 2021
3eac643
Rollup merge of #79991 - camelid:rustdoc-for-lifetime, r=GuillaumeGom…
JohnTitor Jan 29, 2021
a3c060c
Rollup merge of #80215 - visigoth:issue-80202-fix, r=estebank
JohnTitor Jan 29, 2021
4283623
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
JohnTitor Jan 29, 2021
0c5fcce
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
JohnTitor Jan 29, 2021
788036d
Rollup merge of #81287 - CraftSpider:json-crate, r=jyn514,GuillaumeGomez
JohnTitor Jan 29, 2021
94e093a
Rollup merge of #81306 - SkiFire13:fuse-flatten, r=cuviper
JohnTitor Jan 29, 2021
046a414
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
JohnTitor Jan 29, 2021
2b4fa3d
Rollup merge of #81459 - probablykasper:text-selection-fix, r=Nemo157
JohnTitor Jan 29, 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
16 changes: 14 additions & 2 deletions library/core/src/iter/adapters/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,13 @@ where
}
}
match self.iter.next() {
None => return self.backiter.as_mut()?.next(),
None => match self.backiter.as_mut()?.next() {
None => {
self.backiter = None;
return None;
}
elt @ Some(_) => return elt,
},
Some(inner) => self.frontiter = Some(inner.into_iter()),
}
}
Expand Down Expand Up @@ -353,7 +359,13 @@ where
}
}
match self.iter.next_back() {
None => return self.frontiter.as_mut()?.next_back(),
None => match self.frontiter.as_mut()?.next_back() {
None => {
self.frontiter = None;
return None;
}
elt @ Some(_) => return elt,
},
next => self.backiter = next.map(IntoIterator::into_iter),
}
}
Expand Down
17 changes: 17 additions & 0 deletions library/core/tests/iter/adapters/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ fn test_flatten_non_fused_outer() {
assert_eq!(iter.next_back(), Some(1));
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);

let mut iter = NonFused::new(once(0..2)).flatten();

assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next_back(), Some(1));
assert_eq!(iter.next_back(), None);
assert_eq!(iter.next_back(), None);
}

#[test]
Expand All @@ -74,6 +82,15 @@ fn test_flatten_non_fused_inner() {
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);

let mut iter = once(0..1).chain(once(1..3)).flat_map(NonFused::new);

assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next_back(), Some(2));
assert_eq!(iter.next_back(), Some(1));
assert_eq!(iter.next_back(), None);
assert_eq!(iter.next_back(), None);
}

#[test]
Expand Down