Skip to content

Remove #[legacy_modes] #4714

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

Closed

Conversation

codeblack08
Copy link
Contributor

This is for issue #4710.

@codeblack08
Copy link
Contributor Author

This just removes the declarations. I'm not exactly sure on the process to fix the tests.

@pcwalton
Copy link
Contributor

pcwalton commented Feb 2, 2013

Do the tests still pass?

@codeblack08
Copy link
Contributor Author

No. Multiple tests fail.

A simple example is run-pass/expr-copy. Without legacy_modes, the first call to f moves x and then the second call will fail with "error: use of moved value: x" The premise for the test no longer really holds true. Perhaps a faithful recreation could be:

fn f(arg: A) {
    arg.a = 100;
}

fn g(arg: &mut A) {
    arg.a = 100;
}

struct A { mut a: int }

pub fn main() {
    let mut x = A {a: 10};
    g(&mut x);
    assert x.a == 100;
    x.a = 20;
    f(copy x);
    assert x.a == 20;
}

So, fixing some of the tests require these kinds of semantic changes. I'll take a crack at trying to fix them, if you want, though.

@catamorphism
Copy link
Contributor

@codeblack08 Please try to make the tests pass (ask on IRC or here if you need help) and re-submit after that. bors won't merge any commits that cause tests to fail anyway :-)

Closing this for now, please do start another pull request if you have a chance to fix the tests.

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

Successfully merging this pull request may close these issues.

3 participants