Conversation
08ac92d to
1a4e30c
Compare
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
1a4e30c to
0983ccc
Compare
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
0983ccc to
d04a5a6
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
75c316b to
98d51b4
Compare
This comment has been minimized.
This comment has been minimized.
98d51b4 to
f158958
Compare
f158958 to
66dfcf2
Compare
This comment has been minimized.
This comment has been minimized.
|
Now it suggests "did you mean Abi::C" whenever there is a unknown type C... I don't like that. |
|
To the best of my knowledge this won't happen on stable, as the enum variant is obivously unstable, and the import suggestions respect that |
|
|
66dfcf2 to
56233f0
Compare
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
335ffd5 to
b89db14
Compare
- Implement handling of FnPtr TypeKind in const-eval, including: - Unsafety flag (safe vs unsafe fn) - ABI variants (Rust, Named(C), Named(custom)) - Input and output types - Variadic function pointers - Add const-eval tests covering: - Basic Rust fn() pointers - Unsafe fn() pointers - Extern C and custom ABI pointers - Functions with multiple inputs and output types - Variadic functions - Use const TypeId checks to verify correctness of inputs, outputs, and payloads
b89db14 to
7b06fba
Compare
| self.project_field(&variant_place, FieldIdx::ZERO)?; | ||
|
|
||
| // FIXME: handle lifetime bounds | ||
| let skipped_binder = sig.skip_binder(); |
There was a problem hiding this comment.
| let skipped_binder = sig.skip_binder(); | |
| let sig = sig.skip_binder(); |
skipped_binder does not carry information about what the variable contains
|
|
||
| self.write_fn_ptr_type_info( | ||
| fn_ptr_place, | ||
| skipped_binder.output(), |
There was a problem hiding this comment.
just pass in the entire sig and take it apart inside
| fn_header: &FnHeader<TyCtxt<'tcx>>, | ||
| inputs: &[Ty<'tcx>], | ||
| ) -> InterpResult<'tcx> { | ||
| let FnHeader { safety, c_variadic, abi, .. } = fn_header; |
There was a problem hiding this comment.
make it exhaustive and document what we are ignoring and not showing reflection users
| ExternRust, | ||
|
|
||
| /// C-calling convention | ||
| ExternC, |
There was a problem hiding this comment.
😆 is that Extern part for avoiding the weird diagnostic?
This is for #146922.
Const-eval currently lacks full support for function pointer (fn) types. We should implement handling of FnPtr TypeKind, covering safe and unsafe functions, Rust and custom ABIs, input and output types, higher-ranked lifetimes, and variadic functions.