Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Sep 10, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercote and others added 29 commits September 8, 2025 06:07
- The empty symbol is no longer a keyword.
- I don't think any of the special reserved identifiers are used for
  error recovery.
there is no reason this should not work, really, we're just cutting some scope for now
This commit manually implements `RefUnwindSafe` for
`std::sync::Barrier` to fix 146087. This is a fix for a regression
indroduced by rust-lang@e95db59
std: make address resolution weirdness local to SGX

Currently, the implementations of `TcpStream::connect` and its cousins take an `io::Result<&SocketAddr>` as argument, which is very weird, as most of them then `?`-try the result immediately to access the actual address. This weirdness is however necessitated by a peculiarity of the SGX networking implementation:

SGX doesn't support DNS resolution but rather accepts hostnames in the same place as socket addresses. So, to make e.g.
```rust
TcpStream::connect("example.com:80")`
```
work, the DNS lookup returns a special error (`NonIpSockAddr`) instead, which contains the hostname being looked up. When `.to_socket_addrs()` fails, the `each_addr` function used to select an address will pass the error to the inner `TcpStream::connect` implementation, which in SGX's case will inspect the error and try recover the hostname from it. If
that succeeds, it continues with the found hostname.

This is pretty obviously a terrible hack and leads to buggy code (for instance, when users use the result of `.to_socket_addrs()` in their own `ToSocketAddrs` implementation to select from a list of possible URLs, the only URL used will be that of the last item tried). Still, without changes to the SGX usercall ABI, it cannot be avoided.

Therefore, this PR aims to minimise the impact of that weirdness and remove it from all non-SGX platforms. The inner `TcpStream::connect`, et al. functions now receive the `ToSocketAddrs` type directly and call `each_addr` (which is moved to `sys::net::connection`) themselves. On SGX, the implementation uses a special `each_addr` which contains the whole pass-hostname-through-error hack.

As well as making the code cleaner, this also opens up the possibility of reusing newly created sockets even if a connection request fails – but I've left that for another PR.

CC `@raoulstrackx`
default auto traits: use default supertraits instead of `Self: Trait` bounds on associated items

First commit: the motivation has been discussed [here](rust-lang#144679).

Second commit:  the only new places where new implicit `DefaultAutoTrait` bounds are generated are supertraits and trait object so `?Trait` syntax should be extended to these places only.

r? `@lcnr`
Suggest examples of format specifiers in error messages

Format macro now suggests adding `{}` if no formatting specifiers are present. It also gives an example:
```rust
LL |     println!("Hello", "World");
   |              -------  ^^^^^^^ argument never used
   |              |
   |              formatting specifier missing
   |
   = note: format specifiers use curly braces: `{}`
help: consider adding format specifier
   |
LL |     println!("Hello{}", "World");
   |                    ++
```
When one or more `{}` are present, it doesn't show 'format specifiers use curly braces: `{}`' and example, just small hint on how many you missing:
```rust
LL |     println!("list: {}", 1, 2, 3);
   |              ----------     ^  ^ argument never used
   |              |              |
   |              |              argument never used
   |              multiple missing formatting specifiers
   |
   = help: consider adding 2 format specifiers
