-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
internal: Use triomphe::Arc
#14718
internal: Use triomphe::Arc
#14718
Conversation
@@ -78,8 +81,9 @@ impl RawAttrs { | |||
<< AttrId::AST_INDEX_BITS; | |||
it | |||
})) | |||
.collect(), | |||
), | |||
// FIXME: use `Arc::from_iter` when it becomes available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to fix these up.
@@ -334,7 +335,7 @@ pub fn identity(_attr: TokenStream, item: TokenStream) -> TokenStream { | |||
ProcMacro { | |||
name: "identity".into(), | |||
kind: crate::ProcMacroKind::Attr, | |||
expander: Arc::new(IdentityProcMacroExpander), | |||
expander: sync::Arc::new(IdentityProcMacroExpander), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
triomphe::Arc
doesn't support trait objects
5c2e2d9
to
8ae7085
Compare
☔ The latest upstream changes (presumably #11557) made this pull request unmergeable. Please resolve the merge conflicts. |
Nice to see that it mostly just works as a drop-in replacement |
😬 Think we can merge this now? It might tend to bitrot. I can fix the FIXMEs when the next We could also use |
Is 4MB worth this (or, how many megabytes worth it)? I guess it will create a non zero amount of headache in future (importing the wrong arc, or mixing arcs by mistake which ends up in using std's arc half of the places, and some things similar) |
We are forced to use std's Arc by chalk in some places I believe, other than that once we can make use of clippy properly on this repo we can forbid the std one to be used. I think it should be fine then. Also of note regarding memory usage. 4Mb might be more when IDE features have been used, since analysis stats only really tests type inference + body lowering memory usage and not much more. |
And |
hmm, then it would be good enough I think.
Maybe we can measure it by using lsif instead of analysis stats? |
So just 3.73 MB :-(. |
I don't think lsif will test much else, that also just typechecks the project to resolve definitions. |
It also executes hover on everything. Do you mean an specific ide feature, or the general usage within ide (changing files, ...)? |
general usage over time for ide features ye |
@bors r+ |
☀️ Test successful - checks-actions |
Closes #14717