rust/compiler/rustc_ty_utils/src
Dylan DPC c763ebc72f
Rollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead
Unify `tcx.constness` query and param env constness checks

The checks that we do in the `constness` query seem inconsistent with the checks that we do to determine if an item's param-env is const, so I merged them into the `constness` query and call that from the `param_env` query.

I'm not sure if this totally makes sense -- is there a case where `tcx.param_env()` would return a const param-env for an item whose `tcx.constness()` is `Constness::NotConst`? Because if not, it seems a bit dangerous that these two differ.

Luckily, not many places actually use `tcx.constness()`, and the checks in `tcx.param_env()` seem stricter than the checks in `tcx.constness()` (at least for the types of items we type-check).

Also, due to the way that `tcx.param_env()` is implemented, it _never_ used to return a const param-env for a item coming from a different crate, which also seems dangerous (though also probably not weaponizable currently, because we seldom actually compute the param-env for a non-local item).
2022-10-12 22:13:25 +05:30
..
abi.rs Move utils from rustc_middle to rustc_ty_utils 2022-10-03 09:12:03 -05:00
assoc.rs separate definitions and HIR owners 2022-09-24 23:21:19 +09:00
common_traits.rs Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
consts.rs It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
errors.rs UPDATE - rename SessionSubdiagnostic macro to Subdiagnostic 2022-09-21 11:39:53 -04:00
implied_bounds.rs RPITIT placeholder items 2022-09-09 01:31:44 +00:00
instance.rs Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnr 2022-10-10 13:43:41 +05:30
layout_sanity_check.rs Move utils from rustc_middle to rustc_ty_utils 2022-10-03 09:12:03 -05:00
layout.rs It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
lib.rs Rewrite representability 2022-10-07 09:33:46 -05:00
needs_drop.rs remove the Subst trait, always use EarlyBinder 2022-09-19 11:37:27 +02:00
representability.rs Rewrite representability 2022-10-07 09:33:46 -05:00
ty.rs Rollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead 2022-10-12 22:13:25 +05:30