-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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 9 pull requests #101033
Rollup of 9 pull requests #101033
Commits on Jul 13, 2022
-
Add a
File::create_new
constructorWe have `File::create` for creating a file or opening an existing file, but the secure way to guarantee creating a new file requires a longhand invocation via `OpenOptions`. Add `File::create_new` to handle this case, to make it easier for people to do secure file creation.
Configuration menu - View commit details
-
Copy full SHA for e540425 - Browse repository at this point
Copy the full SHA e540425View commit details
Commits on Jul 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for fab36d1 - Browse repository at this point
Copy the full SHA fab36d1View commit details
Commits on Aug 14, 2022
-
Start uplifting
clippy::for_loops_over_fallibles
I refactored the code: - Removed handling of methods, as it felt entirely unnecessary - Removed clippy utils (obviously...) - Used some shiny compiler features (let-else is very handy for lints 👀) - I also renamed the lint to `for_loop_over_fallibles` (note: no `s`). I'm not sure what's the naming convention here, so maybe I'm wrong.
Configuration menu - View commit details
-
Copy full SHA for 7b4cd17 - Browse repository at this point
Copy the full SHA 7b4cd17View commit details -
Configuration menu - View commit details
-
Copy full SHA for 810cf60 - Browse repository at this point
Copy the full SHA 810cf60View commit details -
Configuration menu - View commit details
-
Copy full SHA for b661157 - Browse repository at this point
Copy the full SHA b661157View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cf94ad - Browse repository at this point
Copy the full SHA 7cf94adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 14b8f24 - Browse repository at this point
Copy the full SHA 14b8f24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bf213b - Browse repository at this point
Copy the full SHA 2bf213bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5128140 - Browse repository at this point
Copy the full SHA 5128140View commit details -
for_loop_over_fallibles
: fix suggestion for "remove.next()
" caseif the iterator is used after the loop, we need to use `.by_ref()`
Configuration menu - View commit details
-
Copy full SHA for 34815a9 - Browse repository at this point
Copy the full SHA 34815a9View commit details -
for_loop_over_fallibles
: don't useMachineApplicable
The loop could contain `break;` that won't work with an `if let`
Configuration menu - View commit details
-
Copy full SHA for c4ab59e - Browse repository at this point
Copy the full SHA c4ab59eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41fccb1 - Browse repository at this point
Copy the full SHA 41fccb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86360f4 - Browse repository at this point
Copy the full SHA 86360f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7b8a65 - Browse repository at this point
Copy the full SHA d7b8a65View commit details
Commits on Aug 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for aed1ae4 - Browse repository at this point
Copy the full SHA aed1ae4View commit details
Commits on Aug 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 71b8c89 - Browse repository at this point
Copy the full SHA 71b8c89View commit details
Commits on Aug 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bafb10d - Browse repository at this point
Copy the full SHA bafb10dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d34df43 - Browse repository at this point
Copy the full SHA d34df43View commit details -
Configuration menu - View commit details
-
Copy full SHA for c542245 - Browse repository at this point
Copy the full SHA c542245View commit details -
make read_immediate error immediately on uninit, so ImmTy can carry i…
…nitialized Scalar
Configuration menu - View commit details
-
Copy full SHA for 8654522 - Browse repository at this point
Copy the full SHA 8654522View commit details -
Configuration menu - View commit details
-
Copy full SHA for c11fa89 - Browse repository at this point
Copy the full SHA c11fa89View commit details
Commits on Aug 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 73ae38b - Browse repository at this point
Copy the full SHA 73ae38bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0043d10 - Browse repository at this point
Copy the full SHA 0043d10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1382d30 - Browse repository at this point
Copy the full SHA 1382d30View commit details -
Configuration menu - View commit details
-
Copy full SHA for d75fd91 - Browse repository at this point
Copy the full SHA d75fd91View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5164966 - Browse repository at this point
Copy the full SHA 5164966View commit details -
Configuration menu - View commit details
-
Copy full SHA for e701c72 - Browse repository at this point
Copy the full SHA e701c72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9472df1 - Browse repository at this point
Copy the full SHA 9472df1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fef1b8 - Browse repository at this point
Copy the full SHA 5fef1b8View commit details
Commits on Aug 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for cb4cd73 - Browse repository at this point
Copy the full SHA cb4cd73View commit details
Commits on Aug 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 36c42fa - Browse repository at this point
Copy the full SHA 36c42faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 63700a8 - Browse repository at this point
Copy the full SHA 63700a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89c74e8 - Browse repository at this point
Copy the full SHA 89c74e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d61ecec - Browse repository at this point
Copy the full SHA d61ececView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e97626 - Browse repository at this point
Copy the full SHA 4e97626View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ff5872 - Browse repository at this point
Copy the full SHA 4ff5872View commit details -
Configuration menu - View commit details
-
Copy full SHA for d464d3a - Browse repository at this point
Copy the full SHA d464d3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8189a45 - Browse repository at this point
Copy the full SHA 8189a45View commit details
Commits on Aug 25, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 252c65e - Browse repository at this point
Copy the full SHA 252c65eView commit details -
rustdoc: remove unused CSS for
.variants_table
Continuation of rust-lang#100938 and rust-lang#101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.
Configuration menu - View commit details
-
Copy full SHA for 8c65478 - Browse repository at this point
Copy the full SHA 8c65478View commit details
Commits on Aug 26, 2022
-
Rollup merge of rust-lang#98801 - joshtriplett:file-create-new, r=thomcc
Add a `File::create_new` constructor We have `File::create` for creating a file or opening an existing file, but the secure way to guarantee creating a new file requires a longhand invocation via `OpenOptions`. Add `File::create_new` to handle this case, to make it easier for people to do secure file creation.
Configuration menu - View commit details
-
Copy full SHA for ce41d2f - Browse repository at this point
Copy the full SHA ce41d2fView commit details -
Rollup merge of rust-lang#99696 - WaffleLapkin:uplift, r=fee1-dead
Uplift `clippy::for_loops_over_fallibles` lint into rustc This PR, as the title suggests, uplifts [`clippy::for_loops_over_fallibles`] lint into rustc. This lint warns for code like this: ```rust for _ in Some(1) {} for _ in Ok::<_, ()>(1) {} ``` i.e. directly iterating over `Option` and `Result` using `for` loop. There are a number of suggestions that this PR adds (on top of what clippy suggested): 1. If the argument (? is there a better name for that expression) of a `for` loop is a `.next()` call, then we can suggest removing it (or rather replacing with `.by_ref()` to allow iterator being used later) ```rust for _ in iter.next() {} // turns into for _ in iter.by_ref() {} ``` 2. (otherwise) We can suggest using `while let`, this is useful for non-iterator, iterator-like things like [async] channels ```rust for _ in rx.recv() {} // turns into while let Some(_) = rx.recv() {} ``` 3. If the argument type is `Result<impl IntoIterator, _>` and the body has a `Result<_, _>` type, we can suggest using `?` ```rust for _ in f() {} // turns into for _ in f()? {} ``` 4. To preserve the original behavior and clear intent, we can suggest using `if let` ```rust for _ in f() {} // turns into if let Some(_) = f() {} ``` (P.S. `Some` and `Ok` are interchangeable depending on the type) I still feel that the lint wording/look is somewhat off, so I'll be happy to hear suggestions (on how to improve suggestions :D)! Resolves rust-lang#99272 [`clippy::for_loops_over_fallibles`]: https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles
Configuration menu - View commit details
-
Copy full SHA for 7e789d7 - Browse repository at this point
Copy the full SHA 7e789d7View commit details -
Rollup merge of rust-lang#99742 - sigaloid:master, r=thomcc
Add comments about stdout locking This is the source of some confusion regarding the `println!` macro: * https://llogiq.github.io/2017/06/01/perf-pitfalls.html#unbuffered-io * https://news.ycombinator.com/item?id=18794930 * https://reddit.com/r/rust/comments/5puyx2/why_is_println_so_slow/dcua5g5/ * https://reddit.com/r/rust/comments/ab7hsi/comparing_pythagorean_triples_in_c_d_and_rust/ecy7ql8/ In some of these cases it's not the locking behavior where the bottleneck lies, but it's still mentioned as a surprise when, eg, benchmarking a million `println!`'s in a very tight loop. If there's any stylistic problems please feel free to correct me! This is my first contribution and I want to get it right 🦀
Configuration menu - View commit details
-
Copy full SHA for de7e652 - Browse repository at this point
Copy the full SHA de7e652View commit details -
Rollup merge of rust-lang#100043 - RalfJung:scalar-always-init, r=oli…
…-obk interpret: remove support for uninitialized scalars With Miri no longer supporting `-Zmiri-allow-uninit-numbers`, we no longer need to support storing uninit data in a `Scalar`. We anyway already only use this representation for types with *initialized* `Scalar` layout (and we have to, due to partial initialization), so let's get rid of the `ScalarMaybeUninit` type entirely. I tried to stage this into meaningful commits, but the one that changes `read_immediate` to always trigger UB on uninit is the largest chunk of the PR and I don't see how it could be subdivided. Fixes rust-lang/miri#2187 r? ````@oli-obk````
Configuration menu - View commit details
-
Copy full SHA for 691a03c - Browse repository at this point
Copy the full SHA 691a03cView commit details -
Rollup merge of rust-lang#100437 - compiler-errors:better-const-misma…
…tch-err, r=oli-obk Improve const mismatch `FulfillmentError` Fixes rust-lang#100414
Configuration menu - View commit details
-
Copy full SHA for d35938d - Browse repository at this point
Copy the full SHA d35938dView commit details -
Rollup merge of rust-lang#100640 - reitermarkus:socket-display-buffer…
…, r=thomcc Use `DisplayBuffer` for socket addresses. Continuation of rust-lang#100625 for socket addresses. Renames `net::addr` to `net::addr::socket`, `net::ip` to `net::addr::ip` and `net::ip::display_buffer::IpDisplayBuffer` to `net::addr::display_buffer::DisplayBuffer`.
Configuration menu - View commit details
-
Copy full SHA for c1e945e - Browse repository at this point
Copy the full SHA c1e945eView commit details -
Rollup merge of rust-lang#100724 - JeanCASPAR:migrate-ast_lowering-to…
…-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
Configuration menu - View commit details
-
Copy full SHA for 8a56eb6 - Browse repository at this point
Copy the full SHA 8a56eb6View commit details -
Rollup merge of rust-lang#100897 - RalfJung:const-not-to-mutable, r=lcnr
extra sanity check against consts pointing to mutable memory This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.
Configuration menu - View commit details
-
Copy full SHA for 8424610 - Browse repository at this point
Copy the full SHA 8424610View commit details -
Rollup merge of rust-lang#101012 - notriddle:notriddle/variants_table…
…, r=jsha rustdoc: remove unused CSS for `.variants_table` Continuation of rust-lang#100938 and rust-lang#101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.
Configuration menu - View commit details
-
Copy full SHA for 3c45cca - Browse repository at this point
Copy the full SHA 3c45ccaView commit details