Skip to content

Conversation

@jdonszelmann
Copy link
Contributor

@jdonszelmann jdonszelmann commented Sep 8, 2025

Supersedes #140010
Tracking issue: #125418

Getting started:

#![feature(eii)]

#[eii(eii1)]
pub fn decl1(x: u64) 
// body optional (it's the default)
{
    println!("default {x}");
}

// in another crate, maybe
#[eii1]
pub fn decl2(x: u64) {
    println!("explicit {x}");
}

fn main() {
    decl1(4);
}
  • tiny perf regression, underlying issue makes multiple things in the compiler slow, not just EII, planning to solve those separately.
  • No codegen_gcc support, they don't have bindings for weak symbols yet but could
  • No windows support yet for weak definitions

This PR merges the implementation of EII for just llvm + not windows, doesn't yet contain like a new panic handler implementation or alloc handler. With this implementation, it would support implementing the panic handler in terms of EII already since it requires no default implementation so no weak symbols

The PR has been open in various forms for about a year now, but I feel that having some implementation merged to build upon

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. labels Sep 8, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
Copy link
Contributor Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 9, 2025
[DONT MERGE] externally implementable items
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 9, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 9, 2025

☀️ Try build successful (CI)
Build commit: d5a6633 (d5a66337e06d3b77a1ab8f6793055535195c3ae9, parent: 364da5d88d772fa40fb20353443595385443ac25)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d5a6633): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +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.3% [0.1%, 1.5%] 19
Regressions ❌
(secondary)
0.4% [0.1%, 1.0%] 44
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 4
All ❌✅ (primary) 0.3% [0.1%, 1.5%] 19

Max RSS (memory usage)

Results (primary 1.7%, secondary 3.9%)

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

mean range count
Regressions ❌
(primary)
1.7% [0.6%, 2.3%] 6
Regressions ❌
(secondary)
4.7% [1.1%, 11.2%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.9%, -1.2%] 2
All ❌✅ (primary) 1.7% [0.6%, 2.3%] 6

Cycles

Results (primary 3.1%, secondary -1.3%)

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

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
3.2% [2.5%, 3.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-4.1%, -2.0%] 9
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

Binary size

Results (primary 0.0%, secondary 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.0% [0.0%, 0.1%] 93
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 61
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 93

Bootstrap: 468.052s -> 471.14s (0.66%)
Artifact size: 387.52 MiB -> 390.25 MiB (0.71%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 9, 2025
@jdonszelmann
Copy link
Contributor Author

Well, shit. I think I know some fixes but I hoped this wouldn't happen

@rust-log-analyzer

This comment was marked as off-topic.

@jdonszelmann
Copy link
Contributor Author

nope, still not. well let's at least test mingw

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 13, 2025
Externally implementable items

try-job: x86_64-mingw-1
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Dec 13, 2025

☀️ Try build successful (CI)
Build commit: ac3a540 (ac3a540eefa022a9ca61a06b34b6511a694457c8, parent: eb171a227f9e5de5d376b6edb56b174bc8235fb3)

@jdonszelmann
Copy link
Contributor Author

Well, fixed mingw, just a warning remaining...

@jdonszelmann
Copy link
Contributor Author

ah forgot to bless a test

@jdonszelmann
Copy link
Contributor Author

@rustbot review
let's try once more... nothing really changed except that I now explicitly exclude windows targets. I knew windows didn't work, but somehow I never actually remembered to exclude windows from running tests...

windows now passes (see try build). I guess it's time for another attempt at big ci

@jdonszelmann
Copy link
Contributor Author

@bors r=lcnr,oli-obk

@bors
Copy link
Collaborator

bors commented Dec 13, 2025

📌 Commit 065e4c1 has been approved by lcnr,oli-obk

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 13, 2025
@bors
Copy link
Collaborator

bors commented Dec 14, 2025

⌛ Testing commit 065e4c1 with merge 3f4dc1e...

@bors
Copy link
Collaborator

bors commented Dec 14, 2025

☀️ Test successful - checks-actions
Approved by: lcnr,oli-obk
Pushing 3f4dc1e to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 14, 2025
@bors bors merged commit 3f4dc1e into rust-lang:main Dec 14, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 14, 2025
@github-actions
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 2cd4ee6 (parent) -> 3f4dc1e (this PR)

Test differences

Show 153 test diffs

Stage 0

  • errors::verify_builtin_macros_eii_extern_target_expected_list_94: [missing] -> pass (J2)
  • errors::verify_builtin_macros_eii_extern_target_expected_unsafe_95: [missing] -> pass (J2)
  • errors::verify_builtin_macros_eii_only_once_97: [missing] -> pass (J2)
  • errors::verify_builtin_macros_eii_shared_macro_expected_function_96: [missing] -> pass (J2)
  • errors::verify_builtin_macros_eii_shared_macro_expected_max_one_argument_98: [missing] -> pass (J2)
  • errors::verify_passes_duplicate_eii_impls_120: [missing] -> pass (J2)
  • errors::verify_passes_eii_fn_with_track_caller_118: [missing] -> pass (J2)
  • errors::verify_passes_eii_impl_not_function_117: [missing] -> pass (J2)
  • errors::verify_passes_eii_without_impl_119: [missing] -> pass (J2)

Stage 1

  • errors::verify_builtin_macros_eii_extern_target_expected_list_94: [missing] -> pass (J0)
  • errors::verify_builtin_macros_eii_extern_target_expected_macro_93: [missing] -> pass (J0)
  • errors::verify_builtin_macros_eii_extern_target_expected_unsafe_95: [missing] -> pass (J0)
  • errors::verify_builtin_macros_eii_only_once_97: [missing] -> pass (J0)
  • errors::verify_builtin_macros_eii_shared_macro_expected_function_96: [missing] -> pass (J0)
  • errors::verify_builtin_macros_eii_shared_macro_expected_max_one_argument_98: [missing] -> pass (J0)
  • errors::verify_passes_duplicate_eii_impls_120: [missing] -> pass (J0)
  • errors::verify_passes_eii_fn_with_track_caller_118: [missing] -> pass (J0)
  • errors::verify_passes_eii_without_impl_119: [missing] -> pass (J0)
  • [ui] tests/ui/eii/codegen_cross_crate.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/cross_crate.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/cross_crate_wrong_ty.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/default/call_default.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/default/call_impl.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/default/local_crate.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/default/local_crate_explicit.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/duplicate/duplicate1.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/duplicate/duplicate2.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/errors.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/multiple_decls.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/multiple_impls.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/privacy1.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/privacy2.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/same-symbol.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/subtype_1.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/subtype_2.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/subtype_4.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/unsafe_impl_err.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/unsafe_impl_ok.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/wrong_ret_ty.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/wrong_target.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/wrong_ty.rs: [missing] -> pass (J2)
  • [ui] tests/ui/eii/wrong_ty_2.rs: [missing] -> pass (J2)
  • [ui] tests/ui/error-codes/E0806.rs: [missing] -> pass (J2)
  • [ui] tests/ui/feature-gates/feature-gate-eii-internals.rs: [missing] -> pass (J2)
  • [ui] tests/ui/feature-gates/feature-gate-extern-item-impls.rs: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/eii/codegen_cross_crate.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/codegen_single_crate.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/default/call_impl.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/default/local_crate.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/default/local_crate_explicit.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/duplicate/duplicate1.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/duplicate/duplicate2.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/duplicate/duplicate3.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/multiple_impls.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/privacy1.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/same-symbol.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/codegen_cross_crate.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/codegen_single_crate.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/default/call_default.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/default/call_impl.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/default/local_crate.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/default/local_crate_explicit.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/duplicate/duplicate1.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/duplicate/duplicate2.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/duplicate/duplicate3.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/multiple_impls.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/privacy1.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/same-symbol.rs: [missing] -> ignore (ignored when the operating system is windows) (J3)
  • [ui] tests/ui/eii/codegen_cross_crate.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/codegen_single_crate.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/default/call_default.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/default/call_impl.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/default/local_crate.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/default/local_crate_explicit.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/duplicate/duplicate1.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/duplicate/duplicate2.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/duplicate/duplicate3.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/multiple_impls.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/privacy1.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/same-symbol.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)
  • [ui] tests/ui/eii/cross_crate.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/cross_crate_wrong_ty.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/errors.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/multiple_decls.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/privacy2.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/subtype_1.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/subtype_2.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/subtype_3.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/subtype_4.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/unsafe_impl_err.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/unsafe_impl_ok.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/wrong_ret_ty.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/wrong_target.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/wrong_ty.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/wrong_ty_2.rs: [missing] -> pass (J5)
  • [ui] tests/ui/error-codes/E0806.rs: [missing] -> pass (J5)
  • [ui] tests/ui/feature-gates/feature-gate-eii-internals.rs: [missing] -> pass (J5)
  • [ui] tests/ui/feature-gates/feature-gate-extern-item-impls.rs: [missing] -> pass (J5)
  • [ui] tests/ui/eii/default/call_default.rs: [missing] -> ignore (ignored when the operating system is macos) (J6)
  • [ui] tests/ui/eii/default/call_default.rs: [missing] -> pass (J7)

(and 5 additional test diffs)

Additionally, 48 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 3f4dc1e02d759aa3c3807d4efc1f7f6e293536a5 --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-various-1: 6357.6s -> 4002.1s (-37.0%)
  2. aarch64-apple: 8425.7s -> 10833.1s (+28.6%)
  3. pr-check-1: 1689.2s -> 1977.5s (+17.1%)
  4. pr-check-2: 2372.8s -> 2728.2s (+15.0%)
  5. dist-x86_64-apple: 8299.8s -> 7057.8s (-15.0%)
  6. x86_64-rust-for-linux: 2795.6s -> 3206.8s (+14.7%)
  7. tidy: 149.0s -> 164.3s (+10.3%)
  8. i686-gnu-2: 5735.3s -> 6254.3s (+9.0%)
  9. x86_64-gnu-miri: 4730.6s -> 5145.0s (+8.8%)
  10. x86_64-gnu-aux: 6545.2s -> 7108.9s (+8.6%)
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 (3f4dc1e): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.6% [0.6%, 0.7%] 2
Regressions ❌
(secondary)
0.3% [0.1%, 0.8%] 35
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 2
All ❌✅ (primary) 0.6% [0.6%, 0.7%] 2

Max RSS (memory usage)

Results (primary -1.8%, secondary 1.6%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [0.8%, 5.3%] 3
Improvements ✅
(primary)
-1.8% [-2.4%, -1.2%] 2
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -1.8% [-2.4%, -1.2%] 2

Cycles

Results (primary 2.4%, 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)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
4.4% [2.5%, 5.2%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.7% [-7.4%, -3.6%] 3
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 1

Binary size

Results (primary 0.0%, secondary 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.0% [0.0%, 0.1%] 53
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 54
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 53

Bootstrap: 474.624s -> 478.161s (0.75%)
Artifact size: 389.52 MiB -> 390.27 MiB (0.19%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.