Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bf676f496b44896ce984e56611cfaf545013f459
Choose a base ref
...
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 15ce755ca861bdb7637303f48cd757ec79975160
Choose a head ref
  • 1 commit
  • 8 files changed
  • 1 contributor

Commits on Nov 22, 2023

  1. Ambiguous Self lifetimes: don't elide.

      struct Concrete(u32);
    
      impl Concrete {
          fn m(self: &Box<Self>) -> &u32 {
              &self.0
          }
      }
    
    resulted in a confusing error.
    
      impl Concrete {
          fn n(self: &Box<&Self>) -> &u32 {
              &self.0
          }
      }
    
    resulted in no error or warning, despite apparent ambiguity over the elided
    lifetime.
    
    This commit changes two aspects of the behavior.
    
    Previously, when examining the self type, we considered lifetimes only if they
    were immediately adjacent to Self. We now consider lifetimes anywhere in the
    self type.
    
    Secondly, if more than one lifetime is discovered in the self type, we
    disregard it as a possible lifetime elision candidate.
    
    This is a compatibility break, and in fact has required some changes to tests
    which assumed the earlier behavior.
    
    Fixes #117715
    adetaylor committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    15ce755 View commit details
    Browse the repository at this point in the history
Loading