```

Original issue: rust-lang#68293
Based on discussion in this PR: rust-lang#76443

Let me know if something is missing
…rochenkov

Minor symbol comment fixes.

- The empty symbol is no longer a keyword.
- I don't think any of the special reserved identifiers are used for error recovery.

r? ```@petrochenkov```
Make Barrier RefUnwindSafe again

This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fix rust-lang#146087. This is a fix for a regression indroduced by rust-lang@e95db59
Add tests for deref on pin

Tests split out from rust-lang#145608.

r? `@lcnr`
…fee1-dead,Urgau

Strip frontmatter in fewer places

* Stop stripping frontmatter in `proc_macro::Literal::from_str` (RUST-146132)
* Stop stripping frontmatter in expr-ctxt (but not item-ctxt!) `include`s (RUST-145945)
* Stop stripping shebang (!) in `proc_macro::Literal::from_str`
  * Not a breaking change because it did compare spans already to ensure there wasn't extra whitespace or comments (`Literal::from_str("#!\n0")` already yields `Err(_)` thankfully!)
* Stop stripping frontmatter+shebang inside some rustdoc code where it doesn't make any observable difference (see self review comments)
* (Stop stripping frontmatter+shebang inside internal test code)

Fixes rust-lang#145945.
Fixes rust-lang#146132.

r? fee1-dead
…3, r=workingjubilee

Improve C-variadic error messages: part 2

tracking issue: rust-lang#44930

a reimplementation of rust-lang#143546 that builds on rust-lang#146165.

This PR

- disallows coroutines (e.g. `async fn`) from having a `...` argument
- disallows associated functions (both in traits and standard impl blocks) from having a `...` argument
- splits up a generic "ill-formed C-variadic function" into specific errors about using an incorrect ABI, not specifying an ABI, or missing the unsafe keyword

C-variadic coroutines probably don't make sense? C-variadic functions are for FFI purposes, combining that with async functions seems weird.

For associated functions, we're just cutting scope. It's probably fine, but it's probably better to explicitly allow it. So for now, at least give a more targeted error message.

Made to be reviewed commit-by-commit.

cc `@workingjubilee`
r? compiler
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2025
@rustbot rustbot added T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Sep 10, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Sep 10, 2025

📌 Commit bb45ea3 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 Sep 10, 2025
@bors
Copy link
Collaborator

bors commented Sep 10, 2025

⌛ Testing commit bb45ea3 with merge f4665ab...

@bors
Copy link
Collaborator

bors commented Sep 11, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 11, 2025
@bors bors merged commit f4665ab into rust-lang:master Sep 11, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 11, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#145327 std: make address resolution weirdness local to SGX f328e2c17c37ceece5dd793da3d1bcd31685a6ed (link)
#145879 default auto traits: use default supertraits instead of `Se… ee4ec2db71c98ca70a34651822bc5864da65a7bb (link)
#146123 Suggest examples of format specifiers in error messages e9497c0aead2bd36372dbd1858fdb3e3d63e1e38 (link)
#146311 Minor symbol comment fixes. ce3e01671a5706d00005d10c8a26fdb0bf1e036b (link)
#146322 Make Barrier RefUnwindSafe again c9658f9be1b0af9c69d9b7d3037c03c3934f9f82 (link)
#146327 Add tests for deref on pin 17e406005c4902cfe45e8e0d776fac1107b6df2e (link)
#146340 Strip frontmatter in fewer places a32ceac0cb101c638428dbfcf26ec22251b7db07 (link)
#146342 Improve C-variadic error messages: part 2 4d4469e7ecd9430e4599cfcdac6d3c1fb0fc78da (link)

previous master: 565a9ca63e

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

Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 565a9ca (parent) -> f4665ab (this PR)

Test differences

Show 269 test diffs

