rust/compiler/rustc_hir_analysis/src
Jacob Pratt 05f22c3614
Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
..
astconv Rollup merge of #122123 - compiler-errors:object-trait-alias-bounds, r=oli-obk 2024-03-07 15:07:09 +01:00
check Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung 2024-03-10 01:23:54 +00:00
coherence Rollup merge of #121840 - oli-obk:freeze, r=dtolnay 2024-03-11 03:47:19 -04:00
collect Rollup merge of #122100 - compiler-errors:better-capture, r=oli-obk 2024-03-08 21:02:00 +01:00
impl_wf_check Use expand_weak_alias_tys when collecting constrained generics params in impls 2024-02-20 17:31:59 +01:00
outlives Auto merge of #120931 - chenyukang:yukang-cleanup-hashmap, r=michaelwoerister 2024-02-15 12:36:37 +00:00
structured_errors Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00
variance Make TAITs capture all higher-ranked lifetimes in scope 2024-03-08 02:10:11 +00:00
autoderef.rs fix ICE for deref coercions with type errors 2024-02-12 14:37:35 +01:00
bounds.rs ~const trait or projection bounds do not imply non-const bounds 2024-01-08 15:01:14 +00:00
check_unused.rs Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint. 2024-01-23 08:09:01 +11:00
collect.rs Auto merge of #121500 - oli-obk:track_errors12, r=petrochenkov 2024-03-08 15:06:36 +00:00
constrained_generic_params.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
errors.rs Rename IntoDiagnostic as Diagnostic. 2024-03-11 09:15:09 +11:00
hir_wf_check.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
impl_wf_check.rs Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
lib.rs Merge collect_mod_item_types query into check_well_formed 2024-03-07 14:26:31 +00:00
structured_errors.rs Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00