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 11 pull requests #88570

Closed
wants to merge 44 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
27393d5
fix incomplete UTF-8 writes in Windows console stdio
Count-Count Mar 21, 2021
a941e68
fix fmt
Count-Count Mar 21, 2021
60b149f
Export utf8_char_width() publicly in core::std behind the "str_intern…
Count-Count Mar 21, 2021
0202273
fix c&p error
Count-Count Mar 21, 2021
d114694
Reject byte if it cannot start a valid UTF-8 sequence.
Count-Count Mar 24, 2021
52713a4
fix
Count-Count Mar 24, 2021
fb1fa97
use io::Error::new_const() everywhere
Count-Count Mar 24, 2021
34cfe38
correct comment
Count-Count Mar 24, 2021
3103f5f
rename fn write_valid_utf8() to write_valid_utf8_to_console()
Count-Count Mar 24, 2021
7cfbe54
assert!() instead of panic!() for expected invariant
Count-Count Mar 24, 2021
dd3b79e
comment pos
Count-Count Mar 24, 2021
fbfde7e
Style only: merge with other pub use statement
Count-Count Apr 7, 2021
565a519
Update Windows arg parsing tests
ChrisDenton Jul 29, 2021
e26dda5
Implement modern Windows arg parsing
ChrisDenton Aug 5, 2021
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
522f975
Fix handling of +whole-archive native link modifier.
michaelwoerister Aug 30, 2021
846c372
Don't allow both the `+bundle` and `+whole-archive` modifiers for rlibs
wesleywiser Aug 20, 2021
07241e6
Add test case for no-bundle/whole-archive native libs linking.
michaelwoerister Aug 30, 2021
8553c19
Put back display of associated items (types and consts)
GuillaumeGomez Aug 30, 2021
eb91366
Put back "auto-collapse-implementors" setting
GuillaumeGomez Aug 30, 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
8d7d488
Lint Abi in ast validation.
cjgillot Jul 8, 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
d7159bd
Add tests for implementors associated types display
GuillaumeGomez Aug 30, 2021
fba4149
Clean render_impl arguments
GuillaumeGomez Aug 31, 2021
a5fd955
add regression test for issue 83190
lqd Sep 1, 2021
92dae39
Remove implementors setting
GuillaumeGomez Sep 1, 2021
83df28f
Rollup merge of #83342 - Count-Count:win-console-incomplete-utf8, r=m…
GuillaumeGomez Sep 1, 2021
7eb6f19
Rollup merge of #87114 - cjgillot:abilint, r=estebank
GuillaumeGomez Sep 1, 2021
023856c
Rollup merge of #87580 - ChrisDenton:win-arg-parse-2008, r=m-ou-se
GuillaumeGomez Sep 1, 2021
6ed7428
Rollup merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle…
GuillaumeGomez Sep 1, 2021
93646a9
Rollup merge of #88363 - michaelwoerister:remapped-diagnostics, r=est…
GuillaumeGomez Sep 1, 2021
d396e0d
Rollup merge of #88490 - GuillaumeGomez:associated-types-implementors…
GuillaumeGomez Sep 1, 2021
2de6476
Rollup merge of #88505 - ibraheemdev:use-unwrap-unchecked, r=kennytm
GuillaumeGomez Sep 1, 2021
5362856
Rollup merge of #88532 - ptrojahn:single_use, r=davidtwco
GuillaumeGomez Sep 1, 2021
825f334
Rollup merge of #88543 - m-ou-se:closure-migration-macro-block-fragme…
GuillaumeGomez Sep 1, 2021
5673291
Rollup merge of #88547 - notriddle:notriddle/is-expr-delims-necessary…
GuillaumeGomez Sep 1, 2021
18ca02a
Rollup merge of #88565 - lqd:issue-83190, r=spastorino
GuillaumeGomez Sep 1, 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
rename fn write_valid_utf8() to write_valid_utf8_to_console()
  • Loading branch information
Count-Count committed Mar 24, 2021
commit 3103f5f5501cf10c04023b74d738b245dd42cea2
8 changes: 4 additions & 4 deletions library/std/src/sys/windows/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ fn write(
match s {
Ok(s) => {
assert_eq!(char_width, s.len());
let written = write_valid_utf8(handle, s)?;
assert_eq!(written, s.len()); // guaranteed by write_valid_utf8() for single codepoint writes
let written = write_valid_utf8_to_console(handle, s)?;
assert_eq!(written, s.len()); // guaranteed by write_valid_utf8_to_console() for single codepoint writes
return Ok(1);
}
Err(_) => {
Expand Down Expand Up @@ -143,10 +143,10 @@ fn write(
Err(e) => str::from_utf8(&data[..e.valid_up_to()]).unwrap(),
};

write_valid_utf8(handle, utf8)
write_valid_utf8_to_console(handle, utf8)
}

fn write_valid_utf8(handle: c::HANDLE, utf8: &str) -> io::Result<usize> {
fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usize> {
let mut utf16 = [0u16; MAX_BUFFER_SIZE / 2];
let mut len_utf16 = 0;
for (chr, dest) in utf8.encode_utf16().zip(utf16.iter_mut()) {
Expand Down