-
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 9 pull requests #128253
Rollup of 9 pull requests #128253
Commits on Jul 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c90b6b8 - Browse repository at this point
Copy the full SHA c90b6b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb799cf - Browse repository at this point
Copy the full SHA eb799cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for f99df29 - Browse repository at this point
Copy the full SHA f99df29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 404519a - Browse repository at this point
Copy the full SHA 404519aView commit details
Commits on Jul 25, 2024
-
rustdoc: change title of search results
the current title is too similar to that of the page for std::result::Result, which is a problem both for navigating to the Result docs via browser autocomplete, and for being able to tell which tab is which when the width of tabs is small.
binarycat committedJul 25, 2024 Configuration menu - View commit details
-
Copy full SHA for 370fcce - Browse repository at this point
Copy the full SHA 370fcceView commit details -
binarycat committed
Jul 25, 2024 Configuration menu - View commit details
-
Copy full SHA for 587b64e - Browse repository at this point
Copy the full SHA 587b64eView commit details -
Invert early exit conditions in
collect_tokens_trailing_token
.This has been bugging me for a while. I find complex "if any of these are true" conditions easier to think about than complex "if all of these are true" conditions, because you can stop as soon as one is true.
Configuration menu - View commit details
-
Copy full SHA for caee195 - Browse repository at this point
Copy the full SHA caee195View commit details -
Inline and remove
AttrWrapper::is_complete
.It has a single call site. This change makes the two `needs_collect` conditions more similar to each other, and therefore easier to understand.
Configuration menu - View commit details
-
Copy full SHA for 4288edb - Browse repository at this point
Copy the full SHA 4288edbView commit details -
Move
is_complete
to the module that uses it.And make it non-`pub`.
Configuration menu - View commit details
-
Copy full SHA for 3d363c3 - Browse repository at this point
Copy the full SHA 3d363c3View commit details -
Invert the sense of
is_complete
and rename it asneeds_tokens
.I have always found `is_complete` an unhelpful name. The new name (and inverted sense) fits in better with the conditions at its call sites.
Configuration menu - View commit details
-
Copy full SHA for e631b1e - Browse repository at this point
Copy the full SHA e631b1eView commit details
Commits on Jul 26, 2024
-
Don't include inner attribute ranges in
CaptureState
.The current code is this: ``` self.capture_state.replace_ranges.push((start_pos..end_pos, Some(target))); self.capture_state.replace_ranges.extend(inner_attr_replace_ranges); ``` What's not obvious is that every range in `inner_attr_replace_ranges` must be a strict sub-range of `start_pos..end_pos`. Which means, in `LazyAttrTokenStreamImpl::to_attr_token_stream`, they will be done first, and then the `start_pos..end_pos` replacement will just overwrite them. So they aren't needed.
Configuration menu - View commit details
-
Copy full SHA for a560810 - Browse repository at this point
Copy the full SHA a560810View commit details -
Imagine you have replace ranges (2..20,X) and (5..15,Y), and these tokens: ``` a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x ``` If we replace (5..15,Y) first, then (2..20,X) we get this sequence ``` a,b,c,d,e,Y,_,_,_,_,_,_,_,_,_,p,q,r,s,t,u,v,w,x a,b,X,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,u,v,w,x ``` which is what we want. If we do it in the other order, we get this: ``` a,b,X,_,_,_,_,_,_,_,_,_,_,_,_,p,q,r,s,t,u,v,w,x a,b,X,_,_,Y,_,_,_,_,_,_,_,_,_,_,_,_,_,_,u,v,w,x ``` which is wrong. So it's true that we need the `.rev()` but the comment is wrong about why.
Configuration menu - View commit details
-
Copy full SHA for 6e87858 - Browse repository at this point
Copy the full SHA 6e87858View commit details -
A fully imperative style is easier to read than a half-iterator, half-imperative style. Also, rename `inner_attr` as `attr` because it might be an outer attribute.
Configuration menu - View commit details
-
Copy full SHA for 6ea2da5 - Browse repository at this point
Copy the full SHA 6ea2da5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 55d37ae - Browse repository at this point
Copy the full SHA 55d37aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33b98bf - Browse repository at this point
Copy the full SHA 33b98bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 114e0dc - Browse repository at this point
Copy the full SHA 114e0dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33dd288 - Browse repository at this point
Copy the full SHA 33dd288View commit details -
Improve error message for
extern "C" unsafe fn()
This was handled correctly already for `extern unsafe fn()`. Co-authored-by: Folkert <folkert@folkertdev.nl>
Configuration menu - View commit details
-
Copy full SHA for 3fdc991 - Browse repository at this point
Copy the full SHA 3fdc991View commit details -
Configuration menu - View commit details
-
Copy full SHA for 130ce49 - Browse repository at this point
Copy the full SHA 130ce49View commit details -
Configuration menu - View commit details
-
Copy full SHA for d565605 - Browse repository at this point
Copy the full SHA d565605View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a9959f - Browse repository at this point
Copy the full SHA 5a9959fView commit details -
Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-s…
…tr, r=dtolnay Stabilize const `{integer}::from_str_radix` i.e. `const_int_from_str` This PR stabilizes the feature `const_int_from_str`. - ACP Issue: rust-lang/libs-team#74 - Implementation PR: rust-lang#99322 - Part of Tracking Issue: rust-lang#59133 API Change Diff: ```diff impl {integer} { - pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; + pub const fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; } impl ParseIntError { - pub fn kind(&self) -> &IntErrorKind; + pub const fn kind(&self) -> &IntErrorKind; } ``` This makes it easier to parse integers at compile-time, e.g. the example from the Tracking Issue: ```rust env!("SOMETHING").parse::<usize>().unwrap() ``` could now be achived with ```rust match usize::from_str_radix(env!("SOMETHING"), 10) { Ok(val) => val, Err(err) => panic!("Invalid value for SOMETHING environment variable."), } ``` rather than having to depend on a library that implements or manually implement the parsing at compile-time. --- Checklist based on [Libs Stabilization Guide - When there's const involved](https://std-dev-guide.rust-lang.org/development/stabilization.html#when-theres-const-involved) I am treating this as a [partial stabilization](https://std-dev-guide.rust-lang.org/development/stabilization.html#partial-stabilizations) as it shares a tracking issue (and is rather small), so directly opening the partial stabilization PR for the subset (feature `const_int_from_str`) being stabilized. - [x] ping Constant Evaluation WG - [x] no unsafe involved - [x] no `#[allow_internal_unstable]` - [ ] usage of `intrinsic::const_eval_select` rust-lang#124625 in `from_str_radix_assert` to change the error message between compile-time and run-time - [ ] [rust-labg/libs-api FCP](rust-lang#124941 (comment))
Configuration menu - View commit details
-
Copy full SHA for 86721a4 - Browse repository at this point
Copy the full SHA 86721a4View commit details -
Rollup merge of rust-lang#128201 - compiler-errors:closure-clone, r=o…
…li-obk Implement `Copy`/`Clone` for async closures We can do so in the same cases that regular closures do. For the purposes of cloning, coroutine-closures are actually precisely the same as regular closures, specifically in the aspect that `Clone` impls care about which is the upvars. The only difference b/w coroutine-closures and regular closures is the type that they *return*, but this type has not been *created* yet, so we don't really have a problem. IDK why I didn't add this impl initially -- I went back and forth a bit on the internal representation for coroutine-closures before settling on a design which largely models regular closures. Previous (not published) iterations of coroutine-closures used to be represented as a special (read: cursed) kind of coroutine, which would probably suffer from the pitfalls that coroutines have that oli mentioned below in rust-lang#128201 (comment). r? oli-obk
Configuration menu - View commit details
-
Copy full SHA for bd18f88 - Browse repository at this point
Copy the full SHA bd18f88View commit details -
Rollup merge of rust-lang#128210 - lolbinarycat:rustdoc-search-title,…
… r=notriddle,GuillaumeGomez rustdoc: change title of search results the current title is too similar to that of the page for std::result::Result, which is a problem both for navigating to the Result docs via browser autocomplete, and for being able to tell which tab is which when the width of tabs is small.
Configuration menu - View commit details
-
Copy full SHA for 7195b80 - Browse repository at this point
Copy the full SHA 7195b80View commit details -
Rollup merge of rust-lang#128223 - nnethercote:refactor-collect_token…
…s, r=petrochenkov Refactor complex conditions in `collect_tokens_trailing_token` More readability improvements for this complicated function. r? ````@petrochenkov````
Configuration menu - View commit details
-
Copy full SHA for 553a64f - Browse repository at this point
Copy the full SHA 553a64fView commit details -
Rollup merge of rust-lang#128224 - nnethercote:fewer-replace_ranges, …
…r=petrochenkov Remove unnecessary range replacements This PR removes an unnecessary range replacement in `collect_tokens_trailing_token`, and does a couple of other small cleanups. r? ````@petrochenkov````
Configuration menu - View commit details
-
Copy full SHA for af52be2 - Browse repository at this point
Copy the full SHA af52be2View commit details -
Rollup merge of rust-lang#128226 - oli-obk:option_vs_empty_slice, r=p…
…etrochenkov Remove redundant option that was just encoding that a slice was empty There is already a sanity check ensuring we don't put empty attribute lists into the HIR: https://github.com/rust-lang/rust/blob/6ef11b81c2c02c3c4b7556d1991a98572fe9af87/compiler/rustc_ast_lowering/src/lib.rs#L661-L667
Configuration menu - View commit details
-
Copy full SHA for f1cf2f5 - Browse repository at this point
Copy the full SHA f1cf2f5View commit details -
Rollup merge of rust-lang#128227 - Kobzol:ci-unrolled-perf-build-matr…
…ix, r=tgross35 CI: do not respect custom try jobs for unrolled perf builds Before this PR, if a pull request merged in a rollup had some `try-job` annotations, the unrolled perf builds were running the custom try jobs instead of the default job, which was wrong. Found out [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/try-perf.20jobs.20respect.20try-job.20annotations).
Configuration menu - View commit details
-
Copy full SHA for f9209ae - Browse repository at this point
Copy the full SHA f9209aeView commit details -
Rollup merge of rust-lang#128229 - tdittr:unsafe-extern-abi-error, r=…
…compiler-errors Improve `extern "<abi>" unsafe fn()` error message These errors were already reported in rust-lang#87217, and fixed by rust-lang#87235 but missed the case of an explicit ABI. This PR does not cover multiple keywords like `extern "C" pub const unsafe fn()`, but I don't know what a good way to cover this would be. It also seems rarer than `extern "C" unsafe` which I saw happen a few times in workshops.
Configuration menu - View commit details
-
Copy full SHA for 7eaf747 - Browse repository at this point
Copy the full SHA 7eaf747View commit details -
Rollup merge of rust-lang#128235 - harryscholes:fix-iterator-filter-d…
…ocs, r=tgross35 Fix `Iterator::filter` docs Small fix to add code formatting around `Iterator::filter` `true` return type
Configuration menu - View commit details
-
Copy full SHA for 8385f3b - Browse repository at this point
Copy the full SHA 8385f3bView commit details