summary refs log tree commit diff
path: root/tests/ui/c-variadic
AgeCommit message (Collapse)AuthorLines
2024-01-13Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, ↵bors-0/+3
r=Nilstrieb Suggest Upgrading Compiler for Gated Features This PR addresses #117318 I have a few questions: 1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag a. How can I handle the changing message in the tests? 3. Do we want to only show this message when the compiler is old? a. How can we determine when the compiler is old? I'll wait until we figure out the message to bless the tests
2024-01-13Bless testsGeorge-lewis-0/+3
Update tests
2024-01-12allow system abi to be variadicbeepster4096-2/+5
2023-12-12Rollup merge of #117914 - estebank:issue-85843, r=wesleywiserMatthias Krüger-1/+10
On borrow return type, suggest borrowing from arg or owned return type When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-11-24Show number in error message even for one errorNilstrieb-5/+5
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-20Tweak wordingEsteban Küber-1/+1
2023-11-20On borrow return type, suggest borrowing from arg or owned return typeEsteban Küber-1/+10
When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-10-30Fix bad-c-variadic error being emitted multiple timesNicholas Bishop-8/+2
If a function incorrectly contains multiple `...` args, and is also not foreign or `unsafe extern "C"`, only emit the latter error once.
2023-09-14Enable varargs support for AAPCS calling conventionSoveu-2/+5
This is the default calling convention for ARM - it is used for extern "C", therefore it supports varargs.
2023-08-30Test and note unsafe ctor to fn ptr coercionMichael Goulet-2/+0
Also remove a note that I don't consider to be very useful in context.
2023-01-30Mention fn coercion rules (needs to be expanded)Esteban Küber-0/+2
2023-01-15Tweak E0597Esteban Küber-1/+3
CC #99430
2023-01-13Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplettYuki Okushi-10/+7
Stabilize `abi_efiapi` feature Tracking issue: https://github.com/rust-lang/rust/issues/65815 Closes #65815
2023-01-11Stabilize `abi_efiapi` featureNicholas Bishop-10/+7
Tracking issue: https://github.com/rust-lang/rust/issues/65815
2023-01-11Filter impl and where-clause candidates that reference errorsMichael Goulet-21/+3
2023-01-11Move /src/test to /testsAlbert Larsan-0/+637