Stage 0

  • errors::verify_ast_passes_abi_cannot_be_coroutine_66: [missing] -> pass (J0)
  • errors::verify_ast_passes_abi_custom_safe_foreign_function_64: [missing] -> pass (J0)
  • errors::verify_ast_passes_abi_custom_safe_function_61: pass -> [missing] (J0)
  • errors::verify_ast_passes_abi_must_not_have_parameters_or_return_type_63: pass -> [missing] (J0)
  • errors::verify_ast_passes_abi_x86_interrupt_65: pass -> [missing] (J0)
  • errors::verify_ast_passes_at_least_one_trait_39: [missing] -> pass (J0)
  • errors::verify_ast_passes_auto_generic_30: pass -> [missing] (J0)
  • errors::verify_ast_passes_auto_generic_33: [missing] -> pass (J0)
  • errors::verify_ast_passes_auto_items_32: pass -> [missing] (J0)
  • errors::verify_ast_passes_auto_super_lifetime_31: pass -> [missing] (J0)
  • errors::verify_ast_passes_bad_c_variadic_26: pass -> [missing] (J0)
  • errors::verify_ast_passes_c_variadic_bad_extern_29: [missing] -> pass (J0)
  • errors::verify_ast_passes_c_variadic_must_be_unsafe_28: [missing] -> pass (J0)
  • errors::verify_ast_passes_const_and_c_variadic_48: pass -> [missing] (J0)
  • errors::verify_ast_passes_constraint_on_negative_bound_53: pass -> [missing] (J0)
  • errors::verify_ast_passes_constraint_on_negative_bound_57: [missing] -> pass (J0)
  • errors::verify_ast_passes_extern_without_abi_58: pass -> [missing] (J0)
  • errors::verify_ast_passes_extern_without_abi_sugg_63: [missing] -> pass (J0)
  • errors::verify_ast_passes_fieldless_union_45: [missing] -> pass (J0)
  • errors::verify_ast_passes_generic_default_trailing_47: [missing] -> pass (J0)
  • errors::verify_ast_passes_incompatible_features_51: pass -> [missing] (J0)
  • errors::verify_ast_passes_incompatible_features_55: [missing] -> pass (J0)
  • errors::verify_ast_passes_item_underscore_27: pass -> [missing] (J0)
  • errors::verify_ast_passes_match_arm_with_no_body_55: pass -> [missing] (J0)
  • errors::verify_ast_passes_match_arm_with_no_body_59: [missing] -> pass (J0)
  • errors::verify_ast_passes_missing_unsafe_on_extern_44: [missing] -> pass (J0)
  • errors::verify_ast_passes_module_nonascii_32: [missing] -> pass (J0)
  • errors::verify_ast_passes_negative_bound_not_supported_52: pass -> [missing] (J0)
  • errors::verify_ast_passes_negative_bound_not_supported_56: [missing] -> pass (J0)
  • errors::verify_ast_passes_negative_bound_with_parenthetical_notation_58: [missing] -> pass (J0)
  • errors::verify_ast_passes_nested_impl_trait_35: pass -> [missing] (J0)
  • errors::verify_ast_passes_nested_impl_trait_38: [missing] -> pass (J0)
  • errors::verify_ast_passes_nested_lifetimes_45: pass -> [missing] (J0)
  • errors::verify_ast_passes_nomangle_ascii_28: pass -> [missing] (J0)
  • errors::verify_ast_passes_nomangle_ascii_31: [missing] -> pass (J0)
  • errors::verify_ast_passes_obsolete_auto_38: pass -> [missing] (J0)
  • errors::verify_ast_passes_obsolete_auto_41: [missing] -> pass (J0)
  • errors::verify_ast_passes_out_of_order_params_40: [missing] -> pass (J0)
  • errors::verify_ast_passes_pattern_in_bodiless_54: [missing] -> pass (J0)
  • errors::verify_ast_passes_pattern_in_fn_pointer_36: [missing] -> pass (J0)
  • errors::verify_ast_passes_pattern_in_foreign_53: [missing] -> pass (J0)
  • errors::verify_ast_passes_precise_capturing_duplicated_57: pass -> [missing] (J0)
  • errors::verify_ast_passes_precise_capturing_duplicated_61: [missing] -> pass (J0)
  • errors::verify_ast_passes_trait_object_single_bound_37: [missing] -> pass (J0)
  • errors::verify_ast_passes_unsafe_negative_impl_39: pass -> [missing] (J0)
  • errors::verify_ast_passes_where_clause_after_type_alias_43: pass -> [missing] (J0)

