Skip to content

Commit a374dc5

Browse files
author
addie.sh
committed
this is a combination of 500 commits
1 parent 31e4b84 commit a374dc5

79 files changed

Lines changed: 390 additions & 148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
680680
hir::ExprKind::Call(callee, _)
681681
if let &ty::FnDef(_, args) = typeck.node_type(callee.hir_id).kind() =>
682682
{
683-
args
683+
args.no_bound_vars().unwrap()
684684
}
685685
_ => return None,
686686
};

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,8 @@ impl<'tcx> BorrowedContentSource<'tcx> {
985985
ty::FnDef(def_id, args) => {
986986
let trait_id = tcx.trait_of_assoc(def_id)?;
987987

988+
let args = args.no_bound_vars().unwrap();
989+
988990
if tcx.is_lang_item(trait_id, LangItem::Deref)
989991
|| tcx.is_lang_item(trait_id, LangItem::DerefMut)
990992
{

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
647647
hir::ExprKind::Call(callee, _) => {
648648
let ty = typeck_result.node_type_opt(callee.hir_id)?;
649649
let ty::FnDef(fn_def_id, args) = *ty.kind() else { return None };
650-
tcx.predicates_of(fn_def_id).instantiate(tcx, args)
650+
tcx.predicates_of(fn_def_id).instantiate(tcx, args.no_bound_vars().unwrap())
651651
}
652652
hir::ExprKind::MethodCall(..) => {
653653
let (_, method) = typeck_result.type_dependent_def(parent.hir_id)?;

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12411241
typeck_results.node_type_opt(expr.hir_id).as_ref().map(|ty| ty.kind())
12421242
{
12431243
let arg_pos = args.iter().position(|arg| arg.hir_id == closure_id)?;
1244-
Some((*def_id, expr.span, arg_pos, arg_pos, generic_args))
1244+
Some((
1245+
*def_id,
1246+
expr.span,
1247+
arg_pos,
1248+
arg_pos,
1249+
generic_args.no_bound_vars().unwrap(),
1250+
))
12451251
} else {
12461252
None
12471253
}
@@ -1914,7 +1920,7 @@ fn suggest_ampmut<'tcx>(
19141920
let trait_ref = ty::TraitRef::from_assoc(
19151921
tcx,
19161922
tcx.require_lang_item(hir::LangItem::IndexMut, rhs_span),
1917-
method_args,
1923+
method_args.no_bound_vars().unwrap(),
19181924
);
19191925
// The type only implements `Index` but not `IndexMut`, we must not suggest `&mut`.
19201926
if !infcx

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
960960
tcx,
961961
self.infcx.typing_env(self.infcx.param_env),
962962
fn_did,
963-
self.infcx.resolve_vars_if_possible(args),
963+
self.infcx.resolve_vars_if_possible(args.no_bound_vars().unwrap()),
964964
) else {
965965
return;
966966
};

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
18281828
}
18291829

18301830
if let ty::FnDef(def_id, args) = *constant.const_.ty().kind() {
1831+
let args = args.no_bound_vars().unwrap();
18311832
let instantiated_predicates = tcx.predicates_of(def_id).instantiate(tcx, args);
18321833
self.normalize_and_prove_instantiated_predicates(
18331834
def_id,

compiler/rustc_borrowck/src/universal_regions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,9 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
603603
ty::CoroutineClosure(def_id, args) => {
604604
DefiningTy::CoroutineClosure(def_id, args)
605605
}
606-
ty::FnDef(def_id, args) => DefiningTy::FnDef(def_id, args),
606+
ty::FnDef(def_id, args) => {
607+
DefiningTy::FnDef(def_id, args.no_bound_vars().unwrap())
608+
}
607609
_ => span_bug!(
608610
tcx.def_span(self.mir_def),
609611
"expected defining type for `{:?}`: `{:?}`",

compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
421421
fx.tcx,
422422
ty::TypingEnv::fully_monomorphized(),
423423
def_id,
424-
fn_args,
424+
fn_args.no_bound_vars().unwrap(),
425425
source_info.span,
426426
);
427427

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
717717
fx.tcx,
718718
ty::TypingEnv::fully_monomorphized(),
719719
def_id,
720-
args,
720+
args.no_bound_vars().unwrap(),
721721
)
722722
.unwrap(),
723723
);

compiler/rustc_codegen_cranelift/src/inline_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub(crate) fn codegen_inline_asm_terminator<'tcx>(
117117
fx.tcx,
118118
ty::TypingEnv::fully_monomorphized(),
119119
def_id,
120-
args,
120+
args.no_bound_vars().unwrap(),
121121
)
122122
.unwrap();
123123
let symbol = fx.tcx.symbol_name(instance);

0 commit comments

Comments
 (0)