Conversation
|
@rust-lang/compiler Does anybody know what |
It's a hack! But it's used. |
|
@petrochenkov Why do we keep the AST around in the token stream though? It seems more correct to use the original TokenStream instead of relying on an lossy AST -> TokenStream transformation |
Who knows. |
|
Ping from triage, @michaelwoerister ! |
| pub fn intern_inlined_body(&self, def_id: DefId, body: Body) -> &'hir Body { | ||
| let mut inlined_bodies = self.inlined_bodies.borrow_mut(); | ||
| if let Some(&b) = inlined_bodies.get(&def_id) { | ||
| debug_assert_eq!(&body, b); |
There was a problem hiding this comment.
How can this condition hold? body is on the stack and b is in the arena. Am I overlooking something?
There was a problem hiding this comment.
This isn't a pointer comparison. This check ensures that we always give the same body for the same def_id to intern_inlined_body.
There was a problem hiding this comment.
Oh, you're right of course :)
|
@Zoxc, looks good to me except for |
|
@bors r+ |
|
📌 Commit 1e3f638 has been approved by |
More thread-safety changes r? @michaelwoerister
|
☀️ Test successful - status-appveyor, status-travis |
r? @michaelwoerister