Skip to content

Rollup of 9 pull requests #106730

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 22 commits into from
Jan 11, 2023
Merged
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0b5d6ae
Improve fluent error messages
Jan 5, 2023
9fd744b
add tests for div_duration_* functions
Xaeroxe Jan 7, 2023
eae615d
Remove unnecessary lseek syscall when using std::fs::read
chenyukang Jan 7, 2023
262ff86
Make translate_message return result and add tests
Jan 8, 2023
4c0c32c
Fix tests
Jan 8, 2023
36ee66c
Check impl's where clauses in consider_impl_candidate in experimental…
compiler-errors Jan 3, 2023
2855794
Use newtype for unused generic parameters
Noratrieb Dec 1, 2022
a4b859e
Delete unused polymorphization code
Noratrieb Dec 1, 2022
05c1ac0
Collect backtraces for delayed span-bugs too
compiler-errors Dec 31, 2022
f7bc68b
use with_capacity in read read_to_string
chenyukang Jan 10, 2023
aca2f88
Disable "split dwarf inlining" by default.
khuey Jan 11, 2023
d031bef
a
BoxyUwU Jan 11, 2023
cce2f5f
fix typo LocalItemId -> ItemLocalId
klensy Jan 11, 2023
0681a96
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Ni…
Noratrieb Jan 11, 2023
1693891
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
Noratrieb Jan 11, 2023
7347655
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
Noratrieb Jan 11, 2023
c962b07
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
Noratrieb Jan 11, 2023
6e0c404
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
Noratrieb Jan 11, 2023
9a820f7
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, …
Noratrieb Jan 11, 2023
082ff0f
Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_defau…
Noratrieb Jan 11, 2023
80c535f
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
Noratrieb Jan 11, 2023
9aeef61
Rollup merge of #106717 - klensy:typo, r=lcnr
Noratrieb Jan 11, 2023
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
10 changes: 6 additions & 4 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ pub struct DirBuilder {
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
fn inner(path: &Path) -> io::Result<Vec<u8>> {
let mut file = File::open(path)?;
let mut bytes = Vec::new();
file.read_to_end(&mut bytes)?;
let size = file.metadata().map(|m| m.len()).unwrap_or(0);
let mut bytes = Vec::with_capacity(size as usize);
io::default_read_to_end(&mut file, &mut bytes)?;
Ok(bytes)
}
inner(path.as_ref())
Expand Down Expand Up @@ -288,8 +289,9 @@ pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
fn inner(path: &Path) -> io::Result<String> {
let mut file = File::open(path)?;
let mut string = String::new();
file.read_to_string(&mut string)?;
let size = file.metadata().map(|m| m.len()).unwrap_or(0);
let mut string = String::with_capacity(size as usize);
io::default_read_to_string(&mut file, &mut string)?;
Ok(string)
}
inner(path.as_ref())
Expand Down