Skip to content

Instantiate binder before registering nested obligations for auto/built-in traits #138915

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 24, 2025

Instead of turning a Binder<Vec<Ty>> into a bunch of higher-ranked predicates, instantiate the binder eagerly once and turn them into a bunch of non-higher-ranked predicates.

Right now this feels like a noop, but this enter_forall_and_leak_universe call would be the singular place where we could instantiate bound lifetime assumptions for coroutine witnesses... if we had them. Thus consolidating the binder instantiation here is useful if we want to fix the coroutine-auto-trait problem.

r? lcnr

@rustbot rustbot added 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 Mar 24, 2025
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 24, 2025
@bors
Copy link
Collaborator

bors commented Mar 24, 2025

⌛ Trying commit 93b3be3 with merge b2fb67b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2025
Instantiate binder before registering nested obligations for auto/built-in traits

Instead of turning a `Binder<Vec<Ty>>` into a bunch of `Binder<Predicate>`, instantiate the binder eagerly *once* and turn them into a bunch of non-higher ranked predicates.

This `enter_forall_and_leak_universe` call would be where we could instantiate bound lifetime assumptions for coroutine witnesses... if we had them.

r? lcnr
@bors
Copy link
Collaborator

bors commented Mar 25, 2025

☀️ Try build successful - checks-actions
Build commit: b2fb67b (b2fb67b8b6007ced9ad3f3b752a6fec899e7859c)

@rust-timer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

wouldnt hurt to run crater i guess

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-138915 created and queued.
🤖 Automatically detected try build b2fb67b
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 25, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-138915 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b2fb67b): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 1.9%)

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)
1.9% [1.9%, 1.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [1.9%, 1.9%] 1

Cycles

Results (secondary 10.9%)

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)
- - 0
Regressions ❌
(secondary)
10.9% [10.6%, 11.5%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 777.151s -> 779.42s (0.29%)
Artifact size: 365.75 MiB -> 365.77 MiB (0.01%)

@craterbot
Copy link
Collaborator

🎉 Experiment pr-138915 is completed!
📊 6 regressed and 2 fixed (603651 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 26, 2025
@compiler-errors
Copy link
Member Author

All failures unrelated (including https://crater-reports.s3.amazonaws.com/pr-138915/try%23b2fb67b8b6007ced9ad3f3b752a6fec899e7859c/gh/WillPapper.zkvm-uuid-generation/log.txt which is a regular on crater failures. I think it's using GCE lol.)

@compiler-errors compiler-errors marked this pull request as ready for review March 26, 2025 00:53
@lcnr
Copy link
Contributor

lcnr commented Mar 26, 2025

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Mar 26, 2025

📌 Commit 93b3be3 has been approved by lcnr

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

bors commented Mar 27, 2025

⌛ Testing commit 93b3be3 with merge ea1da92...

@bors
Copy link
Collaborator

bors commented Mar 27, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing ea1da92 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 27, 2025
@bors bors merged commit ea1da92 into rust-lang:master Mar 27, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 27, 2025
Copy link

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 2216f26 (parent) -> ea1da92 (this PR)

Test differences

Show 32933 test diffs

Stage 1

  • array::iterator_len: [missing] -> pass (J0)
  • backtrace::tests::test_debug: [missing] -> pass (J0)
  • cell::refcell_replace_borrows: [missing] -> pass (J0)
  • collections::btree::map::tests::test_extract_if::height_0_removing_all: [missing] -> pass (J0)
  • collections::btree::map::tests::test_into_keys: [missing] -> pass (J0)
  • ffi::os_str::tests::into_rc: [missing] -> pass (J0)
  • intrinsics::test_hints_in_const_contexts: [missing] -> pass (J0)
  • io::error::tests::test_std_io_error_downcast: [missing] -> pass (J0)
  • io::tests::chain_splitted_char: [missing] -> pass (J0)
  • iter::adapters::zip::test_zip_map_rev_sideffectful: [missing] -> pass (J0)
  • mpsc::shared_chan_stress: [missing] -> pass (J0)
  • mpsc_sync::stress: [missing] -> pass (J0)
  • num::bignum::test_mul_digits_overflow_1: [missing] -> pass (J0)
  • num::dec2flt::decimal::check_fast_path_f32: [missing] -> pass (J0)
  • num::i16::test_midpoint: [missing] -> pass (J0)
  • num::i32::test_unbounded_shl: [missing] -> pass (J0)
  • once_lock::partialeq_impl: [missing] -> pass (J0)
  • ops::test_range: [missing] -> pass (J0)
  • ptr::test_ptr_subtraction: [missing] -> pass (J0)
  • sort::tests::unstable::correct_i32_pipe_organ: [missing] -> pass (J0)
  • str::test_cow_from: [missing] -> pass (J0)
  • str::test_iterator_last: [missing] -> pass (J0)
  • str::test_replace_2c: [missing] -> pass (J0)
  • string::test_str_truncate_split_codepoint: [missing] -> pass (J0)
  • thread::tests::test_park_timeout_unpark_not_called: [missing] -> pass (J0)
  • time::debug_formatting_extreme_values: [missing] -> pass (J0)
  • time::millis: [missing] -> pass (J0)
  • vec::test_into_iter_as_mut_slice: [missing] -> pass (J0)
  • vec_deque::test_rev_iter: [missing] -> pass (J0)
  • ascii::long::case00_alloc_only: [missing] -> pass (J1)
  • fs::tests::concurrent_recursive_mkdir: [missing] -> pass (J1)
  • hash::map::hashmap_as_queue: [missing] -> pass (J1)
  • net::tcp::tests::shutdown_smoke: [missing] -> pass (J1)
  • slice::sort_unstable_small_ascending: [missing] -> pass (J1)
  • sort::tests::stable::self_cmp_string_saw_mixed: [missing] -> pass (J1)
  • sort::tests::unstable::correct_1k_ascending: [missing] -> pass (J1)
  • sort::tests::unstable::deterministic_string_random_d2: [missing] -> pass (J1)
  • str::char_count::emoji_medium::case02_iter_increment: [missing] -> pass (J1)
  • str::splitn_space_char::short_pile_of_poo: [missing] -> pass (J1)
  • vec::bench_clone_from_10_0010_0010: [missing] -> pass (J1)
  • vec::bench_from_iter_0000: [missing] -> pass (J1)
  • error::verify_middle_layout_cycle_13: [missing] -> pass (J2)
  • errors::verify_ast_lowering_coroutine_too_many_parameters_5: [missing] -> pass (J2)
  • errors::verify_ast_passes_out_of_order_params_36: [missing] -> pass (J2)
  • errors::verify_codegen_ssa_visual_studio_not_installed_48: [missing] -> pass (J2)
  • errors::verify_hir_typeck_const_select_must_be_fn_14: [missing] -> pass (J2)
  • errors::verify_incremental_delete_partial_26: [missing] -> pass (J2)
  • errors::verify_mir_build_unsized_pattern_20: [missing] -> pass (J2)
  • errors::verify_passes_export_name_62: [missing] -> pass (J2)
  • errors::verify_privacy_unnameable_types_lint_5: [missing] -> pass (J2)
  • lints::verify_lint_builtin_special_module_name_used_main_39: [missing] -> pass (J2)
  • opaque::tests::test_bool: [missing] -> pass (J2)
  • tests::test_noncopy: [missing] -> pass (J2)
  • sort::tests::stable::correct_u128_descending: [missing] -> ignore (J3)
  • sort::tests::unstable::correct_u64_random_s95: [missing] -> ignore (J3)

Stage 2

  • arc::shared_from_iter_normal: pass -> [missing] (J0)
  • boxed::uninitialized_zero_size_box: pass -> [missing] (J0)
  • clone::test_borrowed_clone: pass -> [missing] (J0)
  • cmp::test_user_defined_eq: pass -> [missing] (J0)
  • collections::btree::map::tests::test_insert_remove_intertwined_ord_chaos: pass -> [missing] (J0)
  • collections::btree::map::tests::test_iter: pass -> [missing] (J0)
  • collections::btree::map::tests::test_iter_entering_root_twice: pass -> [missing] (J0)
  • collections::linked_list::tests::test_drop_panic: pass -> [missing] (J0)
  • collections::vec_deque::tests::test_reserve_exact_panic: pass -> [missing] (J0)
  • f128::test_real_consts: pass -> [missing] (J0)
  • iter::adapters::copied::test_copied: pass -> [missing] (J0)
  • mpsc_sync::oneshot_multi_thread_close_stress: pass -> [missing] (J0)
  • num::bignum::test_mul_pow2: pass -> [missing] (J0)
  • num::i8::test_abs: pass -> [missing] (J0)
  • num::u32::test_is_next_multiple_of: pass -> [missing] (J0)
  • rc::test_array_from_slice: pass -> [missing] (J0)
  • result::test_result_as_deref_mut: pass -> [missing] (J0)
  • rwlock::test_get_mut_poison: pass -> [missing] (J0)
  • str::slice_index::boundary::rangefrom::index_fail: pass -> [missing] (J0)
  • test_uint_to_str_overflow: pass -> [missing] (J0)
  • iter::bench_flat_map_ref_sum: pass -> [missing] (J1)
  • net::tcp::tests::connect_timeout_error: pass -> [missing] (J1)
  • num::int_sqrt::u8_sqrt_random: pass -> [missing] (J1)
  • process::tests::set_current_dir_works: pass -> [missing] (J1)
  • sort::tests::unstable::correct_i32_random_s50: pass -> [missing] (J1)
  • sort::tests::unstable::deterministic_cell_i32_descending: pass -> [missing] (J1)
  • sort::tests::unstable::stability_i32_random_d20: pass -> [missing] (J1)
  • errors::verify_ast_passes_auto_generic_29: pass -> [missing] (J2)
  • errors::verify_ast_passes_negative_bound_with_parenthetical_notation_57: pass -> [missing] (J2)
  • errors::verify_codegen_ssa_forbidden_target_feature_attr_135: pass -> [missing] (J2)
  • errors::verify_codegen_ssa_ignoring_output_36: pass -> [missing] (J2)
  • errors::verify_codegen_ssa_invalid_monomorphization_floating_point_vector_96: pass -> [missing] (J2)
  • errors::verify_expand_proc_macro_derive_tokens_34: pass -> [missing] (J2)
  • errors::verify_passes_break_inside_closure_128: pass -> [missing] (J2)
  • errors::verify_passes_missing_stability_attr_155: pass -> [missing] (J2)
  • errors::verify_session_file_is_not_writeable_25: pass -> [missing] (J2)
  • html::render::write_shared::tests::hack_external_crate_names: pass -> [missing] (J2)
  • interval::tests::insert: pass -> [missing] (J2)
  • leb128::tests::test_i32_leb128: pass -> [missing] (J2)
  • source_map::tests::path_prefix_remapping_reverse: pass -> [missing] (J2)
  • spec::tests::x86_64_pc_windows_gnullvm: pass -> [missing] (J2)
  • sort::tests::stable::correct_string_saw_mixed: ignore -> [missing] (J3)
  • sort::tests::stable::panic_retain_orig_set_i32_ascending: ignore -> [missing] (J3)
  • sort::tests::unstable::deterministic_i32_ascending: ignore -> [missing] (J3)
  • vec::test_try_with_capacity: ignore -> [missing] (J3)

(and 16362 additional test diffs)

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

Job group index

  • J0: aarch64-apple, test-various, x86_64-apple-1, x86_64-gnu-aux
  • J1: aarch64-apple, test-various, x86_64-apple-1
  • J2: aarch64-apple, x86_64-apple-1
  • J3: x86_64-gnu-aux

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ea1da92): 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)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -1.4%, secondary 2.9%)

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)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.4% [-1.4%, -1.4%] 1

Cycles

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

Binary size

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

Bootstrap: 778.377s -> 778.054s (-0.04%)
Artifact size: 365.79 MiB -> 365.80 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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants