Skip to content
Closed
Changes from 6 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
4d56e88
Update mod.rs
kiseitai3 Jun 2, 2025
95ff1e4
docs: Small clarification on the usage of `read_to_string` and `read_…
kiseitai3 Jun 2, 2025
ffabd27
docs: Amended usage notes sections in read_to_end/read_to_string. Add…
Jun 4, 2025
28d3682
Merge remote-tracking branch 'origin/141714_stdin_read_to_string_docs…
Jun 4, 2025
f9499d9
Merge branch 'rust-lang:master' into 141714_stdin_read_to_string_docs
kiseitai3 Jun 4, 2025
ac993c4
Merge remote-tracking branch 'origin/141714_stdin_read_to_string_docs…
Jun 4, 2025
a0350b2
Add `iter` macro
oli-obk Feb 27, 2025
c3567c1
std: abort the process on failure to allocate a TLS key
joboet May 23, 2025
10a81ef
compiler: add CanonAbi
workingjubilee Mar 6, 2025
20e554b
compiler: add AbiMap
workingjubilee Mar 6, 2025
80767ea
compiler: use CanonAbi for entry_abi
workingjubilee May 21, 2025
d76aaea
compiler: change Conv to CanonAbi
workingjubilee May 21, 2025
608fe82
cg_llvm: convert to CanonAbi
workingjubilee May 21, 2025
bf29712
cg_clif: convert to CanonAbi
workingjubilee May 21, 2025
3b9480d
cg_gcc: convert to CanonAbi
workingjubilee May 21, 2025
0f617e3
miri: sed to CanonAbi
workingjubilee May 21, 2025
bc91070
bless test for CanonAbi::X86(SysV64) change
workingjubilee May 22, 2025
af990ac
compiler: simplify TargetOptions ABI functions
workingjubilee May 26, 2025
06f3050
compiler: actually remove Conv now that it is irrelevant
workingjubilee May 30, 2025
1830c9b
Use the informative error as the main const eval error message
oli-obk May 28, 2025
cfdc10b
Clarify why we are talking about a failed const eval at a random place
oli-obk May 30, 2025
b4be056
Remove bootstrap cfgs from library/
cuviper Jun 2, 2025
a73ec8a
Remove more library bootstrap
cuviper Jun 2, 2025
7563815
Remove pre-expansion AST stats.
nnethercote Jun 3, 2025
b4308fc
Remove `Path::is_ident`.
nnethercote Jun 3, 2025
0b3d6f5
Add missing `dyn` keywords to tests that do not test for them Part 2
Veykril Jun 3, 2025
3878b69
Rework collect_and_apply to not rely on size hint for optimization
compiler-errors Jun 3, 2025
1fd08c7
Improve the documentation of `Display` and `FromStr`, and their inter…
joshtriplett Feb 7, 2025
f70d304
Add some more description of interactions between `Display` and `From…
joshtriplett Feb 7, 2025
689a2a6
`FromStr`: Rework explanation of `FromStr`/`Display` round-tripping
joshtriplett Jun 3, 2025
58f3c5e
`Display`: Rework explanation of `FromStr`/`Display` round-tripping
joshtriplett Jun 3, 2025
be0705c
Remove `i128` and `u128` from `improper_ctypes_definitions`
tgross35 Feb 20, 2025
9b42771
build dist for x86_64-pc-solaris and sparcv9-sun-solaris
psumbera Mar 4, 2025
88f3ba1
add s390x z17 target features
folkertdev May 19, 2025
49f146c
make `OsString::new` and `PathBuf::new` unstably const
cyrgani May 24, 2025
e620131
index: add method for checking range on DenseBitSet
nia-e May 31, 2025
7cb7542
Use non-2015 edition paths in tests that do not test for their resolu…
Veykril Jun 2, 2025
c5f1c58
bootstrap: don't symlink source dir into stage0 sysroot
lambdageek Jun 4, 2025
fd20ff9
run `check::Std` as the final step
onur-ozkan Jun 4, 2025
c901623
make it possible to request stage 0 std with `Builder::ensure`
onur-ozkan Jun 4, 2025
6d8856e
remove outdated RUSTC_SYSROOT handling for ci-rustc
onur-ozkan Jun 4, 2025
f8e301c
Remove `MetaItemListParser::all_{word,path}_list`, which are unused.
nnethercote May 20, 2025
ecffede
Remove an unnecessary lifetime.
nnethercote May 20, 2025
f42ebfa
Remove `MetaItemParser::{word,word_without_args,path_is}`.
nnethercote May 20, 2025
e3c9bd3
Remove `MetaItemParser::{path,deconstruct}`.
nnethercote May 20, 2025
84c36c4
Rename `MetaItemParser::path_without_args` as `MetaItemParser::path`.
nnethercote May 20, 2025
3135980
Fix incorrect eq_unspanned in TokenStream
chenyukang May 26, 2025
a50cf4d
remove eq_unspanned from TokenStream
chenyukang May 26, 2025
fecd610
remove f16: From<u16>
usamoi Jun 2, 2025
8ac2576
Lightly tweak docs for BTree{Map,Set}::extract_if
rs-sac Jun 2, 2025
72b2ce4
add tests
Qelxiros Jun 3, 2025
d3586db
add tests for negative numbers
Qelxiros Jun 4, 2025
eea5295
Add missing 2015 edition directives
Veykril Jun 3, 2025
374b9c9
Improve some `Visitor` comments.
nnethercote Jun 4, 2025
1454a0d
x86 (32/64): go back to passing SIMD vectors by-ptr
RalfJung May 20, 2025
7e2e608
abi_check: tweak some comments
RalfJung Jun 1, 2025
de794e4
Add link to correct documentation in htmldocck.py
Derukugis Jun 2, 2025
ddab0d8
Fix for async drop inside async gen fn
azhogin Jun 2, 2025
d386874
Use non-2015 edition paths in tests that do not test for their resolu…
Veykril Jun 3, 2025
156fab5
Run wfcheck in one big loop instead of per module
oli-obk Jun 3, 2025
3453e36
Triagebot: Remove `assign.users_on_vacation`
fmease Jun 3, 2025
5f6b5d9
Add a test to reproduce ICE
compiler-errors Jun 3, 2025
bbbd641
Ensure query keys are printed with reduced queries
compiler-errors May 31, 2025
a0c447f
Visit the ident in `PreciseCapturingNonLifetimeArg`.
nnethercote Jun 4, 2025
7100d28
Change `tag_field` to `FieldIdx` in `Variants::Multiple`
scottmcm Jun 4, 2025
e6fa498
Fix incorrect use of "recommend" over "recommended"
Rageking8 Jun 4, 2025
2161b80
Don't refer to 'this tail expression' in expansion.
m-ou-se Jun 4, 2025
22c04b8
Don't refer to 'local binding' in extern macro.
m-ou-se Jun 4, 2025
1ea8699
Move placeholder handling to a proper preprocessing step
amandasystems Apr 29, 2025
99dd99b
Use an enum for SCC representatives, plus other code review
amandasystems May 2, 2025
b497e61
Add Location::file_with_nul
cramertj Jan 3, 2025
2de3006
UnsafePinned: also include the effects of UnsafeCell
RalfJung May 4, 2025
2dfe379
add Miri tests
RalfJung May 4, 2025
b86a201
Do not run PGO/BOLT in x64 Linux alt builds
Kobzol May 30, 2025
fe7aaab
Use 4-core large disk runner for the alt job
Kobzol May 30, 2025
f883bef
update gpu offload build command
ZuseZ4 Jun 3, 2025
2fdb150
use a relative path, so that this also works offline
tshepang Jun 2, 2025
1232f32
distracting indirection
tshepang Jun 2, 2025
a308272
Trivial: dedup word
smanilov Jun 2, 2025
8853bfa
Add title and toc to Async chapter
smanilov Jun 2, 2025
48ca697
Fix some warning blocks that contain Markdown
fmease Jun 2, 2025
5127d48
Simplify long sentence
smanilov Jun 2, 2025
b72bcdd
Preparing for merge from rustc
jieyouxu Jun 3, 2025
b92f05a
cleaned up some tests
Kivooeo Jun 3, 2025
c15f1d8
implement new `x` flag: `--skip-std-check-if-no-download-rustc`
onur-ozkan Jun 3, 2025
cf0dd5d
bless tidy
onur-ozkan Jun 3, 2025
44f8bee
add change-entry
onur-ozkan Jun 3, 2025
b9f8abf
document `skip-std-check-if-no-download-rustc` in rustc-dev-guide
onur-ozkan Jun 4, 2025
1b75e1a
update `skip_std_check_if_no_download_rustc` doc-comments
onur-ozkan Jun 4, 2025
fedc840
jsondoclint: Extract `Command`/`CommandKind` into its own file
aDotInTheVoid May 28, 2025
beb00d4
jsondocck: command -> directive
aDotInTheVoid May 28, 2025
50a8292
jsondocck: Explain what `KNOWN_DIRECTIVE_NAMES` is doing
aDotInTheVoid Jun 5, 2025
376507b
cleaned up some tests
Kivooeo Jun 3, 2025
73325df
rustdoc-json-type: Depend on `serde` and `serde_derive` seperately
aDotInTheVoid Jun 3, 2025
badc578
Report the actual item that evaluation failed for
oli-obk Jun 4, 2025
e62aa1b
bootstrap: Fix file permissions when dereferencing symlinks
smpdt Jun 4, 2025
23b7206
Fix parsing of frontmatters with inner hyphens
matthewjasper Jun 4, 2025
433dc71
Enable `__powitf2` on MSVC
beetrees May 21, 2025
0e9accc
fixed typo in readme
Lorl0rd May 10, 2025
7f11e8f
libm: Clean up unused files
tgross35 Apr 22, 2025
f8d321d
Update `CmpResult` to use a pointer-sized return type
tgross35 May 23, 2025
ef9b35c
Typo in README.md
D-Dario0 May 28, 2025
517f12f
aarch64: Add a note saying why we use `frintx` rather than `frintn`
tgross35 May 28, 2025
36c4228
cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`
tgross35 Apr 21, 2025
ca73c15
Reuse `libm`'s `Caat` and `CastFrom` in `compiler-builtins`
tgross35 May 29, 2025
57bdcfa
Remove unneeded C symbols
tgross35 May 28, 2025
2f92d6d
Replace the `nm` symbol check with a Rust implementation
tgross35 Apr 19, 2025
2d2369f
Remove the now-unneeded llvm-tools-preview
tgross35 May 28, 2025
3be8875
Change `compiler-builtins` to edition 2024
tgross35 May 29, 2025
8c85829
symcheck: Print the command to make reproducing errors easier
tgross35 May 29, 2025
eab2c69
Add benchmarks for float parsing and printing
tgross35 May 29, 2025
0384ba3
Run `builtins-test-intrinsics` when possible
tgross35 Mar 19, 2025
9c6c62b
ci: Allow concurrency outside of pull requests
tgross35 May 29, 2025
aaece93
Increase the benchmark rustc version to 2025-05-28
tgross35 May 29, 2025
7f19764
libm-test: Make `extensive` an attribute rather than a test type
tgross35 May 29, 2025
7a1abae
ci: Allow for multiple icount benchmarks in the same run
tgross35 May 29, 2025
d6bc12c
chore: release
github-actions[bot] May 29, 2025
bc08052
Fix new `dead_code` warnings from recent nightlies
tgross35 Jun 1, 2025
d1a4e71
Upgrade all dependencies to the latest available version
tgross35 Jun 1, 2025
ab70932
cleanup: Use `x.biteq(y)` rather than `x.to_bits() == y.to_bits()`
tgross35 Jun 2, 2025
eeb2f6c
ci: Refactor benchmark regression checks
tgross35 Jun 1, 2025
76d8b35
libm-test: Fix unintentional skips in `binop_common`
tgross35 Jun 2, 2025
fb54651
Replace the musl submodule with a download script
tgross35 Jun 4, 2025
d84e222
Add an empty rust-version file
tgross35 May 28, 2025
f3ef1b0
Add tooling for `josh` syncs
tgross35 May 18, 2025
4993831
Update the upstream Rust version
tgross35 Jun 4, 2025
fb80bfd
`panic-handler`: Remove the `no_core` feature
tgross35 Jun 4, 2025
3432db9
Rename `LifetimeSyntax` variants to lang-team-approved names
shepmaster May 9, 2025
8563905
Introduce the `mismatched_lifetime_syntaxes` lint
shepmaster Mar 28, 2025
8587e1a
Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`
shepmaster Mar 17, 2025
7298055
docs: Small clarification on the usage of `read_to_string` and `read_…
kiseitai3 Jun 2, 2025
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
33 changes: 33 additions & 0 deletions library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,17 @@ pub trait Read {
/// # }
/// ```
///
/// # Usage Notes
///
/// `read_to_end` attempts to read a source until EOF, but many sources are continuous streams
/// that do not send EOF. In these cases, `read_to_end` will block indefinitely. Standard input
/// is one such stream which may be finite if piped, but is typically continuous. For example,
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
/// the stream or insert an `EOF` termination character.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better to me. I think the cat example would be good to keep, but maybe translate the other example into words in case someone doesn't know what the -f flag does

    /// `read_to_end` attempts to read a source until EOF, but many sources are continuous streams
    /// that do not send EOF. In these cases, `read_to_end` will block indefinitely. Standard input
    /// is one such stream which may be finite if piped from a finite source (e.g. `cat foo.txt |
    /// my-program`), but is typically continuous (reading user input or sources that stay open).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am making adjustments, but did not have time to complete tonight.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem, there is no deadline :)

///
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
///
/// [`Vec::try_reserve`]: crate::vec::Vec::try_reserve
#[stable(feature = "rust1", since = "1.0.0")]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
Expand Down Expand Up @@ -960,6 +971,17 @@ pub trait Read {
/// (See also the [`std::fs::read_to_string`] convenience function for
/// reading from a file.)
///
/// # Usage Notes
///
/// `read_to_string` attempts to read a source until EOF, but many sources are continuous streams
/// that do not send EOF. In these cases, `read_to_string` will block indefinitely. Standard input
/// is one such stream which may be finite if piped, but is typically continuous. For example,
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
/// the stream or insert an `EOF` termination character.
///
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
///
/// [`std::fs::read_to_string`]: crate::fs::read_to_string
#[stable(feature = "rust1", since = "1.0.0")]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize> {
Expand Down Expand Up @@ -1262,6 +1284,17 @@ pub trait Read {
/// Ok(())
/// }
/// ```
///
/// # Usage Notes
///
/// `read_to_string` attempts to read a source until EOF, but many sources are continuous streams
/// that do not send EOF. In these cases, `read_to_string` will block indefinitely. Standard input
/// is one such stream which may be finite if piped, but is typically continuous. For example,
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
/// the stream or insert an `EOF` termination character.
///
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
#[stable(feature = "io_read_to_string", since = "1.65.0")]
pub fn read_to_string<R: Read>(mut reader: R) -> Result<String> {
let mut buf = String::new();
Expand Down
Loading