rustc_const_eval::check_consts

Module ops

Source
Expand description

Concrete error types for all operations which may be invalid in a certain const context.

Structs§

  • A call to a function that is in a trait, or has trait bounds that make it conditionally-const.
  • Coroutine πŸ”’
  • A borrow of a type that contains an UnsafeCell somewhere. The borrow might escape to the final value of the constant, and thus we cannot allow this (for now). We may allow it in the future for static items.
  • This op is for &mut borrows in the trailing expression of a constant which uses the β€œenclosing scopes rule” to leak its locals into anonymous static or const items.
  • FnCallIndirect πŸ”’
    A function call where the callee is a pointer.
  • FnCallNonConst πŸ”’
    A function call where the callee is not marked as const.
  • FnCallUnstable πŸ”’
    A call to an #[unstable] const fn or #[rustc_const_unstable] function.
  • HeapAllocation πŸ”’
  • InlineAsm πŸ”’
  • A call to an intrinsic that is just not const-callable at all.
  • A call to an intrinsic that is just not const-callable at all.
  • LiveDrop πŸ”’
  • PanicNonStr πŸ”’
    A call to a panic() lang item where the first argument is not a &str.
  • RawPtrComparison πŸ”’
    Comparing raw pointers for equality. Not currently intended to ever be allowed, even behind a feature gate: operation depends on allocation base addresses that are not known at compile-time.
  • RawPtrToIntCast πŸ”’
    Casting raw pointer or function pointer to an integer. Not currently intended to ever be allowed, even behind a feature gate: operation depends on allocation base addresses that are not known at compile-time.
  • An access to a thread-local static.

Enums§

Traits§

  • An operation that is not allowed in a const context.