-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 7 pull requests #99439
Rollup of 7 pull requests #99439
Commits on Jul 13, 2022
-
docs: show how to stringify the output of Comamnd
This documentation-only change clarifies how the user can get the string representation of the output of a command. The `stdout` and `stderr` members of `std::process::Output` from `std::process::Command` return a Vec<u8>, which is not always what the user wants. For simple cases like printing `stderr` iff the `std::process::ExitStatus` is non-zero, it's useful to get the string representation of this `Vec<u8>`. This can be done via `String::from_utf8_lossy`, but it's not clear that this is possible from the documentation without first searching the internet for an answer. Link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8189f65dc4b354a643311af2cea5b230
Configuration menu - View commit details
-
Copy full SHA for 988a7e7 - Browse repository at this point
Copy the full SHA 988a7e7View commit details
Commits on Jul 17, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6d2bd54 - Browse repository at this point
Copy the full SHA 6d2bd54View commit details
Commits on Jul 18, 2022
-
This is needed for my Ubuntu 22.04 box due to a slight change in gdb output. The fix is similar to the fix in rust-lang#95063.
Configuration menu - View commit details
-
Copy full SHA for 13bf958 - Browse repository at this point
Copy the full SHA 13bf958View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1c1abc - Browse repository at this point
Copy the full SHA c1c1abcView commit details -
Use span_bug for unexpected field projection type
Improves the compiler error backtrace information, as shown in rust-lang#99363, by using `span_bug` instead of `bug`. New output: ``` build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021 error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection --> /tmp/test.rs:11:27 | 11 | let Foo((a, b)) = foo; | ^^^ thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9 stack backtrace: ``` (Remainder of output truncated.)
Jordan McQueen authored and Jordan McQueen committedJul 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 38f090b - Browse repository at this point
Copy the full SHA 38f090bView commit details -
Update invalid atomic ordering lint
The restriction that success ordering must be at least as strong as its failure ordering in compare-exchange operations was lifted in rust-lang#98383.
Configuration menu - View commit details
-
Copy full SHA for 45afc21 - Browse repository at this point
Copy the full SHA 45afc21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 454313f - Browse repository at this point
Copy the full SHA 454313fView commit details -
Rollup merge of rust-lang#99214 - beyarkay:patch-1, r=thomcc
docs: show how to stringify the output of Command This documentation-only change clarifies how the user can get the string representation of the output of a command. The `stdout` and `stderr` members of `std::process::Output` from `std::process::Command` return a Vec<u8>, which is not always what the user wants. For simple cases like printing `stderr` iff the `std::process::ExitStatus` is non-zero, it's useful to get the string representation of this `Vec<u8>`. This can be done via `String::from_utf8_lossy`, but it's not clear that this is possible from the documentation without first searching the internet for an answer. Link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8189f65dc4b354a643311af2cea5b230
Configuration menu - View commit details
-
Copy full SHA for 1abf43b - Browse repository at this point
Copy the full SHA 1abf43bView commit details -
Rollup merge of rust-lang#99335 - Dav1dde:fromstr-docs, r=JohnTitor
Use split_once in FromStr docs Current implementation: ```rust fn from_str(s: &str) -> Result<Self, Self::Err> { let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' ) .split(',') .collect(); let x_fromstr = coords[0].parse::<i32>()?; let y_fromstr = coords[1].parse::<i32>()?; Ok(Point { x: x_fromstr, y: y_fromstr }) } ``` Creating the vector is not necessary, `split_once` does the job better. Alternatively we could also remove `trim_matches` with `strip_prefix` and `strip_suffix`: ```rust let (x, y) = s .strip_prefix('(') .and_then(|s| s.strip_suffix(')')) .and_then(|s| s.split_once(',')) .unwrap(); ``` The question is how much 'correctness' is too much and distracts from the example. In a real implementation you would also not unwrap (or originally access the vector without bounds checks), but implementing a custom Error and adding a `From<ParseIntError>` and implementing the `Error` trait adds a lot of code to the example which is not relevant to the `FromStr` trait.
Configuration menu - View commit details
-
Copy full SHA for 517a9a7 - Browse repository at this point
Copy the full SHA 517a9a7View commit details -
Rollup merge of rust-lang#99384 - compiler-errors:issue-99375, r=oli-obk
use body's param-env when checking if type needs drop The type comes from the body, so we should be using the body's param-env, as opposed to the ADT's param env, because we know less in the latter compared to the former. Fixes rust-lang#99375
Configuration menu - View commit details
-
Copy full SHA for ab0b75d - Browse repository at this point
Copy the full SHA ab0b75dView commit details -
Rollup merge of rust-lang#99392 - nnethercote:fix-debuginfo-tests, r=…
…pnkfelix Fix debuginfo tests. This is needed for my Ubuntu 22.04 box due to a slight change in gdb output. The fix is similar to the fix in rust-lang#95063.
Configuration menu - View commit details
-
Copy full SHA for 1b0dda4 - Browse repository at this point
Copy the full SHA 1b0dda4View commit details -
Rollup merge of rust-lang#99404 - jmqd:master, r=compiler-errors
Use span_bug for unexpected field projection type Improves the compiler error backtrace information, as shown in rust-lang#99363, by using `span_bug` instead of `bug`. New output: ``` build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021 error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection --> /tmp/test.rs:11:27 | 11 | let Foo((a, b)) = foo; | ^^^ thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9 stack backtrace: ``` (Remainder of output truncated.)
Configuration menu - View commit details
-
Copy full SHA for c3a38b8 - Browse repository at this point
Copy the full SHA c3a38b8View commit details -
Rollup merge of rust-lang#99410 - tmiasko:atomic-lint, r=fee1-dead
Update invalid atomic ordering lint The restriction that success ordering must be at least as strong as its failure ordering in compare-exchange operations was lifted in rust-lang#98383.
Configuration menu - View commit details
-
Copy full SHA for 8fc0b8d - Browse repository at this point
Copy the full SHA 8fc0b8dView commit details -
Rollup merge of rust-lang#99419 - yoshuawuyts:stabilize-task-ready, r…
…=Mark-Simulacrum Stabilize `core::task::ready!` This stabilizes `core::task::ready!` for Rust 1.64. The FCP for stabilization was just completed here rust-lang#70922 (comment). Thanks! Closes rust-lang#70922 cc/ `@rust-lang/libs-api`
Configuration menu - View commit details
-
Copy full SHA for f3816dd - Browse repository at this point
Copy the full SHA f3816ddView commit details