about summary refs log tree commit diff
path: root/src/test/ui/c-variadic/variadic-ffi-1.stderr
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-100/+0
2022-10-23Cleanup message and bless testsJack Huey-1/+1
2022-10-23Enable varargs support for calling conventions other than C or cdeclSoveu-14/+14
This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64).
2022-09-03Shrink suggestion span of argument mismatch errorMichael Goulet-2/+2
2022-06-19Make missing argument placeholder more obvious that it's a placeholderMichael Goulet-4/+4
2022-04-16Implementation for 65853Jack Huey-6/+10
This attempts to bring better error messages to invalid method calls, by applying some heuristics to identify common mistakes. The algorithm is inspired by Levenshtein distance and longest common sub-sequence. In essence, we treat the types of the function, and the types of the arguments you provided as two "words" and compute the edits to get from one to the other. We then modify that algorithm to detect 4 cases: - A function input is missing - An extra argument was provided - The type of an argument is straight up invalid - Two arguments have been swapped - A subset of the arguments have been shuffled (We detect the last two as separate cases so that we can detect two swaps, instead of 4 parameters permuted.) It helps to understand this argument by paying special attention to terminology: "inputs" refers to the inputs being *expected* by the function, and "arguments" refers to what has been provided at the call site. The basic sketch of the algorithm is as follows: - Construct a boolean grid, with a row for each argument, and a column for each input. The cell [i, j] is true if the i'th argument could satisfy the j'th input. - If we find an argument that could satisfy no inputs, provided for an input that can't be satisfied by any other argument, we consider this an "invalid type". - Extra arguments are those that can't satisfy any input, provided for an input that *could* be satisfied by another argument. - Missing inputs are inputs that can't be satisfied by any argument, where the provided argument could satisfy another input - Swapped / Permuted arguments are identified with a cycle detection algorithm. As each issue is found, we remove the relevant inputs / arguments and check for more issues. If we find no issues, we match up any "valid" arguments, and start again. Note that there's a lot of extra complexity: - We try to stay efficient on the happy path, only computing the diagonal until we find a problem, and then filling in the rest of the matrix. - Closure arguments are wrapped in a tuple and need to be unwrapped - We need to resolve closure types after the rest, to allow the most specific type constraints - We need to handle imported C functions that might be variadic in their inputs. I tried to document a lot of this in comments in the code and keep the naming clear.
2021-07-06Replace per-target ABI denylist with an allowlistSimonas Kazlauskas-13/+13
It makes very little sense to maintain denylists of ABIs when, as far as non-generic ABIs are concerned, targets usually only support a small subset of the available ABIs. This has historically been a cause of bugs such as us allowing use of the platform-specific ABIs on x86 targets – these in turn would cause LLVM errors or assertions to fire. Fixes #57182 Sponsored by: standard.ai
2020-10-15ensure arguments are included in count mismatch spanAndy Russell-6/+12
2020-06-04test: ui: skip tests which aren't appropriate for RISC-VTom Eccles-11/+11
2020-02-11On mismatched argument count point at argumentsEsteban Küber-4/+8
2019-11-25Auto merge of #66682 - estebank:fn-type-err, r=davidtwcobors-4/+4
Highlight parts of fn in type errors When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each. Examples: <img width="699" alt="" src="https://user-images.githubusercontent.com/1606434/69487597-ab561600-0e11-11ea-9b4e-d4fd9e91d5dc.png"> <img width="528" alt="" src="https://user-images.githubusercontent.com/1606434/69487207-9033d800-0e0a-11ea-93e3-8c4d002411a5.png"> <img width="468" alt="" src="https://user-images.githubusercontent.com/1606434/69487208-9033d800-0e0a-11ea-92e3-2b2cee120335.png"> <img width="775" alt="" src="https://user-images.githubusercontent.com/1606434/69487209-9033d800-0e0a-11ea-9e68-7f6ed5c8cb08.png">
2019-11-23Highlight parts of fn in type errorsEsteban Küber-4/+4
When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each.
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-2/+6
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-4/+4
2019-09-28rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures.Eduard-Mihai Burtescu-2/+2
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-2/+2
Clone for it.
2019-04-22Continue evaluating after item-type checkingEsteban Küber-2/+75
2019-03-11Update testsVadim Petrochenkov-1/+1
2019-02-27Rename variadic to c_variadicDan Robertson-2/+2
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27Support defining C compatible variadic functionsDan Robertson-0/+9
Add support for defining C compatible variadic functions in unsafe rust with extern "C".