8000 Rollup of 19 pull requests by m-ou-se · Pull Request #81013 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 19 pull requests #81013

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

Closed
wants to merge 68 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
64f11b9
Update tests of "unused_lifetimes" lint for async functions and corre…
Dec 4, 2020
3ea744e
Recommend panic::resume_unwind instead of panicking.
frewsxcv Dec 18, 2020
1f9a8a1
Add a `std::io::read_to_string` function
camelid Nov 5, 2020
4ee6d1b
Add description independent of `Read::read_to_string`
camelid Dec 30, 2020
588786a
Add error docs
camelid Dec 30, 2020
7ed824e
Add Iterator::intersperse_with
lukaslueg Dec 31, 2020
7a0ada0
Remove FIXME-notes
lukaslueg Jan 6, 2021
f7d261c
Get rid of `DepConstructor`
jyn514 Jan 8, 2021
ebe402d
Fix handling of malicious Readers in read_to_end
sfackler Jan 11, 2021
a9ef798
clean up control flow
sfackler Jan 11, 2021
5cb8303
make check a bit more clear
sfackler Jan 11, 2021
e6c07b0
clarify docs a bit
sfackler Jan 11, 2021
7463292
Add docs on performance
camelid Jan 12, 2021
16692ab
Suggest `_` and `..` if a pattern has too few fields
camelid Dec 13, 2020
5fe61a7
Simplify code
camelid Dec 19, 2020
f3d9df5
Suggest `Variant(..)` if all of the mentioned fields are `_`
camelid Dec 19, 2020
a5e8e6e
Pluralize 'parenthesis' correctly
camelid Dec 19, 2020
fe82cc3
Specialize `..` help message for all fields vs. the rest
camelid Dec 19, 2020
9959d6d
Only suggest `..` if more than one field is missing
camelid Dec 20, 2020
1bce775
Add a test case with lots of whitespace
camelid Jan 13, 2021
d7307a7
Always show suggestions in their own subwindows
camelid Jan 13, 2021
c3f7429
Use better ICE message when no MIR is available
camelid Jan 13, 2021
7e83fec
remove unstable deprecated Vec::remove_item
KodrAus Jan 13, 2021
6bfd987
Update books
ehuss Jan 13, 2021
e8c8793
Include `..` suggestion if fields are all wildcards
camelid Jan 13, 2021
d65cb6e
deprecate atomic::spin_loop_hint in favour of hint::spin_loop
KodrAus Jan 13, 2021
697b20f
Fixed incorrect doc comment
trevarj Jan 13, 2021
52adfdd
Use Option::map_or instead of `.map(..).unwrap_or(..)`
LingMan Jan 11, 2021
64c1b0d
Fix -Cpasses=list and llvm version print with -vV
bjorn3 Jan 13, 2021
5b1316f
unix ExitStatus: Do not treat WIFSTOPPED as WIFSIGNALED
ijackson Dec 12, 2020
12d62aa
unix ExitStatus: Clarify docs for .signal()
ijackson Dec 12, 2020
530270f
unix ExitStatus: Provide .into_raw()
ijackson Dec 12, 2020
3f05051
unix ExitStatus: Provide .core_dumped
ijackson Dec 12, 2020
f060b9e
unix ExitStatus: Provide .stopped_signal()
ijackson Dec 12, 2020
42ea8f6
unix ExitStatus: Provide .continued()
ijackson Dec 12, 2020
29c851a
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
06a405c
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
fa68567
unix ExitStatus: Add tracking issue to new methods
ijackson Jan 4, 2021
7012194
ExitStatusExt unix: Retrospectively seal this trait
ijackson Jan 4, 2021
f3e7199
ExitStatusExt windows: Retrospectively seal this trait
ijackson Jan 4, 2021
efddf59
Fix typo saeled -> sealed
dtolnay Jan 11, 2021
05a88aa
ExitStatusExt: Fix build on Fuchsia
ijackson Jan 13, 2021
b59fa3d
Fix stabilisation version of slice_strip
ijackson Jan 13, 2021
9528988
Add doc intralinks
lukaslueg Jan 13, 2021
0342fd1
Remove the unused context from CreateDebugLocation
cuviper Jan 13, 2021
391b4cc
Fix formatting specifiers doc link
calebsander Jan 13, 2021
9b2f085
Improve Iterator::intersperse_ docs
lukaslueg Jan 13, 2021
eb72dc5
Add as_ref and as_mut methods for Bound
glittershark Dec 28, 2020
a8d0161
Fix typos in Fuchsia unix_process_wait_more
dtolnay Jan 14, 2021
05f5db4
Rollup merge of #79689 - Vooblin:patch1, r=tmandry
m-ou-se Jan 14, 2021
aacb26d
Rollup merge of #79982 - ijackson:exit-status, r=dtolnay
m-ou-se Jan 14, 2021
b07415c
Rollup merge of #80017 - camelid:sugg-rest-pattern, r=estebank
m-ou-se Jan 14, 2021
473c292
Rollup merge of #80169 - frewsxcv:frewsxcv-docs-fix, r=jyn514
m-ou-se Jan 14, 2021
35833c2
Rollup merge of #80217 - camelid:io-read_to_string, r=m-ou-se
m-ou-se Jan 14, 2021
4ac831b
Rollup merge of #80444 - glittershark:bound-as-ref, r=dtolnay
m-ou-se Jan 14, 2021
7c4d34f
Rollup merge of #80567 - lukaslueg:intersperse_with, r=m-ou-se
m-ou-se Jan 14, 2021
4913b50
Rollup merge of #80829 - jyn514:dep-constructor, r=michaelwoerister
m-ou-se Jan 14, 2021
09276b0
Rollup merge of #80895 - sfackler:read-to-end-ub, r=m-ou-se
m-ou-se Jan 14, 2021
c0c379a
Rollup merge of #80944 - LingMan:map_or, r=nagisa
m-ou-se Jan 14, 2021
de47f47
Rollup merge of #80966 - KodrAus:deprecate/spin_loop_hint, r=m-ou-se
m-ou-se Jan 14, 2021
b480d2b
Rollup merge of #80969 - camelid:monomorph-ice-msg, r=nagisa
m-ou-se Jan 14, 2021
b18bbf5
Rollup merge of #80972 - KodrAus:deprecate/remove_item, r=nagisa
m-ou-se Jan 14, 2021
4e5eb81
Rollup merge of #80973 - ehuss:update-books, r=ehuss
m-ou-se Jan 14, 2021
e4f75cc
Rollup merge of #80980 - trevarj:patch-1, r=nagisa
m-ou-se Jan 14, 2021
459b274
Rollup merge of #80981 - bjorn3:bjorn3-patch-1, r=jonas-schievink
m-ou-se Jan 14, 2021
4dc3a44
Rollup merge of #80985 - ijackson:slice-strip-fix, r=jyn514
m-ou-se Jan 14, 2021
896757f
Rollup merge of #80990 - cuviper:unused-debug-context, r=nagisa
m-ou-se Jan 14, 2021
ce19d93
Rollup merge of #80991 - calebsander:fix/fmt-link, r=m-ou-se
m-ou-se Jan 14, 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
Fix handling of malicious Readers in read_to_end
  • Loading branch information
sfackler committed Jan 11, 2021
commit ebe402dc9e708a8ed5e5860a7b30ea7826ab52a1
9 changes: 8 additions & 1 deletion library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,14 @@ where
ret = Ok(g.len - start_len);
break;
}
Ok(n) => g.len += n,
Ok(n) => {
// We can't let g.len overflow which would result in the vec shrinking when the function returns. In
// particular, that could break read_to_string if the shortened buffer doesn't end on a UTF-8 boundary.
// The minimal check would just be a checked_add, but this assert is a bit more precise and should be
// just about the same cost.
assert!(n <= g.buf.len() - g.len);
g.len += n;
}
Err(ref e) if e.kind() == ErrorKind::Interrupted => {}
Err(e) => {
ret = Err(e);
Expand Down
0