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

Oibit2 #19566

Merged
merged 2 commits into from Dec 9, 2014

Conversation

Projects
None yet
5 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Dec 5, 2014

This is a merge of @pcwalton's oibit2 branch

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:oibit2 branch from f662c1b to 4b4e987 Dec 5, 2014

bors added a commit that referenced this pull request Dec 5, 2014

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:oibit2 branch 4 times, most recently from 1175994 to 7ff4604 Dec 5, 2014

bors added a commit that referenced this pull request Dec 6, 2014

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:oibit2 branch from 7ff4604 to a722d17 Dec 6, 2014

bors added a commit that referenced this pull request Dec 6, 2014

@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented Dec 7, 2014

As noted on Reddit, shouldn’t this remove the NoCopy marker?

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:oibit2 branch 4 times, most recently from 40f9853 to ed33f82 Dec 8, 2014

nikomatsakis added some commits Dec 6, 2014

librustc: Make `Copy` opt-in.
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.

A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.

For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.

This breaks code like:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

Change this code to:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    impl Copy for Point2D {}

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

This is the backwards-incompatible part of #13231.

Part of RFC #3.

[breaking-change]
Add a feature opt `opt_out_copy` that allows people to revert to the …
…older

behavior temporarily. This feature will eventually transition to REJECTED.

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:oibit2 branch from ed33f82 to a16f60b Dec 8, 2014

@nikomatsakis

This comment has been minimized.

Copy link
Owner Author

nikomatsakis commented on a16f60b Dec 8, 2014

r+ p=10

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Dec 8, 2014

@SimonSapin eventually, yes. I figure we'll do a cleanup of the marker module separately (this PR is big enough as is...)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented on a16f60b Dec 8, 2014

saw approval from nikomatsakis
at nikomatsakis@a16f60b

This comment has been minimized.

Copy link
Contributor

bors replied Dec 8, 2014

merging nikomatsakis/rust/oibit2 = a16f60b into auto

This comment has been minimized.

Copy link
Contributor

bors replied Dec 8, 2014

nikomatsakis/rust/oibit2 = a16f60b merged ok, testing candidate = e24986c

This comment has been minimized.

bors added a commit that referenced this pull request Dec 8, 2014

@bors bors merged commit a16f60b into rust-lang:master Dec 9, 2014

1 of 2 checks passed

default some tests failed
continuous-integration/travis-ci The Travis CI build passed
Details
@aepsil0n

This comment has been minimized.

Copy link
Contributor

aepsil0n commented Dec 10, 2014

Is it intended that #[deriving(Copy)] works as well? If so, why is it not used here?

@liigo

This comment has been minimized.

Copy link
Contributor

liigo commented Dec 10, 2014

The same question: why use blank impl instead of #[deriving(Copy)]?
2014年12月10日 下午10:52于 "Eduard Bopp" notifications@github.com写道:

Is it intended that #[deriving(Copy)] works as well? If so, why is it not
used here?


Reply to this email directly or view it on GitHub
#19566 (comment).

@nikomatsakis nikomatsakis deleted the nikomatsakis:oibit2 branch Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.