Stage 1

  • [ui] tests/ui/deref/pin-deref-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/deref/pin-impl-deref.rs: [missing] -> pass (J0)
  • [ui] tests/ui/frontmatter/include-in-expr-ctxt.rs: [missing] -> pass (J0)
  • [ui] tests/ui/frontmatter/include-in-item-ctxt.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/default_auto_traits/backward-compatible-lazy-bounds-pass.rs: pass -> [missing] (J0)
  • errors::verify_ast_passes_abi_cannot_be_coroutine_62: pass -> [missing] (J2)
  • errors::verify_ast_passes_abi_custom_safe_foreign_function_60: pass -> [missing] (J2)
  • errors::verify_ast_passes_abi_custom_safe_function_61: pass -> [missing] (J2)
  • errors::verify_ast_passes_abi_custom_safe_function_65: [missing] -> pass (J2)
  • errors::verify_ast_passes_abi_must_not_have_parameters_or_return_type_63: pass -> [missing] (J2)
  • errors::verify_ast_passes_abi_must_not_have_parameters_or_return_type_67: [missing] -> pass (J2)
  • errors::verify_ast_passes_abi_must_not_have_return_type_64: pass -> [missing] (J2)
  • errors::verify_ast_passes_at_least_one_trait_39: [missing] -> pass (J2)
  • errors::verify_ast_passes_auto_generic_30: pass -> [missing] (J2)
  • errors::verify_ast_passes_auto_items_32: pass -> [missing] (J2)
  • errors::verify_ast_passes_auto_super_lifetime_34: [missing] -> pass (J2)
  • errors::verify_ast_passes_c_variadic_bad_extern_29: [missing] -> pass (J2)
  • errors::verify_ast_passes_c_variadic_no_extern_27: [missing] -> pass (J2)
  • errors::verify_ast_passes_const_bound_trait_object_46: pass -> [missing] (J2)
  • errors::verify_ast_passes_coroutine_and_c_variadic_52: [missing] -> pass (J2)
  • errors::verify_ast_passes_extern_without_abi_58: pass -> [missing] (J2)
  • errors::verify_ast_passes_extern_without_abi_sugg_59: pass -> [missing] (J2)
  • errors::verify_ast_passes_extern_without_abi_sugg_63: [missing] -> pass (J2)
  • errors::verify_ast_passes_fieldless_union_45: [missing] -> pass (J2)
  • errors::verify_ast_passes_generic_default_trailing_47: [missing] -> pass (J2)
  • errors::verify_ast_passes_item_underscore_30: [missing] -> pass (J2)
  • errors::verify_ast_passes_match_arm_with_no_body_55: pass -> [missing] (J2)
  • errors::verify_ast_passes_missing_unsafe_on_extern_44: [missing] -> pass (J2)
  • errors::verify_ast_passes_module_nonascii_29: pass -> [missing] (J2)
  • errors::verify_ast_passes_negative_bound_not_supported_52: pass -> [missing] (J2)
  • errors::verify_ast_passes_negative_bound_with_parenthetical_notation_54: pass -> [missing] (J2)
  • errors::verify_ast_passes_nested_impl_trait_35: pass -> [missing] (J2)
  • errors::verify_ast_passes_nested_impl_trait_38: [missing] -> pass (J2)
  • errors::verify_ast_passes_nested_lifetimes_45: pass -> [missing] (J2)
  • errors::verify_ast_passes_nomangle_ascii_28: pass -> [missing] (J2)
  • errors::verify_ast_passes_obsolete_auto_38: pass -> [missing] (J2)
  • errors::verify_ast_passes_pattern_in_bodiless_50: pass -> [missing] (J2)
  • errors::verify_ast_passes_pattern_in_fn_pointer_33: pass -> [missing] (J2)
  • errors::verify_ast_passes_pattern_in_foreign_53: [missing] -> pass (J2)
  • errors::verify_ast_passes_precise_capturing_duplicated_57: pass -> [missing] (J2)
  • errors::verify_ast_passes_precise_capturing_duplicated_61: [missing] -> pass (J2)
  • errors::verify_ast_passes_precise_capturing_not_allowed_here_60: [missing] -> pass (J2)
  • errors::verify_ast_passes_trait_object_single_bound_34: pass -> [missing] (J2)
  • errors::verify_ast_passes_unsafe_item_40: pass -> [missing] (J2)
  • errors::verify_ast_passes_unsafe_negative_impl_39: pass -> [missing] (J2)
  • errors::verify_ast_passes_unsafe_negative_impl_42: [missing] -> pass (J2)
  • errors::verify_ast_passes_where_clause_after_type_alias_43: pass -> [missing] (J2)
  • errors::verify_ast_passes_where_clause_after_type_alias_46: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/deref/pin-deref-const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/deref/pin-deref.rs: [missing] -> pass (J1)
  • [ui] tests/ui/frontmatter/include-in-expr-ctxt.rs: [missing] -> pass (J1)
  • [ui] tests/ui/frontmatter/include-in-item-ctxt.rs: [missing] -> pass (J1)
  • [ui] tests/ui/frontmatter/included-frontmatter.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/default_auto_traits/backward-compatible-lazy-bounds-pass.rs: pass -> [missing] (J1)

(and 86 additional test diffs)

Additionally, 83 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard f4665ab8368ad2e8a86d4390ae35c28bdd9561bb --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 5469.0s -> 7997.5s (46.2%)
  2. aarch64-apple: 4362.6s -> 6300.2s (44.4%)
  3. dist-apple-various: 3136.1s -> 4438.4s (41.5%)
  4. aarch64-gnu-llvm-19-2: 2126.3s -> 2658.5s (25.0%)
  5. i686-gnu-2: 5440.5s -> 6309.4s (16.0%)
  6. i686-gnu-1: 7527.5s -> 8405.7s (11.7%)
  7. pr-check-1: 1333.8s -> 1487.4s (11.5%)
  8. dist-aarch64-msvc: 6191.4s -> 5496.7s (-11.2%)
  9. x86_64-gnu-miri: 4368.5s -> 4849.6s (11.0%)
  10. x86_64-gnu-aux: 6282.8s -> 6934.7s (10.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f4665ab): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.5% [0.0%, 0.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.5%, secondary 1.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.5% [0.7%, 2.3%] 3
Regressions ❌
(secondary)
1.4% [0.5%, 2.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [0.7%, 2.3%] 3

Cycles

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

Binary size

Results (primary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Bootstrap: 468.891s -> 468.319s (-0.12%)
Artifact size: 387.51 MiB -> 387.51 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.