Skip to content
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

Issue 4846 multiple lifetime parameters #10153

Conversation

nikomatsakis
Copy link
Contributor

Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for 'self. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes make check.

Fixes #4846

@nikomatsakis
Copy link
Contributor Author

r? @pnkfelix

@nikomatsakis
Copy link
Contributor Author

Also note: I broke things up into logical steps as best I could, but I do not guarantee that each of these steps would build and pass tests on their own.

@nikomatsakis
Copy link
Contributor Author

Main commits are "Generalize AST and ty::Generics..." and "Introduce new variance inference pass..."

@pcwalton
Copy link
Contributor

Hooooly cow. 👍 x 💯

@@ -216,17 +216,15 @@ pub enum RegionVariableOrigin {

// Region variables created for bound regions
// in a function or method that is called
BoundRegionInFnCall(Span, ty::bound_region),
bound_regionInFnCall(Span, ty::BoundRegion),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bizarre renaming. Same for other variants below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, it is bizarre indeed. (perhaps a search+replace that went awry somewhere?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Wed, Oct 30, 2013 at 06:17:47AM -0700, Seo Sanghyeon wrote:

@@ -216,17 +216,15 @@ pub enum RegionVariableOrigin {

 // Region variables created for bound regions
 // in a function or method that is called
  • BoundRegionInFnCall(Span, ty::bound_region),
  • bound_regionInFnCall(Span, ty::BoundRegion),

This is a bizarre renaming. Same for other variants below.

Thanks, search-and-replace gone wrong.

@brson
Copy link
Contributor

brson commented Oct 30, 2013

You're the best, Niko! 🐱

* The `RegionScope` trait controls what happens when the user does
* not specify a region in some location where a region is required
* (e.g., if the user writes `&Foo` as a type rather than `&'a Foo`).
* See the `rscope` module for more details.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find the contents of the rscope module to be all that illuminating with regard to this note.

(Did you intend to add some documentation to the rscope::RegionScope trait? Or perhaps this note is from a previous iteration when rscope.rs was a larger piece of code?)

@nikomatsakis nikomatsakis mentioned this pull request Nov 8, 2013
@pnkfelix
Copy link
Member

pnkfelix commented Nov 8, 2013

Okay, done with the review!

It needs a rebase, but you can mark the rebased version with an r+ from me (assuming you don't need another round of review after rebasing).

used to indicate when anonymous regions (i.e., &T) are permitted
it. This should eventually be merged with the Subst trait.
… old

region-parameterization/variance inference. We now compute variance for
type parameters but do not make use of it (most of the way towards rust-lang#3598).
This code fits better in check because it is checking that the impl
matches the interface. This allows us to avoid the awkward constructions
that lazilly collect traits and so forth. It also permits us to make
use of the results of variance inference.
all the information it has at its disposal. Unfortunately this also
reveals that we need to improve the reporting heuristics further,
as sometimes the errors it chooses to emit seem somewhat mystifying
and are not related to the actual problem.
bors added a commit that referenced this pull request Nov 9, 2013
…-parameters-7, r=pnkfelix

Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`.

Fixes #4846
@bors bors closed this Nov 9, 2013
@dwrensha dwrensha mentioned this pull request Nov 10, 2013
@nikomatsakis nikomatsakis deleted the issue-4846-multiple-lifetime-parameters-7 branch March 30, 2016 16:15
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 12, 2023
trim paths in `default_trait_access`/`clone_on_copy` suggestions

This should help making the suggestions more palatable. Similar to rust-lang#10153.

---

changelog: trim paths in [`default_trait_access`]/[`clone_on_copy`] suggestions
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 12, 2023
trim paths in `box_default`

This might help with rust-lang#10089, though I have not tested that yet. In any event, it keeps the suggestion short and to the point.

---
changelog: Trim paths in [`box_default`] suggestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New syntax for lifetimes
8 participants