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 upRegression in type parameter defaults in types and impls #30123
Comments
bluss
added
the
regression-from-stable-to-nightly
label
Nov 30, 2015
brson
added
regression-from-stable-to-beta
I-nominated
T-compiler
and removed
regression-from-stable-to-nightly
labels
Dec 9, 2015
This comment has been minimized.
This comment has been minimized.
|
This does seem more like a bug fix, but I'm not sure what would have triggered it. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high It's important to decide if this is now doing the correct thing. |
rust-highfive
added
P-high
and removed
I-nominated
labels
Dec 17, 2015
nikomatsakis
self-assigned this
Dec 17, 2015
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
The 2-type-param version was working only by a bug - we have no plans of working around that. |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 do you think you know what fixed it? maybe something in metadata got corrected? |
brson
added
the
relnotes
label
Jan 6, 2016
This comment has been minimized.
This comment has been minimized.
|
I'm trying to bisect to find out what changed, then write a test case. |
This comment has been minimized.
This comment has been minimized.
|
See the issue link ^ I'm not crazy, the issue has now appeared somewhere else too |
This comment has been minimized.
This comment has been minimized.
|
Bisecting is proceeding slowly... |
This comment has been minimized.
This comment has been minimized.
|
My bisection attempt failed. |
This comment has been minimized.
This comment has been minimized.
|
@brson :( if you like, I can try tracing through the relevant code paths with |
This comment has been minimized.
This comment has been minimized.
|
I looked and my guess landed on a metadata change that @arielb1 did, would explain the cross crate only behavior. |
This comment has been minimized.
This comment has been minimized.
|
@bluss seems likely, I agree. On Thu, Jan 14, 2016 at 4:38 PM, bluss notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
|
The commit was db817ce |
This comment has been minimized.
This comment has been minimized.
|
This commit should not have changed anything, but I imagine there is a bug here. |
This comment has been minimized.
This comment has been minimized.
|
@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? |
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
I am still trying to bisect. |
This comment has been minimized.
This comment has been minimized.
|
f5fbefa caused it. |
This comment has been minimized.
This comment has been minimized.
|
cc @arielb1 |
brson
added a commit
to brson/rust
that referenced
this issue
Jan 19, 2016
This comment has been minimized.
This comment has been minimized.
|
I think the culprit is that I added the child_name_bindings.define_type(def, DUMMY_SP, modifiers); |
This comment has been minimized.
This comment has been minimized.
|
That indeed seems to be the change (commenting it out makes things compile again). Could someone who understands |
This comment has been minimized.
This comment has been minimized.
|
I'm going to close this issue then as "not a bug", since we know that commit caused it. |
nikomatsakis
closed this
Jan 21, 2016
rthomas
added a commit
to rthomas/rust
that referenced
this issue
Feb 1, 2016
This comment has been minimized.
This comment has been minimized.
|
@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? |
This comment has been minimized.
This comment has been minimized.
What caused it to fail the first time? |
bluss commentedNov 30, 2015
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
Graphacross crates!This is invalid in current nightly Rust ~1.6, see travis build example; the testcases are in their own crates.