Skip to main content

Module consts

Module consts 

Source

Re-exports§

use rustc_type_ir as ir; 🔒
use crate::ty::TyCtxt; 🔒

Modules§

int 🔒
kind 🔒
lit 🔒
valtree 🔒

Macros§

from_scalar_int_for_x
from_scalar_int_for_x_signed
from_x_for_scalar_int
from_x_for_scalar_int_signed

Structs§

CharTryFromScalarInt
Error returned when a conversion from ScalarInt to char fails.
ConstInt
A type for representing any integer. Only used for printing.
Expr
LitToConstInput
Input argument for tcx.lit_to_const.
ScalarInt
The raw bytes of a simple value.
ValTree
An interned valtree. Use this rather than ValTreeKind, whenever possible.
Value
A type-level constant value.

Enums§

AtomicOrdering
An enum to represent the compiler-side view of intrinsics::AtomicOrdering. This lives here because there’s a method in this file that needs it and it is entirely unclear where else to put this…
ExprKind
SimdAlign
An enum to represent the compiler-side view of intrinsics::simd::SimdAlign.

Traits§

ValTreeKindExt

Functions§

const_lit_matches_ty
Checks whether a literal can be interpreted as a const of the given type.

Type Aliases§

AliasConst
AliasConstKind
Const
ConstKind
ConstToValTreeResult
Ok(Err(ty)) indicates the constant was fine, but the valtree couldn’t be constructed because the value contains something of type ty that is not valtree-compatible. The caller can then show an appropriate error; the query does not have the necessary context to give good user-facing errors for this case.