-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 6 pull requests #113188
Rollup of 6 pull requests #113188
Commits on Jun 1, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5cb701f - Browse repository at this point
Copy the full SHA 5cb701fView commit details
Commits on Jun 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 26cd548 - Browse repository at this point
Copy the full SHA 26cd548View commit details -
Configuration menu - View commit details
-
Copy full SHA for 724f3ff - Browse repository at this point
Copy the full SHA 724f3ffView commit details
Commits on Jun 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 0506250 - Browse repository at this point
Copy the full SHA 0506250View commit details -
Configuration menu - View commit details
-
Copy full SHA for 679c5be - Browse repository at this point
Copy the full SHA 679c5beView commit details
Commits on Jun 30, 2023
-
Use structured suggestion when telling user about
for<'a>
``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
Configuration menu - View commit details
-
Copy full SHA for 7d33094 - Browse repository at this point
Copy the full SHA 7d33094View commit details -
Configuration menu - View commit details
-
Copy full SHA for a104063 - Browse repository at this point
Copy the full SHA a104063View commit details -
Rollup merge of rust-lang#107624 - tgross35:const-cstr-methods, r=dto…
…lnay Stabilize `const_cstr_methods` This PR seeks to stabilize `const_cstr_methods`. Fixes most of rust-lang#101719 ## New const stable API ```rust impl CStr { // depends: memchr pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError> {...} // depends: const_slice_index pub const fn to_bytes(&self) -> &[u8] {} // depends: pointer casts pub const fn to_bytes_with_nul(&self) -> &[u8] {} // depends: str::from_utf8 pub const fn to_str(&self) -> Result<&str, str::Utf8Error> {} } ``` I don't think any of these methods will have any issue when `CStr` becomes a thin pointer as long as `memchr` is const (which also allows for const `strlen`) . ## Notes - `from_bytes_until_nul` relies on `const_slice_index`, which relies on `const_trait_impls`, and generally this should be avoided. After talking with Oli, it should be OK in this case because we could replace the ranges with pointer tricks if needed (worst case being those feature gates disappear). rust-lang#107624 (comment) - Making `from_ptr` const is deferred because it depends on `const_eval_select`. I have moved this under the new flag `const_cstr_from_ptr` rust-lang#107624 (comment) cc ``@oli-obk`` I think you're the const expert ``@rustbot`` modify labels: +T-libs-api +needs-fcp
Configuration menu - View commit details
-
Copy full SHA for 016c306 - Browse repository at this point
Copy the full SHA 016c306View commit details -
Rollup merge of rust-lang#111403 - y21:suggest-slice-swap, r=compiler…
…-errors suggest `slice::swap` for `mem::swap(&mut x[0], &mut x[1])` borrowck error Recently saw someone ask why this code (example slightly modified): ```rs fn main() { let mut foo = [1, 2]; std::mem::swap(&mut foo[0], &mut foo[1]); } ``` triggers this error and how to fix it: ``` error[E0499]: cannot borrow `foo[_]` as mutable more than once at a time --> src/main.rs:4:33 | 4 | std::mem::swap(&mut foo[0], &mut foo[1]); | -------------- ----------- ^^^^^^^^^^^ second mutable borrow occurs here | | | | | first mutable borrow occurs here | first borrow later used by call | = help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices ``` The current help message is nice and goes in the right direction, but I think we can do better for this specific instance and suggest `slice::swap`, which makes this compile
Configuration menu - View commit details
-
Copy full SHA for 6c22e04 - Browse repository at this point
Copy the full SHA 6c22e04View commit details -
Rollup merge of rust-lang#113071 - compiler-errors:no-parent-non-life…
…time-args-in-apit, r=eholk Account for late-bound vars from parent arg-position impl trait We should be reporting an error like we do for late-bound args coming from a parent APIT. Fixes rust-lang#113016
Configuration menu - View commit details
-
Copy full SHA for 0b96b25 - Browse repository at this point
Copy the full SHA 0b96b25View commit details -
Rollup merge of rust-lang#113165 - compiler-errors:rpitits-foreign-bo…
…unds, r=spastorino Encode item bounds for `DefKind::ImplTraitPlaceholder` This was lost in a refactoring -- `hir::ItemKind::OpaqueTy` doesn't always map to `DefKind::Opaque`, specifically for RPITITs, so the check was migrated subtly wrong, and unfortunately I never had a test for this 🙃 Fixes rust-lang#113155 r? ``@cjgillot``
Configuration menu - View commit details
-
Copy full SHA for c8f50ee - Browse repository at this point
Copy the full SHA c8f50eeView commit details -
Rollup merge of rust-lang#113171 - spastorino:new-rpitit-25, r=compil…
…er-errors Properly implement variances_of for RPITIT GAT This fixes some of the issues found by crater run in rust-lang#112988 (comment) r? ``@compiler-errors``
Configuration menu - View commit details
-
Copy full SHA for 38e6bba - Browse repository at this point
Copy the full SHA 38e6bbaView commit details -
Rollup merge of rust-lang#113177 - estebank:hrlt-sugg, r=compiler-errors
Use structured suggestion when telling user about `for<'a>` ``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
Configuration menu - View commit details
-
Copy full SHA for 207b244 - Browse repository at this point
Copy the full SHA 207b244View commit details