Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upast: the id of a ref pattern conflated; has type `T` in some contexts and `&T` in others #18207
Comments
steveklabnik
added
the
I-papercut
label
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix is this issue still valid? |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik IMO it still is an issue. Its something internal to the compiler, but I wouldn't be surprised if it is a source of bugs (either old or new.) |
This comment has been minimized.
This comment has been minimized.
|
This is semi-going-away with MIR, so not particularly important. |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 should we have tags for that sort of "fixed-by-MIR" thing? |
This comment has been minimized.
This comment has been minimized.
|
Hmm I will need to review the MIR RFC ... while I understand that some analyses will be applicable to the MIR (and indeed, some of those will solely apply to MIR then, no more AST inputs), for some reason I assumed that we would still do some amount of type-related computations on the AST form. (Why did I think this? I guess mostly for lints that want type info... Or will those all be ported to operate on MIR somehow? Doesn't sound very linty at that point) |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix still a problem you want fixed? |
brson
added
T-compiler
P-low
labels
Apr 4, 2017
This comment has been minimized.
This comment has been minimized.
|
I don't know enough our current lints to judge if it is still a problem, so I will close. |
pnkfelix commentedOct 21, 2014
While working on my follow-up to #17439 I rediscovered an old problem in our ast representation:
We usually act like you can unambiguously map a
node_idto a single type for that node id. However, if you want to know the type of a pattern like theref xin:then you have a problem: are you trying to find the type of the thing that is being borrowed by the match (i.e.
intin this case)? Or are you trying to find the type ofxitself (&intin this case)?The problem is that there is just one
node_idfor the entireref <id>pattern, even though there are two distinct things that you are potentially trying to match.