rust/compiler/rustc_middle/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
..
dep_graph Use a dedicated DepKind for the forever-red node. 2022-07-06 23:20:12 +02:00
hir use par_for_each_in in par_body_owners and collect_crate_mono_items 2022-07-19 17:00:51 +08:00
infer Use real opaque type instead of just saying impl Trait 2022-07-26 06:19:58 +00:00
middle codegen: use new {re,de,}allocator annotations in llvm 2022-07-26 09:43:28 -04:00
mir Rollup merge of #97077 - ouz-a:Optimize-backend, r=oli-obk 2022-07-26 07:14:44 +09:00
query passes: improved partial stabilization diagnostic 2022-07-20 14:53:01 +01:00
thir Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr 2022-07-14 19:24:04 +05:30
traits Combine redundant obligation cause codes 2022-07-24 19:35:53 +00:00
ty 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 span: move MultiSpan 2022-04-05 07:01:00 +01:00
arena.rs arena > Rc for query results 2022-07-12 15:27:24 +02:00
lib.rs Stabilize let_chains 2022-07-16 20:17:58 -03:00
lint.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
macros.rs impl TypeVisitable in type traversal macros 2022-07-05 22:25:33 +01:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr 2022-07-14 19:24:04 +05:30