-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
When not finding assoc fn on type, look for builder fn #117006
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
Sorry for the delay in getting to this, will re-assign to compiler-errors since they've left a review already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after addressing
@@ -408,6 +408,86 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
err.downgrade_to_delayed_bug(); | |||
} | |||
|
|||
if let (ty::Adt(adt_def, _), SelfSource::QPath(_)) = (rcvr_ty.kind(), source) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please pull this out into a method. Also, can you use a let-chain here instead of destructuring a tuple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to use tuple destructuring in favor of let-chains when I want to make sure rustfmt works, particularly in long blocks. I can change it, of course. I personally like let-chains more.
When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return `Self` and mention them to the user. Fix rust-lang#69512.
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
89: Automated pull from upstream `master` r=Dajamante a=github-actions[bot] This PR pulls the following changes from the upstream repository: * rust-lang/rust#117006 * rust-lang/rust#117511 * rust-lang/rust#117641 * rust-lang/rust#117637 * rust-lang/rust#117631 * rust-lang/rust#117516 * rust-lang/rust#117190 * rust-lang/rust#117292 * rust-lang/rust#117603 * rust-lang/rust#116988 * rust-lang/rust#117630 * rust-lang/rust#117615 * rust-lang/rust#117613 * rust-lang/rust#117592 * rust-lang/rust#117578 * rust-lang/rust#117435 * rust-lang/rust#117607 90: bump serde and serde_derive r=tshepang a=Dajamante Trying to get around the failure seen in #86 Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Esteban Küber <esteban@kuber.com.ar> Co-authored-by: SparrowLii <liyuan179@huawei.com> Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de> Co-authored-by: Gurinder Singh <frederick.the.fool@gmail.com> Co-authored-by: Michael Goulet <michael@errs.io> Co-authored-by: Thom Chiovoloni <thom@shift.click> Co-authored-by: klensy <klensy@users.noreply.github.com> Co-authored-by: Jack Huey <31162821+jackh726@users.noreply.github.com> Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com> Co-authored-by: bors <bors@rust-lang.org> Co-authored-by: Sven Marnach <sven@mozilla.com> Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com> Co-authored-by: aissata <aimaiga2@gmail.com>
Finished benchmarking commit (4e0fb98): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 662.627s -> 663.851s (0.18%) |
…stebank Method suggestion code tweaks I was rummaging around the method suggestion code after rust-lang#117006 (comment) and saw a few things to simplify. This is two unrelated commits, both in the same file. Review them separately, if you'd like. r? estebank
Rollup merge of rust-lang#117655 - compiler-errors:method-tweaks, r=estebank Method suggestion code tweaks I was rummaging around the method suggestion code after rust-lang#117006 (comment) and saw a few things to simplify. This is two unrelated commits, both in the same file. Review them separately, if you'd like. r? estebank
Update Rust toolchain from nightly-2023-11-07 to nightly-2023-11-08 without any other source changes. This is an automatically generated pull request. If any of the CI checks fail, manual intervention is required. In such a case, review the changes at https://github.com/rust-lang/rust from rust-lang@189d6c7 up to rust-lang@7adc89b. The log for this commit range is: rust-lang@7adc89b69b Auto merge of rust-lang#117680 - matthiaskrgr:rollup-kgaa4ma, r=matthiaskrgr rust-lang@518fe492f1 Rollup merge of rust-lang#117675 - zmodem:vectorize_h, r=durin42 rust-lang@f6f6fd1d1a Rollup merge of rust-lang#117639 - rustbot:docs-update, r=ehuss rust-lang@f8c67704f2 Rollup merge of rust-lang#117616 - RalfJung:unstable-target-features, r=compiler-errors rust-lang@cd5b5e08fe Rollup merge of rust-lang#115485 - DaniPopes:rustdoc-macro-consts, r=jackh726,fmease rust-lang@118a2deea5 Auto merge of rust-lang#117617 - Urgau:bump-libc-0.2.150, r=Mark-Simulacrum rust-lang@84abf837b8 manually bless a wasm-only test rust-lang@752a6132e5 llvm-wrapper: Remove include of non-existant Vectorize.h rust-lang@9bd71afb90 Auto merge of rust-lang#115904 - notriddle:notriddle/preload-bold, r=GuillaumeGomez rust-lang@187d1afa9d Auto merge of rust-lang#117297 - clubby789:fn-trait-missing-paren, r=TaKO8Ki rust-lang@61a3eea804 Auto merge of rust-lang#117229 - matthewjasper:thir-unsafeck-fixes, r=cjgillot rust-lang@114f1f6838 Auto merge of rust-lang#117610 - compiler-errors:object-hmm, r=aliemjay rust-lang@504f63efb0 Auto merge of rust-lang#117418 - compiler-errors:better_error_body, r=oli-obk rust-lang@4e0fb98a5c Auto merge of rust-lang#117006 - estebank:issue-69512, r=compiler-errors rust-lang@f926031ea5 When not finding assoc fn on type, look for builder fn rust-lang@7b97a5ca84 Auto merge of rust-lang#117511 - gurry:117406-err-packed-structs, r=compiler-errors rust-lang@5a9f07cc97 Build a better MIR body when errors are encountered rust-lang@171d5587ca Don't instantiate the binder twice when assembling object candidate rust-lang@24e14dd8b4 Only check predicates for late-bound non-lifetime vars in object candidate assembly rust-lang@bf65e3bddb Update books rust-lang@868de8e76b Visit patterns in THIR let expressions rust-lang@2b59992736 Add suggestion to THIR unsafe_op_in_unsafe_fn lint rust-lang@2b2c0f9886 Allow tests with rust-rustfix and revisions rust-lang@931692fa13 Recognise thread local statics in THIR unsafeck rust-lang@b85c6835d0 warn when using an unstable feature with -Ctarget-feature rust-lang@15719a8c1d libc: bump dependency to 0.2.150 rust-lang@4b3ece475d Emit explanatory note for move errors in packed struct derives rust-lang@904aceec7d Give a better diagnostic for missing parens in Fn* bounds rust-lang@2b858b7eb8 Format macro const literals with pretty printer rust-lang@2a92981301 rustdoc: stop preloading Source Serif 4 Bold Co-authored-by: celinval <celinval@users.noreply.github.com> Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return
Self
and mention them to the user.Fix #69512.