Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3725,10 +3725,10 @@ dependencies = [
"rustc_abi",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr_ir",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_lexer",
"rustc_lint_defs",
"rustc_macros",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc_ast::{Block, BlockCheckMode, Local, LocalKind, Stmt, StmtKind};
use rustc_hir as hir;
use rustc_hir::Target;
use rustc_hir::attrs::target::Target;
use rustc_span::sym;
use smallvec::SmallVec;

Expand Down
14 changes: 8 additions & 6 deletions compiler/rustc_ast_lowering/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::sync::Arc;

use rustc_hir::attrs::lang::LangItem;
use rustc_hir::attrs::target::Target;
use thin_vec::thin_vec;

use crate::LoweringContext;
Expand Down Expand Up @@ -146,7 +148,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
);
let precond = self.expr_call_lang_item_fn_mut(
req_span,
rustc_hir::LangItem::ContractCheckRequires,
LangItem::ContractCheckRequires,
&*arena_vec![self; lowered_req],
);
self.stmt_expr(req.span, precond)
Expand All @@ -165,7 +167,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let lowered_ens = self.lower_expr_mut(&ens);
self.expr_call_lang_item_fn(
ens_span,
rustc_hir::LangItem::ContractBuildCheckEnsures,
LangItem::ContractBuildCheckEnsures,
&*arena_vec![self; lowered_ens],
)
}
Expand Down Expand Up @@ -208,15 +210,15 @@ impl<'hir> LoweringContext<'_, 'hir> {

let postcond_checker = self.arena.alloc(self.expr_enum_variant_lang_item(
postcond_checker.span,
rustc_hir::lang_items::LangItem::OptionSome,
LangItem::OptionSome,
&*arena_vec![self; *postcond_checker],
));
let then_block_stmts = self.block_all(span, stmts, Some(postcond_checker));
let then_block = self.arena.alloc(self.expr_block(&then_block_stmts));

let none_expr = self.arena.alloc(self.expr_enum_variant_lang_item(
postcond_checker.span,
rustc_hir::lang_items::LangItem::OptionNone,
LangItem::OptionNone,
Default::default(),
));
let else_block = self.block_expr(none_expr);
Expand Down Expand Up @@ -326,7 +328,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let cond_fn = self.expr_ident(span, cond_ident, cond_hir_id);
let contract_check = self.expr_call_lang_item_fn_mut(
span,
rustc_hir::LangItem::ContractCheckEnsures,
LangItem::ContractCheckEnsures,
arena_vec![self; *cond_fn, *ret],
);
let contract_check = self.arena.alloc(contract_check);
Expand All @@ -349,7 +351,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
));

let attrs: rustc_ast::AttrVec = thin_vec![self.unreachable_code_attr(span)];
self.lower_attrs(contract_check.hir_id, &attrs, span, rustc_hir::Target::Expression);
self.lower_attrs(contract_check.hir_id, &attrs, span, Target::Expression);

let ret_block = self.block_all(span, arena_vec![self; ret_stmt], Some(contract_check));
self.arena.alloc(self.expr_block(self.arena.alloc(ret_block)))
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_ast_lowering/src/delegation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ use hir::def::Res;
use rustc_abi::ExternAbi;
use rustc_ast as ast;
use rustc_ast::*;
use rustc_hir::attrs::lang::LangItem;
use rustc_hir::def::DefKind;
use rustc_hir::{self as hir, FnDeclFlags};
use rustc_middle::ty::Asyncness;
Expand Down Expand Up @@ -341,8 +342,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
crate::re_lowering::ReloweringChecker::allow_relowering(self, |this| {
this.lower_block_noalloc(HirId::INVALID, block, false)
})
},
_ => self.lower_block_noalloc(HirId::INVALID, block, false)
}
_ => self.lower_block_noalloc(HirId::INVALID, block, false),
};

// Remove node ids for which we overwrote resolution to generated param
Expand Down Expand Up @@ -456,7 +457,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

let expr = self.mk_expr(initializer, span);

let path = self.make_lang_item_qpath(hir::LangItem::FromFn, span, None);
let path = self.make_lang_item_qpath(LangItem::FromFn, span, None);
let path = self.arena.alloc(self.mk_expr(hir::ExprKind::Path(path), span));

let call = hir::ExprKind::Call(path, self.arena.alloc_slice(&[expr]));
Expand Down
Loading
Loading