-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Unable to click into include!
'd sources; possibly spurious need-mut
lint
#14562
Comments
include!
'd sources; possibly spurious need-mut
lint
If you mean not having any ide features in the included file, that's to be expected. Handling those as proper input will require #9403 and even with it, it's not 100% certain we'll be able to support that.
Would be great if you could figure out a repro that causes it if it's not too much work (though I think we don't currently honor the corresponding rustc |
That is for @davidbarsky my r-a doesn't work on buck2 repository, should I run something to generate |
gotcha.
You shouldn't need to—I'd suggest (I'm working on open-sourcing the tool that generates the |
Minimized: fn x() {
let x = &mut 2;
|| *x = 5;
} |
Ah, those are unique immutable borrows https://doc.rust-lang.org/stable/reference/types/closure.html#unique-immutable-borrows-in-captures |
Fix explicit deref problems in closure capture fix the `need-mut` part of #14562 Perhaps surprisingly, it wasn't unique immutable borrow. The code still doesn't emit any of them, and I think those won't happen in edition 2021 (which is currently the only thing implemented), since we always capture `&mut *x` instead of `&mut x`. But I'm not very sure about it.
No, not that—I couldn't enter the file at all, but it seems to be working now. I think that functionality was fixed by #14576.
I've got it open-sourced yesterday here: https://github.com/facebook/buck2/tree/main/integrations/rust-project. There's some fb-specific stuff that lives there at the moment (e.g., locations of the sysroot) which I'll fix today. Since the issues I've raised have been resolved, I'll close this out. |
I'm trying out 14561—it's wonderful to be able to get definitions from protoc-generated code!—but unfortunately, I'm getting a bunch of
need-mut
errors from rust-analyzer at https://github.com/facebook/buck2/blob/f9e261bc956d48f587bfe6777b4de84ec1898bdc/app/buck2_data/src/lib.rs#L161.(this could be a nightly toolchain-related thing or a prost-related thing; I haven't diagnosed this yet). I'm encountered two issues:
include!
'd code. I'm guessing this might be followup work, but it'd be nice!need-mut
might be spurious, sincerustc
is seemingly fine with it.rust-analyzer version: rust-analyzer version: 0.0.0 (901c8a4 2023-04-13)
rustc version: (eg. output of
rustc -V
) rustc 1.69.0-nightly (c8e6a9e8b 2023-01-23) (it's aRUSTC_BOOTSTRAP
. long story.)The text was updated successfully, but these errors were encountered: