-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 4 pull requests #97050
Rollup of 4 pull requests #97050
Commits on Apr 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5765819 - Browse repository at this point
Copy the full SHA 5765819View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f10c0a - Browse repository at this point
Copy the full SHA 6f10c0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a03f15a - Browse repository at this point
Copy the full SHA a03f15aView commit details
Commits on May 13, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d369045 - Browse repository at this point
Copy the full SHA d369045View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b8041f - Browse repository at this point
Copy the full SHA 2b8041fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 15d8c00 - Browse repository at this point
Copy the full SHA 15d8c00View commit details
Commits on May 14, 2022
-
Allow the unused_macro_rules lint for now
This makes the transition easier as e.g. allow directives won't fire the unknown lint warning once it is turned to warn by default in the future. This is especially important compared to other lints in the unused group because the _ prefix trick doesn't exist for macro rules, so allowing is the only option (either of unused_macro_rules, or of the entire unused group, but that is not as informative to readers). Allowing the lint also makes it possible to work on possible heuristics for disabling the macro in specific cases.
Configuration menu - View commit details
-
Copy full SHA for 015e2ae - Browse repository at this point
Copy the full SHA 015e2aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53b6bf4 - Browse repository at this point
Copy the full SHA 53b6bf4View commit details -
Rollup merge of rust-lang#96455 - dtolnay:writetmp, r=m-ou-se
Make write/print macros eagerly drop temporaries This PR fixes the 2 regressions in rust-lang#96434 (`println` and `eprintln`) and changes all the other similar macros (`write`, `writeln`, `print`, `eprint`) to match the old pre-rust-lang#94868 behavior of `println` and `eprintln`. argument position | before rust-lang#94868 | after rust-lang#94868 | after this PR --- |:---:|:---:|:---: `write!($tmp, "…", …)` | :rage: | :rage: | :smiley_cat: `write!(…, "…", $tmp)` | :rage: | :rage: | :smiley_cat: `writeln!($tmp, "…", …)` | :rage: | :rage: | :smiley_cat: `writeln!(…, "…", $tmp)` | :rage: | :rage: | :smiley_cat: `print!("…", $tmp)` | :rage: | :rage: | :smiley_cat: `println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `eprint!("…", $tmp)` | :rage: | :rage: | :smiley_cat: `eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat: Example of code that is affected by this change: ```rust use std::sync::Mutex; fn main() { let mutex = Mutex::new(0); print!("{}", mutex.lock().unwrap()) /* no semicolon */ } ``` You can see several real-world examples like this in the Crater links at the top of rust-lang#96434. This code failed to compile prior to this PR as follows, but works after this PR. ```console error[E0597]: `mutex` does not live long enough --> src/main.rs:5:18 | 5 | print!("{}", mutex.lock().unwrap()) /* no semicolon */ | ^^^^^^^^^^^^--------- | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... 6 | } | - | | | `mutex` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard` ```
Configuration menu - View commit details
-
Copy full SHA for 0620b2e - Browse repository at this point
Copy the full SHA 0620b2eView commit details -
Rollup merge of rust-lang#97027 - cuviper:yesalias-refcell, r=thomcc
Use pointers in `cell::{Ref,RefMut}` to avoid `noalias` When `Ref` and `RefMut` were based on references, they would get LLVM `noalias` attributes that were incorrect, because that alias guarantee is only true until the guard drops. A `&RefCell` on the same value can get a new borrow that aliases the previous guard, possibly leading to miscompilation. Using `NonNull` pointers in `Ref` and `RefCell` avoids `noalias`. Fixes the library side of rust-lang#63787, but we still might want to explore language solutions there.
Configuration menu - View commit details
-
Copy full SHA for 1e0af98 - Browse repository at this point
Copy the full SHA 1e0af98View commit details -
Rollup merge of rust-lang#97032 - est31:unused_macro_rules, r=petroch…
…enkov Allow the unused_macro_rules lint for now It was newly added by rust-lang#96150 with warn by default, which is great as it gave exposure to the community, and their feedback gave me ideas for improvements. Allowing the lint is good for two reasons: * It makes the transition easier as e.g. allow directives won't fire the unknown lint warning once it is turned to warn by default in the future. The [commit that allowed the lint in fuchsia](https://fuchsia.googlesource.com/fuchsia/+/9d8f96517c3963de2f0e25598fd36061914524cd%5E%21/) had to allow unknown lints for example. This is especially important compared to other lints in the unused group, because the _ prefix trick doesn't exist for macro rules, allowing is the only option (either of unused_macro_rules, or of the entire unused group, but that is not as informative to readers). Allowing the lint also makes it possible to work on possible heuristics for disabling the macro in specific cases. * It gives time for implementing heuristics for when to suppress the lint, e.g. when `compile_error!` is invoked by that arm (so it's only there to yield an error). See: rust-lang#96150 (comment) I would also like this to be backported to the 1.62 beta branch (cc rust-lang#97016).
Configuration menu - View commit details
-
Copy full SHA for e1fc39c - Browse repository at this point
Copy the full SHA e1fc39cView commit details -
Rollup merge of rust-lang#97042 - GuillaumeGomez:eslint-brace-style, …
…r=notriddle Add new eslint rule about brace style It also prevents one liners. r? `@notriddle`
Configuration menu - View commit details
-
Copy full SHA for 439ddd4 - Browse repository at this point
Copy the full SHA 439ddd4View commit details