-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
~Foo should auto-borrow to &Foo when casting to a trait object #10347
Comments
Turns out ~T won't actually autoborrow to &T when casting to a trait object. See rust-lang/rust#10347 This reverts commit c2a755d.
I feel like this is a dup but can't find the other issue. I agree; this shouldn't be too hard. cc me. |
Dup of #10039. |
I don't think this is a dup of #10039. Auto-borrowing of a |
Agreed, not a dup of that particular issue. |
Due to RFC 37, I don't think that this is as high priority any more, and it should go through the RFC process if so (it's a language change). |
Add new lint no_mangle_with_rust_abi Fixes issue rust-lang#10347 This PR adds a new lint `no_mangle_with_rust_abi` that suggests converting a function to the C ABI to if the function has the `#[no_mangle]` attribute and `Abi == Abi::Rust`. It will not run for any of the other variants defined in [rustc_target::spec::abi::Abi](https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/abi/enum.Abi.html), nor suggest any conversion other than conversion to the C ABI. Functions that explicitly opt into the Rust ABI with `extern "Rust"` are ignored by this lint. --- changelog: [`no_mangle_with_rust_abi`]: add lint that converts Rust ABI functions with the `#[no_mangle]` attribute to C ABI
It'd be nice if this would work:
You currently have to manually borrow
The text was updated successfully, but these errors were encountered: