about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorAdrian Taylor <adetaylor@chromium.org>2024-01-09 17:32:32 +0000
committerAdrian Taylor <adetaylor@chromium.org>2024-05-22 14:22:52 +0000
commite62599f8569509e5ebbea407d81f77fd0a9ca01b (patch)
treed7c2112c120008498f57997096647da1b0f71606 /compiler/rustc_pattern_analysis/src
parent8d1958f0d27f2a3393f2d6fde9560356c78b5f60 (diff)
downloadrust-e62599f8569509e5ebbea407d81f77fd0a9ca01b.tar.gz
rust-e62599f8569509e5ebbea407d81f77fd0a9ca01b.zip
Do not elide if there's ambiguity in self lifetime.
This makes a small change as requested in code review, such that if there's
ambiguity in the self lifetime, we avoid lifetime elision entirely instead of
considering using lifetimes from any of the other parameters.

For example,

impl Something {
  fn method(self: &Box<&Self>, something_else: &u32) -> &u32 { ... }
}

in standard Rust would have assumed the return lifetime was that of &Self;
with this PR prior to this commit would have chosen the lifetime of
'something_else', and after this commit would give an error message explaining
that the lifetime is ambiguous.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions