Fixed compile errors

This commit is contained in:
Sylvester Hesp 2022-08-29 15:58:07 +02:00 committed by Eduard-Mihai Burtescu
parent 6688926866
commit e1aecffe67
2 changed files with 3 additions and 4 deletions

View File

@ -464,7 +464,7 @@ impl<'tcx> Visitor<'tcx> for CheckSpirvAttrVisitor<'tcx> {
fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
let target = match expr.kind {
hir::ExprKind::Closure(..) => Target::Closure,
hir::ExprKind::Closure { .. } => Target::Closure,
_ => Target::Expression,
};

View File

@ -12,8 +12,7 @@ use rustc_target::abi::{Align, Size};
use std::cell::RefCell;
use std::fmt;
use std::iter;
use std::lazy::SyncLazy;
use std::sync::Mutex;
use std::sync::{LazyLock, Mutex};
/// Spir-v types are represented as simple Words, which are the `result_id` of instructions like
/// `OpTypeInteger`. Sometimes, however, we want to inspect one of these Words and ask questions
@ -403,7 +402,7 @@ pub struct SpirvTypePrinter<'cx, 'tcx> {
/// track of a stack of what types are currently being printed, to not infinitely loop.
/// Unfortunately, unlike `fmt::Display`, we can't easily pass down the "stack" of
/// currently-being-printed types, so we use a global static.
static DEBUG_STACK: SyncLazy<Mutex<Vec<Word>>> = SyncLazy::new(|| Mutex::new(Vec::new()));
static DEBUG_STACK: LazyLock<Mutex<Vec<Word>>> = LazyLock::new(|| Mutex::new(Vec::new()));
impl fmt::Debug for SpirvTypePrinter<'_, '_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {