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

librustc: Change @mut Block to @Block. #11058

Closed
wants to merge 228 commits into from
Closed

Conversation

pcwalton
Copy link
Contributor

@pcwalton
Copy link
Contributor Author

Because no .borrow() or .mutate() is used, there can be no dynamic borrow failures in blocks anymore.

@pcwalton
Copy link
Contributor Author

r? @alexcrichton

This is blocked on the POD fix, which I will work on now.

I know this is ugly with all the temporaries. Most of the ugliness here is a workaround for the fact that we don't extend temporary lifetimes to an entire chain of method calls, which is something Niko is working on right now. So I think the temporary problems, are, well, temporary.

@alexcrichton
Copy link
Member

I agree, this is some seriously nasty code with this change. I agree that changing the lifetime of temporaries will improve this immensely, but this is also gonna need some pointer trait enhancements. There's really no question between:

foo.bar.insert(k, v);
foo.bar.borrow_mut().get().insert(k, v);

I don't think we'll ever get back to where we once were, but I would be content with

foo.bar.borrow_mut().insert(k, v);

Which I believe is the direction that we're headed in (smart pointer somehow on the RAII thing returned by borrow_mut. Overall though, you are amazing for doing all this!

This is the last `@mut` in `librustc` that does not depend on libsyntax.
@bors bors closed this Dec 27, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2023
Fix typos

Just a couple misc typos I found

changelog: none
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