-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Poor interaction between NLL-borrowck, async, and c_variadic's ...
desugaring (VaListImpl<'_>
)
#125431
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
ReVar
shouldn't occur in note_and_explain_region
...
desugaring (VaListImpl<'_>
)
...
desugaring (VaListImpl<'_>
)...
desugaring (VaListImpl<'_>
)
I can't reproduce the abort. Playground
The second error is a little weird, but maybe we can close this issue? |
@rustbot labels +AsyncAwait-Triaged As above, we discussed this in the async call. We were a bit unclear about whether this is still an issue or if something else was being reported here. |
The fact that the error is weird is the bug. Also, there's no clear justification why this code shouldn't compile. |
As in we could have an |
No, I mean the fact that there's a varargs argument is why this has a borrowck error. This leaks the implementation details of how we implement varargs. |
I mean, we don't even lint on this program: use std::ffi::{c_char, c_int};
extern "C" {
fn printf(c: *const c_char, ...) -> c_int;
}
fn main() {
let allocated_cstring = c", but it is still UB\n".to_owned();
unsafe { printf(c"this kinda makes sense%s".as_ptr(), allocated_cstring) };
let allocated_repr_rust = vec!["lol what"];
unsafe { printf(c"but this doesn't: %s".as_ptr(), allocated_repr_rust) };
} we don't seem to be too fussed about "makes sense" versus "technically possible" here. (though, this isn't a program that uses |
#124918 made
note_and_explain_region
abort ifReVar
occurred. Fuzzing found a test case that triggers the abort in #124973, having to do with thec_variadic
feature:ReVar
was re-allowed in #125054.@compiler-errors had the following analysis:
The text was updated successfully, but these errors were encountered: