Skip to content

Extract ImplOfTrait in AST/HIR #144386

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

camsteffen
Copy link
Contributor

Several fields of Impl are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.

I also considered the name ImplTrait or TraitImpl but I thought that might be more easily confused with -> impl _. The variable name of_trait works nice since it is unique and you can infer what it means.

@rustbot
Copy link
Collaborator

rustbot commented Jul 24, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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. labels Jul 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 24, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

HIR ty lowering was modified

cc @fmease

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@rust-log-analyzer

This comment has been minimized.

@camsteffen
Copy link
Contributor Author

HIR ty lowering was modified

I don't think that's true fwiw.

@rust-log-analyzer

This comment has been minimized.

@xizheyin
Copy link
Contributor

HIR ty lowering was modified

This means this PR change the code in compiler/rustc_hir_analysis/src/hir_ty_lowering/, e.g. https://github.com/rust-lang/rust/pull/144386/files#diff-ce4273e1e949bf3052de7a08466c4dad785890b24091122954541b615b0ba199

@camsteffen
Copy link
Contributor Author

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 24, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 24, 2025
@rust-log-analyzer

This comment has been minimized.

}

#[derive(Clone, Encodable, Decodable, Debug)]
pub struct ImplOfTrait {
Copy link
Member

@fmease fmease Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find ImplOfTrait (or TraitImpl) to be very misleading since it doesn't represent a full trait impl.

First I thought maybe TraitImplHeader (impl header is pre-existing jargon) but for that it lacks the self_ty and the generics.

I'm currently leaning towards ImplTraitRef (impl trait ref is pre-existing jargon for the trait ref in an impl). It's not 100% technically correct since the "modifiers" belong to the impl not to the ref, so 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find ImplOfTrait (or TraitImpl) to be very misleading since it doesn't represent a full trait impl.

Yeah I see your point, though I feel like this wont cause much confusion in practice.

The first thing I had was

enum ImplKind {
    Inherent(/* self ty */ Ty)
    Trait(ImplOfTrait)
}

...with self_ty repeated in the two variants. But then I decided it's ultimately simpler to not duplicate anything, and then I decided that ImplKind can just be an Option.

Another option could be to have

enum ImplKind {
    Inherent,
    Trait { defaultness, constness, .... } // inline the things
}

...but a problem there is that I can't insert a box. I'm hoping that the box move is a perf win because I removed a box from ItemKind::Impl(noboxhere). Also I like the convenience of being able to bind the of_trait object, but that's minor.

I don't think "trait ref" works because I think that term specifically means the part of the code that references a trait.

TraitImplHeader seems alright to me. (Or maybe ImplTraitHeader? But that kinda sounds like -> impl _.)

@fmease
Copy link
Member

fmease commented Jul 24, 2025

I'll perf this due to the added indirection for impl "modifiers" + extra alloc + size changes.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 24, 2025

⌛ Trying commit c0c102d with merge 513dd2b

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 24, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 24, 2025
@rust-log-analyzer

This comment has been minimized.

@fmease fmease added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Jul 24, 2025
@fmease fmease added T-lang Relevant to the language team and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-clippy Relevant to the Clippy team. labels Jul 24, 2025
@fmease fmease assigned fmease and unassigned SparrowLii Jul 24, 2025
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
     } else {
         0
     };
-    let used_space =
-        last_line_width(&result) + trait_ref_overhead + curly_brace_overhead;
+    let used_space = last_line_width(&result) + trait_ref_overhead + curly_brace_overhead;
     // 1 = space before the type.
     let budget = context.budget(used_space + 1);
     if let Some(self_ty_str) = self_ty.rewrite(context, Shape::legacy(budget, offset)) {
{ "type": "test", "name": "test::self_tests", "event": "failed", "stdout": "Ran 8 self tests.\n\nthread 'test::self_tests' panicked at src/tools/rustfmt/src/test/mod.rs:420:5:\nassertion `left == right` failed: 1 self tests failed\n  left: 1\n right: 0\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
error: inherent impls cannot be negative
##[error] --> tests/source/negative-impl.rs:3:8
  |
3 | impl ! Box < JoinHandle > { }
  |      - ^^^^^^^^^^^^^^^^^^ inherent impl for this type
  |      |
  |      negative because of this

error: inherent impls cannot be negative
##[error] --> tests/source/negative-impl.rs:7:8
  |
7 | impl ! JoinHandle < T : std :: future :: Future < Output > + std :: marker :: Send + std :: marker :: Sync + 'static > + 'static { }
  |      - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inherent impl for this type
  |      |
  |      negative because of this

error: inherent impls cannot be negative
##[error] --> tests/target/negative-impl.rs:3:7
  |
3 | impl !Box<JoinHandle> {}
  |      -^^^^^^^^^^^^^^^ inherent impl for this type
  |      |
  |      negative because of this

error: inherent impls cannot be negative
##[error]  --> tests/target/negative-impl.rs:11:6
   |
11 |       !JoinHandle<T: std::future::Future<Output> + std::marker::Send + std::marker::Sync + 'static>
   |  _____-^
   | |     |
   | |     negative because of this
12 | |         + 'static
   | |_________________^ inherent impl for this type

test test::system_tests ... FAILED
test test::idempotence_tests ... FAILED

failures:

---- test::system_tests stdout ----
2025-07-24T17:12:49.434525Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.443147Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:49.495087Z  WARN rustfmt_nightly::test: Default value One used explicitly for version
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:49.748517Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.798742Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.132009Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.267219Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-07-24T17:12:50.276956Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.366085Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `merge_imports` option is deprecated. Use `imports_granularity="Crate"` instead
2025-07-24T17:12:50.378966Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.383000Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.405935Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:50.498572Z  WARN rustfmt_nightly::test: Default value [] used explicitly for skip_macro_invocations
2025-07-24T17:12:50.508450Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_doc_attributes
2025-07-24T17:12:50.510245Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.515147Z  WARN rustfmt_nightly::test: Default value true used explicitly for match_arm_blocks
2025-07-24T17:12:50.518679Z  WARN rustfmt_nightly::test: Default value true used explicitly for empty_item_single_line
2025-07-24T17:12:50.523836Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_try_shorthand
2025-07-24T17:12:50.531099Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:50.531105Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.537274Z  WARN rustfmt_nightly::test: Default value 50 used explicitly for single_line_let_else_max_width
2025-07-24T17:12:50.541736Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.541741Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_strings
2025-07-24T17:12:50.545316Z  WARN rustfmt_nightly::test: Default value false used explicitly for spaces_around_ranges
2025-07-24T17:12:50.547415Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.554250Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.557830Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.559590Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.561294Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.564823Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.570376Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.570381Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.570384Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.572475Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.572480Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.577733Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.579424Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.582828Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.586274Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.589731Z  WARN rustfmt_nightly::test: Default value false used explicitly for reorder_impl_items
2025-07-24T17:12:50.595239Z  WARN rustfmt_nightly::test: Default value Default used explicitly for use_small_heuristics
2025-07-24T17:12:50.597133Z  WARN rustfmt_nightly::test: Default value 80 used explicitly for comment_width
2025-07-24T17:12:50.598831Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:50.604266Z  WARN rustfmt_nightly::test: Default value AlwaysSameLine used explicitly for control_brace_style
2025-07-24T17:12:50.629737Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_macro_matchers
2025-07-24T17:12:50.634132Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-07-24T17:12:50.640312Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-07-24T17:12:50.644129Z  WARN rustfmt_nightly::test: Default value false used explicitly for force_multiline_blocks
2025-07-24T17:12:50.647902Z  WARN rustfmt_nightly::test: Default value Wide used explicitly for type_punctuation_density
2025-07-24T17:12:50.653300Z  WARN rustfmt_nightly::test: Default value Tall used explicitly for fn_params_layout
2025-07-24T17:12:50.655067Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.658413Z  WARN rustfmt_nightly::test: Default value false used explicitly for hard_tabs
2025-07-24T17:12:50.660069Z  WARN rustfmt_nightly::test: Default value true used explicitly for force_explicit_abi
2025-07-24T17:12:50.663440Z  WARN rustfmt_nightly::test: Default value Never used explicitly for match_arm_leading_pipes
2025-07-24T17:12:50.669042Z  WARN rustfmt_nightly::test: Default value true used explicitly for remove_nested_parens
2025-07-24T17:12:50.672485Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:50.677790Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:50.684721Z  WARN rustfmt_nightly::test: Default value 10 used explicitly for short_array_element_width_threshold
2025-07-24T17:12:50.689953Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_comments
2025-07-24T17:12:50.693087Z  WARN rustfmt_nightly::test: Default value false used explicitly for disable_all_formatting
2025-07-24T17:12:50.694796Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.694804Z  WARN rustfmt_nightly::test: Default value Mixed used explicitly for imports_layout
2025-07-24T17:12:50.698274Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_field_init_shorthand
2025-07-24T17:12:50.703683Z  WARN rustfmt_nightly::test: Default value Vertical used explicitly for trailing_comma
2025-07-24T17:12:50.711057Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-07-24T17:12:50.725901Z  WARN rustfmt_nightly::test: Default value false used explicitly for fn_single_line
2025-07-24T17:12:50.729240Z  WARN rustfmt_nightly::test: Default value false used explicitly for condense_wildcard_suffixes
2025-07-24T17:12:50.732642Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:50.737725Z  WARN rustfmt_nightly::test: Default value false used explicitly for match_block_trailing_comma
2025-07-24T17:12:50.739455Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.739459Z  WARN rustfmt_nightly::test: Default value 4 used explicitly for tab_spaces
2025-07-24T17:12:50.741176Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.742924Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-07-24T17:12:50.744882Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-07-24T17:12:50.748755Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.753778Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.755453Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.765722Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-07-24T17:12:50.774627Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.816872Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.891087Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:50.943313Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.943339Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:50.960966Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.000629Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.005019Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:51.018824Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:51.038241Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.038251Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:51.041295Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:51.175518Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-07-24T17:12:51.241832Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.248275Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for edition
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Ran 615 system tests.

thread '<unnamed>' panicked at src/tools/rustfmt/src/test/mod.rs:189:9:
assertion `left == right` failed: 1 system tests failed
  left: 1
 right: 0

thread 'test::system_tests' panicked at src/tools/rustfmt/src/test/mod.rs:80:10:
Failed to join a test thread: Any { .. }

---- test::idempotence_tests stdout ----
2025-07-24T17:12:49.402743Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.414041Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:49.493624Z  WARN rustfmt_nightly::test: Default value One used explicitly for version
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:49.584720Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_macro_matchers
2025-07-24T17:12:49.587457Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.589980Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.604195Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.606693Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.616185Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.621523Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.638015Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:49.800841Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.826230Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.860117Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:49.875654Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-07-24T17:12:50.141040Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.314718Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-07-24T17:12:50.328937Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.353558Z  WARN rustfmt_nightly::test: Default value Preserve used explicitly for hex_literal_case
2025-07-24T17:12:50.429893Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `merge_imports` option is deprecated. Use `imports_granularity="Crate"` instead
2025-07-24T17:12:50.441805Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.448761Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.473263Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:50.508000Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.576499Z  WARN rustfmt_nightly::test: Default value [] used explicitly for skip_macro_invocations
2025-07-24T17:12:50.585513Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_doc_attributes
2025-07-24T17:12:50.587276Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.591927Z  WARN rustfmt_nightly::test: Default value true used explicitly for match_arm_blocks
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:50.597079Z  WARN rustfmt_nightly::test: Default value true used explicitly for empty_item_single_line
2025-07-24T17:12:50.602195Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_try_shorthand
2025-07-24T17:12:50.603954Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.610932Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:50.610939Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.617288Z  WARN rustfmt_nightly::test: Default value 50 used explicitly for single_line_let_else_max_width
2025-07-24T17:12:50.621707Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.621712Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_strings
2025-07-24T17:12:50.625256Z  WARN rustfmt_nightly::test: Default value false used explicitly for spaces_around_ranges
2025-07-24T17:12:50.627421Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.632933Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.636384Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.638179Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.639893Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.643434Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.648709Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.648715Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.648718Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.650453Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.650457Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.655564Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.657275Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.659028Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.661296Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.664822Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.668279Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.671780Z  WARN rustfmt_nightly::test: Default value false used explicitly for reorder_impl_items
2025-07-24T17:12:50.677406Z  WARN rustfmt_nightly::test: Default value Default used explicitly for use_small_heuristics
2025-07-24T17:12:50.679277Z  WARN rustfmt_nightly::test: Default value 80 used explicitly for comment_width
2025-07-24T17:12:50.680979Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:50.686067Z  WARN rustfmt_nightly::test: Default value AlwaysSameLine used explicitly for control_brace_style
2025-07-24T17:12:50.711551Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_macro_matchers
2025-07-24T17:12:50.716074Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-07-24T17:12:50.722222Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-07-24T17:12:50.725990Z  WARN rustfmt_nightly::test: Default value false used explicitly for force_multiline_blocks
2025-07-24T17:12:50.729722Z  WARN rustfmt_nightly::test: Default value Wide used explicitly for type_punctuation_density
2025-07-24T17:12:50.735107Z  WARN rustfmt_nightly::test: Default value Tall used explicitly for fn_params_layout
2025-07-24T17:12:50.736876Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:50.740151Z  WARN rustfmt_nightly::test: Default value false used explicitly for hard_tabs
2025-07-24T17:12:50.741802Z  WARN rustfmt_nightly::test: Default value true used explicitly for force_explicit_abi
2025-07-24T17:12:50.745087Z  WARN rustfmt_nightly::test: Default value Never used explicitly for match_arm_leading_pipes
2025-07-24T17:12:50.750501Z  WARN rustfmt_nightly::test: Default value true used explicitly for remove_nested_parens
2025-07-24T17:12:50.753887Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:50.759060Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:50.762466Z  WARN rustfmt_nightly::test: Default value true used explicitly for trailing_semicolon
2025-07-24T17:12:50.769425Z  WARN rustfmt_nightly::test: Default value 10 used explicitly for short_array_element_width_threshold
2025-07-24T17:12:50.772916Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:50.776336Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_comments
2025-07-24T17:12:50.779511Z  WARN rustfmt_nightly::test: Default value false used explicitly for disable_all_formatting
2025-07-24T17:12:50.781215Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.782944Z  WARN rustfmt_nightly::test: Default value Mixed used explicitly for imports_layout
2025-07-24T17:12:50.782948Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.784630Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-07-24T17:12:50.784634Z  WARN rustfmt_nightly::test: Default value Mixed used explicitly for imports_layout
2025-07-24T17:12:50.788223Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_field_init_shorthand
2025-07-24T17:12:50.795686Z  WARN rustfmt_nightly::test: Default value Vertical used explicitly for trailing_comma
2025-07-24T17:12:50.797771Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_unformatted
2025-07-24T17:12:50.805641Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-07-24T17:12:50.822026Z  WARN rustfmt_nightly::test: Default value false used explicitly for fn_single_line
2025-07-24T17:12:50.825476Z  WARN rustfmt_nightly::test: Default value false used explicitly for condense_wildcard_suffixes
2025-07-24T17:12:50.829039Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:50.832761Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.832766Z  WARN rustfmt_nightly::test: Default value true used explicitly for combine_control_expr
2025-07-24T17:12:50.835007Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.838997Z  WARN rustfmt_nightly::test: Default value false used explicitly for match_block_trailing_comma
2025-07-24T17:12:50.840764Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.840768Z  WARN rustfmt_nightly::test: Default value 4 used explicitly for tab_spaces
2025-07-24T17:12:50.842538Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:50.844311Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-07-24T17:12:50.846332Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-07-24T17:12:50.850272Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.855394Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.857061Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-07-24T17:12:50.871697Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-07-24T17:12:50.878741Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.912689Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.949673Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:50.984515Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:51.039594Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-07-24T17:12:51.039601Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:51.060631Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-07-24T17:12:51.123961Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.129561Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-07-24T17:12:51.140079Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-07-24T17:12:51.158383Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:51.158391Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.161146Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-07-24T17:12:51.295419Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-07-24T17:12:51.318717Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-07-24T17:12:51.318726Z  WARN rustfmt_nightly::test: Default value false used explicitly for hard_tabs
2025-07-24T17:12:51.318731Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-07-24T17:12:51.318734Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for max_width
2025-07-24T17:12:51.318737Z  WARN rustfmt_nightly::test: Default value 4 used explicitly for tab_spaces
2025-07-24T17:12:51.320894Z  WARN rustfmt_nightly::test: Default value 0 used explicitly for struct_field_align_threshold
2025-07-24T17:12:51.370639Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-07-24T17:12:51.376086Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for edition
2025-07-24T17:12:51.378119Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Ran 848 idempotent tests.

thread '<unnamed>' panicked at src/tools/rustfmt/src/test/mod.rs:369:9:
assertion `left == right` failed: 1 idempotent tests failed
  left: 1

@camsteffen
Copy link
Contributor Author

I'll pause on fixing tests for now.

@bors
Copy link
Collaborator

bors commented Jul 24, 2025

☔ The latest upstream changes (presumably #144398) made this pull request unmergeable. Please resolve the merge conflicts.

@fmease
Copy link
Member

fmease commented Jul 24, 2025

@bors try parent=last

@rust-bors
Copy link

rust-bors bot commented Jul 24, 2025

⌛ Trying commit 2d27737 with merge e071e73

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 24, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 25, 2025

☀️ Try build successful (CI)
Build commit: e071e73 (e071e73523bfcdcab2878dbf652ac8ebb9b9eee4, parent: fc5af1813307d25a84d633f21e2e53c9376eb547)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e071e73): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.7%, -0.1%] 15
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 20
All ❌✅ (primary) -0.4% [-0.7%, -0.1%] 15

Max RSS (memory usage)

Results (primary -0.6%, secondary 0.4%)

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

mean range count
Regressions ❌
(primary)
1.0% [1.0%, 1.0%] 1
Regressions ❌
(secondary)
2.5% [2.0%, 3.1%] 4
Improvements ✅
(primary)
-0.9% [-1.3%, -0.5%] 5
Improvements ✅
(secondary)
-1.3% [-2.7%, -0.9%] 5
All ❌✅ (primary) -0.6% [-1.3%, 1.0%] 6

Cycles

Results (secondary -3.4%)

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

Binary size

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

Bootstrap: 468.258s -> 467.481s (-0.17%)
Artifact size: 374.68 MiB -> 374.72 MiB (0.01%)

@fmease
Copy link
Member

fmease commented Jul 25, 2025

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-144386 created and queued.
🤖 Automatically detected try build e071e73
🔍 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 25, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-144386 is now running

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

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 26, 2025
…only, r=compiler-errors

Limit defaultness query to impl of trait

I separated this out from rust-lang#144386.
rust-timer added a commit that referenced this pull request Jul 26, 2025
Rollup merge of #144448 - camsteffen:defaultness-impl-trait-only, r=compiler-errors

Limit defaultness query to impl of trait

I separated this out from #144386.
@craterbot
Copy link
Collaborator

🎉 Experiment pr-144386 is completed!
📊 7 regressed and 8 fixed (670828 total)
📰 Open the summary 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 Jul 26, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jul 28, 2025
…ompiler-errors

Limit defaultness query to impl of trait

I separated this out from rust-lang/rust#144386.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-lang Relevant to the language team
Projects
None yet
Development

Successfully merging this pull request may close these issues.