Skip to content
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

Merged
merged 16 commits into from
Dec 14, 2024
Merged

Rollup of 8 pull requests #134294

merged 16 commits into from
Dec 14, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mkroening and others added 16 commits December 13, 2024 11:53
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
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) O-hermit Operating System: Hermit S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 14, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Dec 14, 2024

📌 Commit 4efa98c has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2024
@bors
Copy link
Contributor

bors commented Dec 14, 2024

⌛ Testing commit 4efa98c with merge ed14192...

@bors
Copy link
Contributor

bors commented Dec 14, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing ed14192 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 14, 2024
@bors bors merged commit ed14192 into rust-lang:master Dec 14, 2024
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 14, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134252 Fix Path::is_absolute on Hermit e1989afffa78652609dbd3f40091c6ee307f1784 (link)
#134254 Fix building std for Hermit after c_char change d0c3f1f6b96f6fffebd9be7f9ec2cd30789ad32c (link)
#134255 Update includes in /library/core/src/error.rs. ef53248370921c208a8ebe73cc20fbf97ef18272 (link)
#134261 Document the symbol Visibility enum 757dd26f1dbfb2a9200d9b6f35bebc71f5f6ddf8 (link)
#134262 Arbitrary self types v2: adjust diagnostic. ecbca7ccc800854e0a1292026c3e461db7c180c2 (link)
#134265 Rename ty_def_id so people will stop using it by accident b8d4b08240d03393cdcb26e72a9ba83da2545d35 (link)
#134271 Arbitrary self types v2: better feature gate test 2a361493c7ae390f085824d1543b8c07ff574526 (link)
#134274 Add check-pass test for &raw 636d16fe04522c41151f6ae07e85b87028ea6068 (link)

previous master: a1740a9c35

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ed14192): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) - - 0

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.

mean range count
Regressions ❌
(primary)
4.8% [3.4%, 6.3%] 2
Regressions ❌
(secondary)
2.1% [1.8%, 2.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.8% [3.4%, 6.3%] 2

Cycles

Results (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.

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.058s -> 768.74s (-0.04%)
Artifact size: 333.07 MiB -> 333.05 MiB (-0.00%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
…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
@matthiaskrgr matthiaskrgr deleted the rollup-anh6io8 branch January 25, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. O-hermit Operating System: Hermit rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants