-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Limit impl_trait_header query to only trait impls #144607
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
Conversation
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue
This comment has been minimized.
This comment has been minimized.
Limit impl_trait_header query to only trait impls
💔 Test failed (CI). Failed jobs:
bors build finished
(web logs, extended logs)try - dist-x86_64-linux
(web logs, extended logs)
c4b4025
to
35dbd1a
Compare
@bors try @rust-timer queue
@camsteffen: 🔑 Insufficient privileges: not in try users
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue
This comment has been minimized.
This comment has been minimized.
Limit impl_trait_header query to only trait impls
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (60b45cb): comparison URL. Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILEDBenchmarking 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 @bors rollup=never ❗ ❗ ❗ ❗ ❗
❗ ❗ ❗ ❗ ❗ Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 469.046s -> 466.887s (-0.46%) |
Y'all think that's funny? 😤
Fixed the rustdoc issues from above.
35dbd1a
to
87f803c
Compare
The job pr-check-2
failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] filetime test:false 0.087
error[E0599]: no method named `expect` found for struct `EarlyBinder` in the current scope
--> src/tools/clippy/clippy_lints/src/derive.rs:244:60
|
244 | let trait_ref = cx.tcx.impl_trait_ref(impl_id).expect("must be a trait implementation");
| ^^^^^^ method not found in `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
error[E0599]: no method named `expect` found for struct `EarlyBinder` in the current scope
--> src/tools/clippy/clippy_lints/src/derive.rs:287:60
|
287 | let trait_ref = cx.tcx.impl_trait_ref(impl_id).expect("must be a trait implementation");
| ^^^^^^ method not found in `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
error[E0308]: mismatched types
--> src/tools/clippy/clippy_lints/src/fallible_impl_from.rs:56:20
|
56 | && let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(item.owner_id)
| ^^^^^^^^^^^^^^^^^^^^ ------------------------------------ this expression has type `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
| |
| expected `EarlyBinder<TyCtxt<'_>, TraitRef<...>>`, found `Option<_>`
|
= note: expected struct `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
found enum `std::option::Option<_>`
error[E0599]: `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
--> src/tools/clippy/clippy_lints/src/from_over_into.rs:80:14
|
79 | && let Some(middle_trait_ref) = cx.tcx.impl_trait_ref(item.owner_id)
| _____________________________________________-
80 | | .map(ty::EarlyBinder::instantiate_identity)
| | -^^^ `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
| |_____________|
|
|
::: /checkout/compiler/rustc_type_ir/src/binder.rs:357:1
|
357 | pub struct EarlyBinder<I: Interner, T> {
| -------------------------------------- doesn't satisfy `_: Iterator`
|
= note: the following trait bounds were not satisfied:
`EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
which is required by `&mut EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
error[E0308]: mismatched types
--> src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs:343:28
|
343 | && let None = cx.tcx.impl_trait_ref(impl_id) // An inherent impl
| ^^^^ ------------------------------ this expression has type `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
| |
| expected `EarlyBinder<TyCtxt<'_>, TraitRef<...>>`, found `Option<_>`
|
= note: expected struct `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
found enum `std::option::Option<_>`
error[E0308]: mismatched types
--> src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs:354:28
|
354 | && let None = cx.tcx.impl_trait_ref(impl_id) // An inherent impl
| ^^^^ ------------------------------ this expression has type `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
| |
| expected `EarlyBinder<TyCtxt<'_>, TraitRef<...>>`, found `Option<_>`
|
= note: expected struct `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
found enum `std::option::Option<_>`
[RUSTC-TIMING] askama_derive test:false 1.996
Checking askama v0.14.0
[RUSTC-TIMING] askama test:false 0.177
error[E0599]: no method named `is_none` found for struct `EarlyBinder` in the current scope
--> src/tools/clippy/clippy_lints/src/methods/implicit_clone.rs:55:111
|
55 | cx.tcx.type_of(impl_did).instantiate_identity().is_slice() && cx.tcx.impl_trait_ref(impl_did).is_none()
| ^^^^^^^ method not found in `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
error[E0599]: no method named `is_none` found for struct `EarlyBinder` in the current scope
--> src/tools/clippy/clippy_lints/src/methods/suspicious_splitn.rs:14:43
|
14 | && cx.tcx.impl_trait_ref(impl_id).is_none()
| ^^^^^^^ method not found in `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
error[E0599]: no method named `is_some` found for struct `EarlyBinder` in the current scope
--> src/tools/clippy/clippy_lints/src/missing_doc.rs:250:43
|
250 | if cx.tcx.impl_trait_ref(cid).is_some() {
| ^^^^^^^ method not found in `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
error[E0599]: `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
--> src/tools/clippy/clippy_lints/src/missing_inline.rs:172:77
|
172 | AssocItemContainer::Impl => cx.tcx.impl_trait_ref(container_id).map(|t| t.skip_binder().def_id),
| ^^^ `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
|
::: /checkout/compiler/rustc_type_ir/src/binder.rs:357:1
|
357 | pub struct EarlyBinder<I: Interner, T> {
| -------------------------------------- doesn't satisfy `_: Iterator`
|
= note: the following trait bounds were not satisfied:
`EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
which is required by `&mut EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
error[E0599]: `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
--> src/tools/clippy/clippy_lints/src/non_canonical_impls.rs:120:69
|
120 | let Some(trait_impl) = cx.tcx.impl_trait_ref(item.owner_id).map(EarlyBinder::skip_binder) else {
| ^^^ `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
|
::: /checkout/compiler/rustc_type_ir/src/binder.rs:357:1
|
357 | pub struct EarlyBinder<I: Interner, T> {
| -------------------------------------- doesn't satisfy `_: Iterator`
|
= note: the following trait bounds were not satisfied:
`EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
which is required by `&mut EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
error[E0308]: mismatched types
--> src/tools/clippy/clippy_lints/src/non_send_fields_in_send_ty.rs:90:20
|
90 | && let Some(ty_trait_ref) = cx.tcx.impl_trait_ref(item.owner_id)
| ^^^^^^^^^^^^^^^^^^ ------------------------------------ this expression has type `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
| |
| expected `EarlyBinder<TyCtxt<'_>, TraitRef<...>>`, found `Option<_>`
|
= note: expected struct `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
found enum `std::option::Option<_>`
error[E0599]: `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
--> src/tools/clippy/clippy_lints/src/only_used_in_recursion.rs:250:26
|
247 | && let Some(trait_ref) = cx
| ______________________________________________-
248 | | .tcx
249 | | .impl_trait_ref(item.owner_id)
250 | | .map(EarlyBinder::instantiate_identity)
| | -^^^ `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>` is not an iterator
| |_________________________|
|
|
::: /checkout/compiler/rustc_type_ir/src/binder.rs:357:1
|
357 | pub struct EarlyBinder<I: Interner, T> {
| -------------------------------------- doesn't satisfy `_: Iterator`
|
= note: the following trait bounds were not satisfied:
`EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
which is required by `&mut EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>: std::iter::Iterator`
error[E0599]: no method named `trait_id_of_impl` found for struct `TyCtxt<'tcx>` in the current scope
--> src/tools/clippy/clippy_lints/src/return_self_not_must_use.rs:119:23
|
119 | && cx.tcx.trait_id_of_impl(impl_def).is_none()
| ^^^^^^^^^^^^^^^^
|
help: there is a method `span_of_impl` with a similar name
|
119 - && cx.tcx.trait_id_of_impl(impl_def).is_none()
119 + && cx.tcx.span_of_impl(impl_def).is_none()
|
error[E0599]: no method named `trait_id_of_impl` found for struct `TyCtxt<'tcx>` in the current scope
--> src/tools/clippy/clippy_lints/src/unused_io_amount.rs:88:44
|
88 | && let Some(trait_id) = cx.tcx.trait_id_of_impl(impl_id)
| ^^^^^^^^^^^^^^^^
|
help: there is a method `span_of_impl` with a similar name
|
88 - && let Some(trait_id) = cx.tcx.trait_id_of_impl(impl_id)
88 + && let Some(trait_id) = cx.tcx.span_of_impl(impl_id)
|
error[E0308]: mismatched types
--> src/tools/clippy/clippy_lints/src/use_self.rs:144:20
|
144 | && let Some(impl_trait_ref) = cx.tcx.impl_trait_ref(impl_id)
| ^^^^^^^^^^^^^^^^^^^^ ------------------------------ this expression has type `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
| |
| expected `EarlyBinder<TyCtxt<'_>, TraitRef<...>>`, found `Option<_>`
|
= note: expected struct `EarlyBinder<TyCtxt<'_>, rustc_middle::infer::canonical::rustc_type_ir::TraitRef<TyCtxt<'_>>>`
found enum `std::option::Option<_>`
Some errors have detailed explanations: E0308, E0599.
Can I get another perf attempt whoever may see this?
@bors try @rust-timer queue
This comment has been minimized.
This comment has been minimized.
Limit impl_trait_header query to only trait impls
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (0a2accc): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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 @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 3.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 469.342s -> 467.493s (-0.39%) |
☔ The latest upstream changes (presumably #144863) made this pull request unmergeable. Please resolve the merge conflicts.
Reminder, once the PR becomes ready for a review, use @rustbot ready
.
Uh oh!
There was an error while loading. Please reload this page.
Changes
impl_trait_header
to panic on inherent impls intstead of returning None. A few downstream functions are split into option and non-option returning functions. This gets rid of a lot of unwraps where we know we have a trait impl, while there are still a lot of cases where the Option is helpful.I think we'll want a perf run? And I will push clippy changes if this garners favor.
Summary of changes to tcx methods:
impl_is_of_trait
(new)impl_trait_header
->impl_trait_header
/impl_opt_trait_header
impl_trait_ref
->impl_trait_ref
/impl_opt_trait_ref
trait_id_of_impl
->impl_trait_id
/impl_opt_trait_id