1
Fork 0
rust/compiler/rustc_const_eval/src
Guillaume Gomez 9e7b7d5e1c
Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, r=oli-obk
Deeply deny fn and raw ptrs in const generics

I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter.

We now reject both of these in the same way:

```
#![feature(adt_const_params)]

#[derive(Eq, PartialEq)]
struct Wrapper();

fn foo<const W: Wrapper>() {}

fn foo2<const F: fn()>() {}
```

This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place.

cc: ``@b-naber`` who introduced that test^
fixes #99641
2022-07-27 17:55:04 +02:00
..
const_eval now we can make scalar_to_ptr a method on Scalar 2022-07-23 10:36:57 -04:00
interpret Rollup merge of #99692 - RalfJung:too-far, r=oli-obk 2022-07-26 14:26:58 +05:30
transform Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, r=oli-obk 2022-07-27 17:55:04 +02:00
util cleanup mir visitor for rustc::pass_by_value 2022-07-01 16:21:21 +02:00
errors.rs Migrate MutDeref, TransientMutBorrow diagnostics 2022-07-08 03:48:10 +00:00
lib.rs Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk 2022-07-17 19:28:01 +00:00
might_permit_raw_init.rs Use constant eval to do strict validity checks 2022-07-14 22:55:17 +01:00