Conversation
src/libsyntax/print/pprust.rs
Outdated
There was a problem hiding this comment.
This seems a little disturbing. There are 3 instances of this instead of 1, and I'm curious why you forget the writer because it looks like you moved out of s and now you own it?
This seems like a serious problem, and it seems like everything should be expecting &mut Writer instead of ~Writer in order to fix this. Do you know if it's possible to make the transition?
There was a problem hiding this comment.
We didn't move out of s.
I could add lifetime parameters everywhere but I'm not sure if it's possible and it would make the code more ugly. DSTs will fix this (making it possible to cast from any ~Trait to ~Any, where you can downcast as you like) so I'm kind of reluctant to spend a lot of time on something that DSTs will fix. There is also the possibility of fixing this by allowing casts from ~Trait to any trait that is universally implemented (such as ~Any) in the frontend.
There was a problem hiding this comment.
At the very least this needs consolidation into having the unsafety in one location instead of 3. Can you open an issue about making this use &mut Writer instead of ~Writer?
There was a problem hiding this comment.
r=me with the consolidation
There was a problem hiding this comment.
Well, like I said I'd rather keep the ~Writer and fix the problem in the language, because I think we need the ability to convert ~Trait to ~Any for downcasting: this is going to keep biting us.
* Pass `&ExtCtxt` instead of `@ExtCtxt`. * Stop passing duplicate parameters around in `expand`. * Make `ast_fold` methods take `&mut self`. After these, it should be possible to remove the `@mut` boxes from `ExtCtxt` altogether, though #11167 is doing some of that so I'm holding off on that for now. This will probably conflict with that PR, so I'm guessing that one will have to be rebased on top of the other. r? @pcwalton
This removes all `@mut` from `librustc` and `libsyntax`.
it no longer has boxes in it
|
In particular I'd like the tests to be looked at. I did the consolidation you asked before. |
…=Manishearth Don't lint `needless_return` in fns across a macro boundary Fixes rust-lang#11167 changelog: none
No description provided.