-
Notifications
You must be signed in to change notification settings - Fork 707
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
Ignore builtin template when parsing #594
Conversation
This should fix rust-lang#584.
This is not the only crash, apparently. |
Ah, I guess this isn't the right fix... things still bust after this. I guess various places depend on that templates always have definition, and builtin template here breaks everything... |
let inst = TemplateInstantiation::from_ty(&ty, ctx); | ||
let inst = match TemplateInstantiation::from_ty(&ty, ctx) { | ||
Some(inst) => inst, | ||
None => return Err(ParseError::Continue), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more appropriate to return an opaque type here, rather than continue on to who-knows-what that we know isn't quite right.
I'm building clang 4.0 and I'll poke at the test case here. |
If there's a reduced test case for the other issues in the template parameter usage analysis, that would be very helpful to have as well. |
This fixes the test case above. This fails because the cursor we're poking at is a |
What is "this" here? |
The failure that I was hitting when I looked at the same issue, was that we were not getting the specialized template because we couldn't find it from the type declaration, since it's a |
@fitzgen do you think we still want this? I think we do, unless you're working on other failures that happen to fix this too. If you are, please land the test-case along with your work! |
r=me with the previous comment addressed |
about returning an opaque type rather than a parse error |
Rolled this + my review comment into #613 |
Handle when we can't instantiate templates because we can't find a template definition #594 + my review commetn about using opaque types
Handle when we can't instantiate templates because we can't find a template definition #594 + my review commetn about using opaque types
This should fix #584.