-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Regression in type parameter defaults in types and impls #30123
Comments
This does seem more like a bug fix, but I'm not sure what would have triggered it. |
triage: P-high It's important to decide if this is now doing the correct thing. |
I'm sure it's an acceptable fix, but I think we want issues for all regressions, no matter why they happen. I was mostly amused that there was no way to write a type hinted call of |
The 2-type-param version was working only by a bug - we have no plans of working around that. |
@arielb1 do you think you know what fixed it? maybe something in metadata got corrected? |
I'm trying to bisect to find out what changed, then write a test case. |
See the issue link ^ I'm not crazy, the issue has now appeared somewhere else too 😄 |
Bisecting is proceeding slowly... |
My bisection attempt failed. |
@brson :( if you like, I can try tracing through the relevant code paths with |
I looked and my guess landed on a metadata change that @arielb1 did, would explain the cross crate only behavior. |
@bluss seems likely, I agree. On Thu, Jan 14, 2016 at 4:38 PM, bluss notifications@github.com wrote:
|
The commit was db817ce |
This commit should not have changed anything, but I imagine there is a bug here. |
@nikomatsakis nah that's ok. It's not a huge deal. I did start another bisect though. I'm having a hard time summarizing this change for the release notes. There are a lot of technical pieces here. Can somebody try? |
@arielb1 My guess could have landed totally wrong. Don't know why I tried. You all know this better than me. For example, as the ImageBuffer example shows, type parameter defaults don't have to be involved, which has me a bit confounded. |
I am still trying to bisect. |
f5fbefa caused it. |
cc @arielb1 |
I think the culprit is that I added the child_name_bindings.define_type(def, DUMMY_SP, modifiers); |
That indeed seems to be the change (commenting it out makes things compile again). Could someone who understands |
I'm going to close this issue then as "not a bug", since we know that commit caused it. |
@arielb1 Coming back to this, I remember that you removed some metadata code for saving inherent methods: wouldn't they be picked up by resolve, instead of letting typeck do UFCS resolution? |
What caused it to fail the first time? |
This regression is only visible in cross-crate code; NOTE it's very likely it's due to an actual rustc bug fix.
Here is some playpen code for illustration anyway.
Given a struct with default parameters and two constructor functions:
In Rust 1.4 or later (current stable and current nightly), both must be called like this to compile:
In current stable Rust 1.4, the following compiles if you import
Graph
across crates!This is invalid in current nightly Rust ~1.6, see travis build example; the testcases are in their own crates.
The text was updated successfully, but these errors were encountered: