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 9 pull requests #88584

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
af1b65c
Path remapping: Make behavior of diagnostics output dependent on pres…
michaelwoerister Aug 26, 2021
8436fe1
Add test for showing remapped path in diagnostics
cbeuw Aug 20, 2021
c296c89
Fix remap-path-prefix UI test case.
michaelwoerister Aug 27, 2021
c6d800d
Point at unclosed delimiters as part of the primary MultiSpan
estebank Aug 27, 2021
d7da82a
expand: Treat more macro calls as statement macro calls
petrochenkov Aug 26, 2021
b99038f
use `unwrap_unchecked` where possible
ibraheemdev Aug 30, 2021
99a3d64
Remove single use variables
ptrojahn Aug 31, 2021
ffc43b8
add safety annotation to `LinkedList::detach_all_nodes`
ibraheemdev Aug 31, 2021
7189c85
Improve closure dummy capture suggestion in macros.
m-ou-se Aug 31, 2021
7d18052
Add test for closure migration where body is a block fragment.
m-ou-se Aug 31, 2021
59b245e
fix(rustc_lint): better detect when parens are necessary
notriddle Aug 31, 2021
6c9e708
`fmt::Formatter::pad`: don't call chars().count() more than one time
klensy Sep 1, 2021
f5f489b
fix clippy lints
klensy Sep 1, 2021
a5fd955
add regression test for issue 83190
lqd Sep 1, 2021
d9047db
Rollup merge of #88363 - michaelwoerister:remapped-diagnostics, r=est…
GuillaumeGomez Sep 2, 2021
2693e12
Rollup merge of #88386 - estebank:unmatched-delims, r=jackh726
GuillaumeGomez Sep 2, 2021
2f22cad
Rollup merge of #88428 - petrochenkov:stmtid, r=Aaron1011
GuillaumeGomez Sep 2, 2021
c892775
Rollup merge of #88505 - ibraheemdev:use-unwrap-unchecked, r=kennytm
GuillaumeGomez Sep 2, 2021
1d1e931
Rollup merge of #88532 - ptrojahn:single_use, r=davidtwco
GuillaumeGomez Sep 2, 2021
b341e56
Rollup merge of #88543 - m-ou-se:closure-migration-macro-block-fragme…
GuillaumeGomez Sep 2, 2021
60eb925
Rollup merge of #88547 - notriddle:notriddle/is-expr-delims-necessary…
GuillaumeGomez Sep 2, 2021
a90fff6
Rollup merge of #88560 - klensy:formatter-pad-shrink, r=m-ou-se
GuillaumeGomez Sep 2, 2021
7e3855b
Rollup merge of #88565 - lqd:issue-83190, r=spastorino
GuillaumeGomez Sep 2, 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
Prev Previous commit
Next Next commit
add safety annotation to LinkedList::detach_all_nodes
Co-authored-by: kennytm <[email protected]>
  • Loading branch information
ibraheemdev and kennytm authored Aug 31, 2021
commit ffc43b84682b9378a03b4cf5b166b2049625f7a4
3 changes: 3 additions & 0 deletions library/alloc/src/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ impl<T> LinkedList<T> {
let tail = self.tail.take();
let len = mem::replace(&mut self.len, 0);
if let Some(head) = head {
// SAFETY: In a LinkedList, either both the head and tail are None because
// the list is empty, or both head and tail are Some because the list is populated.
// Since we have verified the head is Some, we are sure the tail is Some too.
let tail = unsafe { tail.unwrap_unchecked() };
Some((head, tail, len))
} else {
Expand Down