-
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 10 pull requests #89089
Rollup of 10 pull requests #89089
Commits on Sep 11, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 1b3fe75 - Browse repository at this point
Copy the full SHA 1b3fe75View commit details
Commits on Sep 13, 2021
-
Suggest replacing an inexisting field for an unmentioned field
This PR adds a suggestion to replace an inexisting field for an unmentioned field. Given the following code: ```rust enum Foo { Bar { alpha: u8, bravo: u8, charlie: u8 }, } fn foo(foo: Foo) { match foo { Foo::Bar { alpha, beta, // `bravo` miswritten as `beta` here. charlie, } => todo!(), } } ``` the compiler now emits the error messages below. ```text error[E0026]: variant `Foo::Bar` does not have a field named `beta` --> src/lib.rs:9:13 | 9 | beta, // `bravo` miswritten as `beta` here. | ^^^^ | | | variant `Foo::Bar` does not have this field | help: `Foo::Bar` has a field named `bravo`: `bravo` ``` Note that this suggestion is available iff the number of inexisting fields and unmentioned fields are both 1.
Configuration menu - View commit details
-
Copy full SHA for 37196e3 - Browse repository at this point
Copy the full SHA 37196e3View commit details
Commits on Sep 15, 2021
-
Configuration menu - View commit details
-
Copy full SHA for ffdabc8 - Browse repository at this point
Copy the full SHA ffdabc8View commit details
Commits on Sep 16, 2021
-
Fix linting when trailing macro expands to a trailing semi
When a macro is used in the trailing expression position of a block (e.g. `fn foo() { my_macro!() }`), we currently parse it as an expression, rather than a statement. As a result, we ended up using the `NodeId` of the containing statement as our `lint_node_id`, even though we don't normally do this for macro calls. If such a macro expands to an expression with a `#[cfg]` attribute, then the trailing statement can get removed entirely. This lead to an ICE, since we were usng the `NodeId` of the expression to emit a lint. Ths commit makes us skip updating `lint_node_id` when handling a macro in trailing expression position. This will cause us to lint at the closest parent of the macro call.
Configuration menu - View commit details
-
Copy full SHA for bd4c967 - Browse repository at this point
Copy the full SHA bd4c967View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a4ca94 - Browse repository at this point
Copy the full SHA 4a4ca94View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b512cc - Browse repository at this point
Copy the full SHA 2b512ccView commit details -
Add a separate error for
dyn Trait
inconst fn
Previously "trait bounds other than `Sized` on const fn parameters are unstable" error was used for both trait bounds (<T: Trait>) and trait objects (dyn Trait). This was pretty confusing. This patch adds a separeta error for trait objects: "trait objects in const fn are unstable". The error for trait bounds is otherwise intact.
Configuration menu - View commit details
-
Copy full SHA for f84000d - Browse repository at this point
Copy the full SHA f84000dView commit details
Commits on Sep 17, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 57465d9 - Browse repository at this point
Copy the full SHA 57465d9View commit details -
modify std::os docs to be more consistent
> add intra doc links > add a usage example for the os::windows module
Configuration menu - View commit details
-
Copy full SHA for ec34aa6 - Browse repository at this point
Copy the full SHA ec34aa6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05b01cd - Browse repository at this point
Copy the full SHA 05b01cdView commit details
Commits on Sep 18, 2021
-
Suggest better place to add call parentheses for method expressions w…
…rapped in parentheses
Configuration menu - View commit details
-
Copy full SHA for 68147eb - Browse repository at this point
Copy the full SHA 68147ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f75ab3 - Browse repository at this point
Copy the full SHA 3f75ab3View commit details
Commits on Sep 19, 2021
-
Rollup merge of rust-lang#87960 - hkmatsumoto:suggest-inexisting-fiel…
…d-for-unmentioned-field, r=estebank Suggest replacing an inexisting field for an unmentioned field Fix rust-lang#87938 This PR adds a suggestion to replace an inexisting field for an unmentioned field. Given the following code: ```rust enum Foo { Bar { alpha: u8, bravo: u8, charlie: u8 }, } fn foo(foo: Foo) { match foo { Foo::Bar { alpha, beta, // `bravo` miswritten as `beta` here. charlie, } => todo!(), } } ``` the compiler now emits the error messages below. ```text error[E0026]: variant `Foo::Bar` does not have a field named `beta` --> src/lib.rs:9:13 | 9 | beta, // `bravo` miswritten as `beta` here. | ^^^^ | | | variant `Foo::Bar` does not have this field | help: `Foo::Bar` has a field named `bravo`: `bravo` ``` Note that this suggestion is available iff the number of inexisting fields and unmentioned fields are both 1.
Configuration menu - View commit details
-
Copy full SHA for ebd31f5 - Browse repository at this point
Copy the full SHA ebd31f5View commit details -
Rollup merge of rust-lang#88855 - calebzulawski:feature/simd_shuffle,…
… r=nagisa Allow simd_shuffle to accept vectors of any length cc ``@rust-lang/project-portable-simd`` ``@workingjubilee``
Configuration menu - View commit details
-
Copy full SHA for e675073 - Browse repository at this point
Copy the full SHA e675073View commit details -
Rollup merge of rust-lang#88966 - tmiasko:block-label-shadowing, r=pe…
…trochenkov Check for shadowing issues involving block labels
Configuration menu - View commit details
-
Copy full SHA for ba1a90a - Browse repository at this point
Copy the full SHA ba1a90aView commit details -
Rollup merge of rust-lang#88996 - Aaron1011:trailing-macro-semi, r=pe…
…trochenkov Fix linting when trailing macro expands to a trailing semi When a macro is used in the trailing expression position of a block (e.g. `fn foo() { my_macro!() }`), we currently parse it as an expression, rather than a statement. As a result, we ended up using the `NodeId` of the containing statement as our `lint_node_id`, even though we don't normally do this for macro calls. If such a macro expands to an expression with a `#[cfg]` attribute, then the trailing statement can get removed entirely. This lead to an ICE, since we were usng the `NodeId` of the expression to emit a lint. Ths commit makes us skip updating `lint_node_id` when handling a macro in trailing expression position. This will cause us to lint at the closest parent of the macro call.
Configuration menu - View commit details
-
Copy full SHA for 1c3fce0 - Browse repository at this point
Copy the full SHA 1c3fce0View commit details -
Rollup merge of rust-lang#89017 - the8472:fix-u64-time-monotonizer, r…
…=kennytm fix potential race in AtomicU64 time monotonizer The AtomicU64-based monotonizer introduced in rust-lang#83093 is incorrect because several threads could try to update the value concurrently and a thread which doesn't have the newest value among all the updates could win. That bug probably has little real world impact since it doesn't make observed time worse than hardware clocks. The worst case would probably be a thread which has a clock that is behind by several cycles observing several inconsistent fixups, which should be similar to observing the unfiltered backslide in the first place. New benchmarks, they don't look as good as the original PR but still an improvement compared to the mutex. I don't know why the contended mutex case is faster now than in the previous benchmarks. ``` actually_monotonic() == true: test time::tests::instant_contention_01_threads ... bench: 44 ns/iter (+/- 0) test time::tests::instant_contention_02_threads ... bench: 45 ns/iter (+/- 0) test time::tests::instant_contention_04_threads ... bench: 45 ns/iter (+/- 0) test time::tests::instant_contention_08_threads ... bench: 45 ns/iter (+/- 0) test time::tests::instant_contention_16_threads ... bench: 46 ns/iter (+/- 0) atomic u64: test time::tests::instant_contention_01_threads ... bench: 66 ns/iter (+/- 0) test time::tests::instant_contention_02_threads ... bench: 287 ns/iter (+/- 14) test time::tests::instant_contention_04_threads ... bench: 296 ns/iter (+/- 43) test time::tests::instant_contention_08_threads ... bench: 604 ns/iter (+/- 163) test time::tests::instant_contention_16_threads ... bench: 1,147 ns/iter (+/- 29) mutex: test time::tests::instant_contention_01_threads ... bench: 78 ns/iter (+/- 0) test time::tests::instant_contention_02_threads ... bench: 652 ns/iter (+/- 275) test time::tests::instant_contention_04_threads ... bench: 900 ns/iter (+/- 32) test time::tests::instant_contention_08_threads ... bench: 1,927 ns/iter (+/- 62) test time::tests::instant_contention_16_threads ... bench: 3,748 ns/iter (+/- 146) ```
Configuration menu - View commit details
-
Copy full SHA for 91c5e7c - Browse repository at this point
Copy the full SHA 91c5e7cView commit details -
Rollup merge of rust-lang#89021 - WaffleLapkin:separate_error_for_dyn…
…_trait_in_const_fn, r=estebank Add a separate error for `dyn Trait` in `const fn` Previously "trait bounds other than `Sized` on const fn parameters are unstable" error was used for both trait bounds (`<T: Trait>`) and trait objects (`dyn Trait`). This was pretty confusing. This PR adds a separate error for trait objects: "trait objects in const fn are unstable". The error for trait bounds is otherwise intact. This is follow up to rust-lang#88907 r? ``@estebank`` ``@rustbot`` label: +A-diagnostics
Configuration menu - View commit details
-
Copy full SHA for 61bfe36 - Browse repository at this point
Copy the full SHA 61bfe36View commit details -
Rollup merge of rust-lang#89051 - schctl:master, r=jyn514
Add intra-doc links and small changes to `std::os` to be more consistent I believe that a few items in `std::os` should be linked. I've also added a basic example in `std::os::windows`.
Configuration menu - View commit details
-
Copy full SHA for 4366059 - Browse repository at this point
Copy the full SHA 4366059View commit details -
Rollup merge of rust-lang#89053 - DeveloperC286:into_iter_fields_to_p…
…rivate, r=Mark-Simulacrum refactor: VecDeques IntoIter fields to private Made the fields of VecDeque's IntoIter private by creating a IntoIter::from(...) function to create a new instance of IntoIter and migrating usage to use IntoIter::from(...).
Configuration menu - View commit details
-
Copy full SHA for e4dbe27 - Browse repository at this point
Copy the full SHA e4dbe27View commit details -
Rollup merge of rust-lang#89055 - Kobzol:wrapped-method-expr-call-par…
…ens, r=wesleywiser Suggest better place to add call parentheses for method expressions wrapped in parentheses I wanted to improve the suggestion a bit to both remove the wrapping parentheses **and** add call parentheses by both calling `suggest_method_call` and using `multipart_suggestion`. But I very quickly ran into a problem where multiple overlapping machine applicable suggestions cannot be properly applied together. So I applied the suggestion from the issue and only added the call parentheses directly after the expression. Fixes: rust-lang#89044
Configuration menu - View commit details
-
Copy full SHA for 441046a - Browse repository at this point
Copy the full SHA 441046aView commit details -
Rollup merge of rust-lang#89081 - ondra05:patch-1, r=dtolnay
Fix a typo Removed extra spaces in front of commas
Configuration menu - View commit details
-
Copy full SHA for 4877ad3 - Browse repository at this point
Copy the full SHA 4877ad3View commit details