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

[goal] modifying private method in impl should not require users of public methods to recompile #37121

Closed
nikomatsakis opened this issue Oct 12, 2016 · 5 comments

Comments

@nikomatsakis
Copy link
Contributor

One of the goals for the first alpha is that if you change the body of a private, inherent method, it should not cause the callers of public methods to recompile, nor to require type-checking.

Currently, however, it does. There are two reasons for this. Fixing either of these would fix the immediate problem described in this issue. Fixing both would be ideal.

@nikomatsakis
Copy link
Contributor Author

There are test cases checked in that reference this issue with FIXME(#37121) markers (or will be shortly).

@petrochenkov
Copy link
Contributor

petrochenkov commented Oct 12, 2016

Does this goal apply to methods using impl Trait?

struct S;

impl S {
    pub fn public() -> impl Clone {
        S::private()
    }
    fn private() -> impl Clone {
        0u8
    }
}

@steveklabnik
Copy link
Member

One of the goals for the first alpha

To be clear, this is about goals for incremental recompilation?

@nikomatsakis
Copy link
Contributor Author

@petrochenkov

Does this goal apply to methods using impl Trait?

No, clearly not. I didn't mean this in a blanket way ("no possible change!"). But I meant "most of the time."


@steveklabnik

To be clear, this is about goals for incremental recompilation?

right.

@nikomatsakis
Copy link
Contributor Author

@petrochenkov but good point, that'd make a nice test case :)

eddyb added a commit to eddyb/rust that referenced this issue Oct 19, 2016
…=michaelwoerister

add test case for changing private methods

The goal of this test case is to ensure we are getting the reuse we expect. This targets a particular change where we modify the body of a private inherent method defined on a struct, and looks at different ways we can use that struct.

It checks for when type-checking would be needed as well as the actual reuse achieved.

cc rust-lang#37121
r? @michaelwoerister
eddyb added a commit to eddyb/rust that referenced this issue Oct 19, 2016
…=michaelwoerister

add test case for changing private methods

The goal of this test case is to ensure we are getting the reuse we expect. This targets a particular change where we modify the body of a private inherent method defined on a struct, and looks at different ways we can use that struct.

It checks for when type-checking would be needed as well as the actual reuse achieved.

cc rust-lang#37121
r? @michaelwoerister
@nikomatsakis nikomatsakis modified the milestones: Incremental compilation alpha, Launch MIR into Orbit Oct 21, 2016
@bors bors closed this as completed in 34c361c Nov 18, 2016
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

No branches or pull requests

3 participants