Skip to content

Rollup of 10 pull requests #142422

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

Closed
wants to merge 26 commits into from

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jun 12, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

chenyukang and others added 26 commits May 27, 2025 22:19
When a method is not present because of a trait bound not being met, and that trait bound is on a tuple, we check if making the tuple have no borrowed types makes the method to be found and highlight it if it does. This is a common problem for Bevy in particular and ORMs in general.
 lint on duplicates during attribute parsing
To do this we stuff them in the diagnostic context to be emitted after
hir is constructed
It corresponds 1:1 to the bootstrap team, and with the review preferences we shouldn't need it.
…rors,traviscross

Lint on fn pointers comparisons in external macros

This PR extends the recently stabilized `unpredictable_function_pointer_comparisons` lint ~~to also lint on `Option<{function pointer}>` and~~ as well as linting in external macros (as to catch `assert_eq!` and others).

```rust
assert_eq!(Some::<FnPtr>(func), Some(func as unsafe extern "C" fn()));
//~^ WARN function pointer comparisons

#[derive(PartialEq, Eq)]
struct A {
    f: fn(),
    //~^ WARN function pointer comparisons
}
```

Fixes rust-lang#134527
…ra, r=oli-obk

Infrastructure for lints during attribute parsing, specifically duplicate usages of attributes

r? `@oli-obk`

This PR adds a new field to OwnerInfo to buffer lints which are generated during attribute parsing and ast lowering in general. They can't be emitted at this stage because at that point there's no HIR yet, and early lints are already emitted.

This also adds the generic `S: Stage` to attribute parsers. Currently we don't emit any lints during early attribute parsing, but if we ever want to that logic will be different. That's because there we don't have hir ids yet, while at the same time still having access to node ids and early lints. Even though that logic isn't completely there in this PR (no worries, we don't use it), that's why the parameter is there.

With this PR, we also add 2 associated consts  to `SingleAttributeParser`. Those determine what logic should be applied when finding a duplicate attribute.

This PR was getting pretty large, so the first code using this logic is in rust-lang#138165. This code is all new things that weren't possible before so it also doesn't break any behaviour. However, some of it will be dead code right now. I recommend reviewing both before merging, though in some sense that doubles the size of the review again, and the other PR might be more controversial. Let me know how you want to do this `@oli-obk`
…st-mut, r=davidtwco

Suggest mut when possbile for temporary value dropped while borrowed

Fixes rust-lang#137486
…r-errors

resolve: Tweak `private_macro_use` lint to be compatible with upcoming macro prelude changes

Unblocks rust-lang#139493.
Zulip thread requesting help - [#t-compiler/help > Help requested for effects of rust-lang#139493](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Help.20requested.20for.20effects.20of.20.23139493/with/514653911).

This PR by itself shouldn't cause any observable changes, its only observable effect is that the prelude changes from rust-lang#139493 will no longer cause regressions in tests like `tests/ui/imports/issue-119369.rs` or `tests/ui/extern/issue-80074.rs`.

This is achieved by moving the "is this thing in stdlib prelude" check from an early point (`fn process_macro_use_imports`) to a later point (`fn record_use_inner`), at which the stdlib prelude is already populated and can be inspected.
(The `is_builtin_macro` check is subsumed by the stdlib prelude check, all built-in macros go through the stdlib prelude anyway.)
Detect method not being present that is present in other tuple types

When a method is not present because of a trait bound not being met, and that trait bound is on a tuple, we check if making the tuple have no borrowed types makes the method to be found and highlight it if it does. This is a common problem for Bevy in particular and ORMs in general.

<img width="1166" alt="Screenshot 2025-06-04 at 10 38 24 AM" src="https://github.com/user-attachments/assets/d257c9ea-c2d7-42e7-8473-8b93aa54b8e0" />

Address rust-lang#141258. I believe that more combination of cases in the tuple types should be handled (like adding borrows and checking when a specific type needs to not be a borrow while the rest stay the same), but for now this handles the most common case.
…orkingjubilee

chore(doctest): Remove redundant blank lines

Remove redundant leading blank lines from doctests of [`iN::cast_unsigned`](https://doc.rust-lang.org/std/primitive.i32.html#method.cast_unsigned), [`slice::escape_ascii`](https://doc.rust-lang.org/std/primitive.slice.html#method.escape_ascii) and [`u8::escape_ascii`](https://doc.rust-lang.org/std/primitive.u8.html#method.escape_ascii).
…t, r=WaffleLapkin

Note when enum variants shadow an associated function

r? `@WaffleLapkin`

Closes rust-lang#142263
…p, r=davidtwco

Remove bootstrap adhoc group

It corresponds 1:1 to the current bootstrap team, and with the new review preferences we shouldn't need it.

Discussed on Zulip.

r? `@davidtwco`
…fleLapkin

Add myself (WaffleLapkin) to review rotation

`@bors` r+
…ease

Remove lower_arg_ty as all callers were passing `None`

r? `@fmease` or `@BoxyUwU`

I think this is just leftover from other refactorings
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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. labels Jun 12, 2025
@rustbot rustbot added T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 12, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=1

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

📌 Commit 2960568 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 Jun 12, 2025
@matthiaskrgr matthiaskrgr reopened this Jun 12, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=1

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

📌 Commit 2960568 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

⌛ Testing commit 2960568 with merge f874c54...

bors added a commit that referenced this pull request Jun 12, 2025
Rollup of 10 pull requests

Successful merges:

 - #134536 (Lint on fn pointers comparisons in external macros)
 - #138164 (Infrastructure for lints during attribute parsing, specifically duplicate usages of attributes)
 - #141069 (Suggest mut when possbile for temporary value dropped while borrowed)
 - #141934 (resolve: Tweak `private_macro_use` lint to be compatible with upcoming macro prelude changes)
 - #142034 (Detect method not being present that is present in other tuple types)
 - #142402 (chore(doctest): Remove redundant blank lines)
 - #142406 (Note when enum variants shadow an associated function)
 - #142407 (Remove bootstrap adhoc group)
 - #142408 (Add myself (WaffleLapkin) to review rotation)
 - #142418 (Remove lower_arg_ty as all callers were passing `None`)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::Crate { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, target: x86_64-unknown-linux-gnu, mode: Std, crates: ["std"] } -- 69.707
Build completed successfully in 0:01:13
+ head -n 1 /tmp/browser-ui-test.version
+ npm install [email protected] --unsafe-perm=true
npm ERR! code 1
npm ERR! path /checkout/obj/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.mjs
npm ERR! Error: ERROR: Failed to set up Chrome v127.0.6533.88! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
npm ERR!     at file:///checkout/obj/node_modules/puppeteer/lib/esm/puppeteer/node/install.js:58:23
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR!     at async Promise.all (index 0)
npm ERR!     at async downloadBrowser (file:///checkout/obj/node_modules/puppeteer/lib/esm/puppeteer/node/install.js:90:9) {
npm ERR!   [cause]: Error: Download failed: server returned code 503. URL: https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.88/linux64/chrome-linux64.zip
npm ERR!       at file:///checkout/obj/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js:67:31
npm ERR!       at ClientRequest.requestCallback (file:///checkout/obj/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js:45:13)
npm ERR!       at Object.onceWrapper (node:events:633:26)
npm ERR!       at ClientRequest.emit (node:events:518:28)
npm ERR!       at HTTPParser.parserOnIncomingClient (node:_http_client:698:27)
npm ERR!       at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
npm ERR!       at TLSSocket.socketOnData (node:_http_client:540:22)
npm ERR!       at TLSSocket.emit (node:events:518:28)
npm ERR!       at addChunk (node:internal/streams/readable:559:12)
npm ERR!       at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
npm ERR! }

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-06-12T18_27_53_564Z-debug-0.log
  local time: Thu Jun 12 18:34:26 UTC 2025
  network time: Thu, 12 Jun 2025 18:34:26 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::Crate { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, target: x86_64-unknown-linux-gnu, mode: Std, crates: ["std"] } -- 66.208
Build completed successfully in 0:01:09
+ head -n 1 /tmp/browser-ui-test.version
+ npm install [email protected] --unsafe-perm=true
npm ERR! code E503
npm ERR! 503 Service Unavailable - GET https://registry.npmjs.org/@tootallnate%2fquickjs-emscripten - Service Unavailable

npm ERR! A complete log of this run can be found in: /home/user/.npm/_logs/2025-06-12T19_40_57_887Z-debug-0.log
  local time: Thu Jun 12 19:46:46 UTC 2025
  network time: Thu, 12 Jun 2025 19:46:46 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 12, 2025
@matthiaskrgr
Copy link
Member Author

@bors retry

@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 Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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.