rust/tests/ui/methods
Adrian Taylor e75660dad3 Arbitrary self types v2: use Receiver trait
In this new version of Arbitrary Self Types, we no longer use the Deref trait
exclusively when working out which self types are valid. Instead, we follow a
chain of Receiver traits. This enables methods to be called on smart pointer
types which fundamentally cannot support Deref (for instance because they are
wrappers for pointers that don't follow Rust's aliasing rules).

This includes:
* Changes to tests appropriately
* New tests for:
  * The basics of the feature
  * Ensuring lifetime elision works properly
  * Generic Receivers
  * A copy of the method subst test enhanced with Receiver

This is really the heart of the 'arbitrary self types v2' feature, and
is the most critical commit in the current PR.

Subsequent commits are focused on:
* Detecting "shadowing" problems, where a smart pointer type can hide
  methods in the pointee.
* Diagnostics and cleanup.

Naming: in this commit, the "Autoderef" type is modified so that it no
longer solely focuses on the "Deref" trait, but can now consider the
"Receiver" trait instead. Should it be renamed, to something like
"TraitFollower"? This was considered, but rejected, because
* even in the Receiver case, it still considers built-in derefs
* the name Autoderef is short and snappy.
2024-12-11 11:59:12 +00:00
..
auxiliary
issues
assign-to-method.rs
assign-to-method.stderr
call_method_unknown_pointee.rs
call_method_unknown_pointee.stderr
call_method_unknown_referent.rs Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
call_method_unknown_referent.stderr Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
call_method_unknown_referent2.rs Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
disambiguate-associated-function-first-arg.rs
disambiguate-associated-function-first-arg.stderr
disambiguate-multiple-blanket-impl.rs
disambiguate-multiple-blanket-impl.stderr
disambiguate-multiple-impl.rs
disambiguate-multiple-impl.stderr
disambiguate-multiple-trait-2.rs
disambiguate-multiple-trait-2.stderr
disambiguate-multiple-trait.rs
disambiguate-multiple-trait.stderr
dont-ice-on-object-lookup-w-error-region.rs Don't ICE when encountering error regions when confirming object method candidate 2024-07-26 13:18:35 -04:00
dont-ice-on-object-lookup-w-error-region.stderr Don't ICE when encountering error regions when confirming object method candidate 2024-07-26 13:18:35 -04:00
dont-suggest-import-on-deref-err.rs Don't give method suggestions when method probe fails due to bad impl of Deref 2024-09-29 11:57:18 -04:00
dont-suggest-import-on-deref-err.stderr Don't give method suggestions when method probe fails due to bad impl of Deref 2024-09-29 11:57:18 -04:00
field-method-suggestion-using-return-ty.rs
field-method-suggestion-using-return-ty.stderr
filter-relevant-fn-bounds.rs Make sure trait def ids match before zipping args in note_function_argument_obligation 2024-07-15 17:53:22 -04:00
filter-relevant-fn-bounds.stderr Mention type parameter in more cases and don't suggest ~const bound already there 2024-12-07 21:37:13 +00:00
fulfillment-disqualifies-method.rs
inherent-bound-in-probe.rs
inherent-bound-in-probe.stderr
issue-3707.rs
issue-3707.stderr
issue-7950.rs
issue-7950.stderr
issue-19521.rs
issue-19521.stderr
leak-check-disquality.rs
method-ambig-one-trait-unknown-int-type.rs
method-ambig-one-trait-unknown-int-type.stderr
method-ambig-two-traits-cross-crate.rs
method-ambig-two-traits-cross-crate.stderr
method-ambig-two-traits-from-bounds.rs
method-ambig-two-traits-from-bounds.stderr
method-ambig-two-traits-from-impls.rs
method-ambig-two-traits-from-impls.stderr
method-ambig-two-traits-from-impls2.rs
method-ambig-two-traits-from-impls2.stderr
method-ambig-two-traits-with-default-method.rs
method-ambig-two-traits-with-default-method.stderr
method-ambiguity-no-rcvr.rs
method-ambiguity-no-rcvr.stderr
method-argument-inference-associated-type.rs
method-call-err-msg.rs
method-call-err-msg.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
method-call-lifetime-args-fail.rs
method-call-lifetime-args-fail.stderr Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
method-call-lifetime-args-lint-fail.rs
method-call-lifetime-args-lint-fail.stderr
method-call-lifetime-args-lint.rs
method-call-lifetime-args-lint.stderr
method-call-lifetime-args-subst-index.rs
method-call-lifetime-args-unresolved.rs
method-call-lifetime-args-unresolved.stderr
method-call-lifetime-args.rs
method-call-lifetime-args.stderr
method-call-type-binding.rs
method-call-type-binding.stderr
method-deref-to-same-trait-object-with-separate-params.rs
method-deref-to-same-trait-object-with-separate-params.stderr
method-early-bound-lifetimes-on-self.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-lookup-order.rs
method-macro-backtrace.rs
method-macro-backtrace.stderr
method-missing-call.rs
method-missing-call.stderr
method-mut-self-modifies-mut-slice-lvalue.rs
method-normalize-bounds-issue-20604.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-not-found-but-doc-alias.rs
method-not-found-but-doc-alias.stderr
method-not-found-generic-arg-elision.rs
method-not-found-generic-arg-elision.stderr
method-on-ambiguous-numeric-type.rs
method-on-ambiguous-numeric-type.stderr
method-path-in-pattern.rs
method-path-in-pattern.stderr
method-probe-no-guessing-dyn-trait.rs
method-projection.rs
method-recursive-blanket-impl.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-recursive-blanket-impl.stderr tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-resolvable-path-in-pattern.rs
method-resolvable-path-in-pattern.stderr
method-self-arg-1.rs
method-self-arg-1.stderr
method-self-arg-2.rs
method-self-arg-2.stderr
method-self-arg-aux1.rs
method-self-arg-aux2.rs
method-self-arg-trait.rs Update tests for hidden references to mutable static 2024-09-13 14:10:56 +03:00
method-self-arg.rs Update tests for hidden references to mutable static 2024-09-13 14:10:56 +03:00
method-trait-object-with-hrtb.rs
method-two-trait-defer-resolution-1.rs
method-two-trait-defer-resolution-2.rs
method-two-trait-defer-resolution-2.stderr
method-two-traits-distinguished-via-where-clause.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-two-traits-distinguished-via-where-clause.stderr tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
method-where-clause.rs
missing-method-on-type-parameter.rs Do not ICE on non-ADT rcvr type when looking for crate version collision 2024-08-26 13:02:21 -04:00
missing-method-on-type-parameter.stderr Do not ICE on non-ADT rcvr type when looking for crate version collision 2024-08-26 13:02:21 -04:00
opaque_param_in_ufc.rs
probe-error-on-infinite-deref.rs Use Autoderef::silence_errors more liberally throughout diagnostics code 2024-09-12 14:48:01 -04:00
probe-error-on-infinite-deref.stderr Use Autoderef::silence_errors more liberally throughout diagnostics code 2024-09-12 14:48:01 -04:00
probe-for-diagnostic-doesnt-do-extra-work.rs
probe-for-diagnostic-doesnt-do-extra-work.stderr
probe-overflow-due-to-sized-predicate-ordering.rs
receiver-equality.rs Relate receiver invariantly in method probe for Mode::Path 2024-09-16 10:55:07 -04:00
receiver-equality.stderr Relate receiver invariantly in method probe for Mode::Path 2024-09-16 10:55:07 -04:00
self-type-is-sup-no-eq.rs
suggest-convert-ptr-to-ref.rs
suggest-convert-ptr-to-ref.stderr Report the note when specified in diagnostic::on_unimplemented 2024-09-10 23:05:36 +02:00
suggest-method-on-call-for-ambig-receiver.rs
suggest-method-on-call-for-ambig-receiver.stderr
suggest-method-on-call-with-macro-rcvr.rs
suggest-method-on-call-with-macro-rcvr.stderr