-
Notifications
You must be signed in to change notification settings - Fork 13k
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 8 pull requests #134294
Rollup of 8 pull requests #134294
Conversation
The recently landed PR to adjust arbitrary self types was a bit overenthusiastic, advising folks to use the new Receiver trait even before it's been stabilized. Revert to the older wording of the lint in such cases.
Slight improvement to the test for the arbitrary_self_types_pointers feature gate, to ensure it's independent of the arbitrary_self_types gate. Part of rust-lang#44874
…ross35 Fix `Path::is_absolute` on Hermit Paths on Hermit work like paths on Unix. Closes rust-lang#132141.
…jubilee Fix building `std` for Hermit after `c_char` change These changes were made necessary by rust-lang#132975.
Update includes in `/library/core/src/error.rs`. This PR removes the `crate::fmt::Result` include in `/library/core/src/error.rs`. The main issue with this `use` statement is that it shadows the `Result` type from the prelude (i.e. `crate::result::Result`). This indirectly makes all docs references to `Result` in this module point to the wrong type (but only in `core::error` - not `std::error`, wherein this include isn't present to begin with). Fixes: rust-lang#134169
… r=lqd Document the symbol Visibility enum
…mpiler-errors Arbitrary self types v2: adjust diagnostic. The recently landed PR rust-lang#132961 to adjust arbitrary self types was a bit overenthusiastic, advising folks to use the new Receiver trait even before it's been stabilized. Revert to the older wording of the lint in such cases. Tracking issue rust-lang#44874 r? ``@wesleywiser``
Rename `ty_def_id` so people will stop using it by accident This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
…leywiser Arbitrary self types v2: better feature gate test Slight improvement to the test for the `arbitrary_self_types_pointers` feature gate, to ensure it's independent of the `arbitrary_self_types` gate. Part of rust-lang#44874 r? `@wesleywiser`
… r=Noratrieb Add check-pass test for `&raw` `&raw` denotes a normal/non-raw borrow of the path `raw`, not the start of raw borrow since it's not followed by either `const` or `mut`. Ensure this (and variants) will never regress! When I saw the open diagnostic issue rust-lang#133231 (better parse error (recovery) on `&raw <expr>`), it made me think that we have to make sure that we will never commit too early/overzealously(†) when encountering the sequence `&raw`, even during parse error recovery! Modifying the parser to eagerly treat `&raw` as the start of a raw borrow expr only lead to a single UI test failing, namely [tests/ui/enum-discriminant/ptr_niche.rs](https://github.com/rust-lang/rust/blob/4847d6a9d07d4be9ba3196f6ad444af2d7bdde72/tests/ui/enum-discriminant/ptr_niche.rs). However, this is just coincidental — it didn't *intentionally* test this edge case of the grammar. --- †: With "eager" I mean something like: ```patch diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 0904a42d8a4..68d690fd602 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs `@@` -873,11 +873,16 `@@` fn error_remove_borrow_lifetime(&self, span: Span, lt_span: Span) { /// Parse `mut?` or `raw [ const | mut ]`. fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) { - if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) { + if self.eat_keyword(kw::Raw) { // `raw [ const | mut ]`. - let found_raw = self.eat_keyword(kw::Raw); - assert!(found_raw); - let mutability = self.parse_const_or_mut().unwrap(); + let mutability = self.parse_const_or_mut().unwrap_or_else(|| { + let span = self.prev_token.span; + self.dcx().emit_err(ExpectedMutOrConstInRawBorrowExpr { + span, + after_ampersand: span.shrink_to_hi(), + }); + ast::Mutability::Not + }); (ast::BorrowKind::Raw, mutability) } else { // `mut?` ``` --- r? compiler
@bors r+ rollup=never p=8 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: a1740a9c35 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (ed14192): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 4.8%, secondary 2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.058s -> 768.74s (-0.04%) |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#134252 (Fix `Path::is_absolute` on Hermit) - rust-lang#134254 (Fix building `std` for Hermit after `c_char` change) - rust-lang#134255 (Update includes in `/library/core/src/error.rs`.) - rust-lang#134261 (Document the symbol Visibility enum) - rust-lang#134262 (Arbitrary self types v2: adjust diagnostic.) - rust-lang#134265 (Rename `ty_def_id` so people will stop using it by accident) - rust-lang#134271 (Arbitrary self types v2: better feature gate test) - rust-lang#134274 (Add check-pass test for `&raw`) r? `@ghost` `@rustbot` modify labels: rollup
Successful merges:
Path::is_absolute
on Hermit #134252 (FixPath::is_absolute
on Hermit)std
for Hermit afterc_char
change #134254 (Fix buildingstd
for Hermit afterc_char
change)/library/core/src/error.rs
. #134255 (Update includes in/library/core/src/error.rs
.)ty_def_id
so people will stop using it by accident #134265 (Renamety_def_id
so people will stop using it by accident)&raw
#134274 (Add check-pass test for&raw
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup