Auto merge of #139826 - matthiaskrgr:rollup-0q0qvkd, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #139745 (Avoid unused clones in `Cloned<I>` and `Copied<I>`) - #139757 (opt-dist: use executable-extension for host llvm-profdata) - #139778 (Add test for issue 34834) - #139783 (Use `compiletest-ignore-dir` for bootstrap self-tests) - #139797 (Allow (but don't require) `#[unsafe(naked)]` so that `compiler-builtins` can upgrade to it) - #139799 (Specify `--print info=file` syntax in `--help`) - #139811 (Use `newtype_index!`-generated types more idiomatically) - #139813 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
58c2dd9a54
42 changed files with 353 additions and 173 deletions
|
@ -643,7 +643,7 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
|
|||
) -> GenericArgsRef<'tcx> {
|
||||
struct ReplaceParamAndInferWithPlaceholder<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
idx: u32,
|
||||
idx: ty::BoundVar,
|
||||
}
|
||||
|
||||
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceParamAndInferWithPlaceholder<'tcx> {
|
||||
|
@ -653,19 +653,13 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
|
|||
|
||||
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
|
||||
if let ty::Infer(_) = t.kind() {
|
||||
let idx = {
|
||||
let idx = self.idx;
|
||||
self.idx += 1;
|
||||
idx
|
||||
};
|
||||
let idx = self.idx;
|
||||
self.idx += 1;
|
||||
Ty::new_placeholder(
|
||||
self.tcx,
|
||||
ty::PlaceholderType {
|
||||
universe: ty::UniverseIndex::ROOT,
|
||||
bound: ty::BoundTy {
|
||||
var: ty::BoundVar::from_u32(idx),
|
||||
kind: ty::BoundTyKind::Anon,
|
||||
},
|
||||
bound: ty::BoundTy { var: idx, kind: ty::BoundTyKind::Anon },
|
||||
},
|
||||
)
|
||||
} else {
|
||||
|
@ -675,16 +669,11 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
|
|||
|
||||
fn fold_const(&mut self, c: ty::Const<'tcx>) -> ty::Const<'tcx> {
|
||||
if let ty::ConstKind::Infer(_) = c.kind() {
|
||||
let idx = self.idx;
|
||||
self.idx += 1;
|
||||
ty::Const::new_placeholder(
|
||||
self.tcx,
|
||||
ty::PlaceholderConst {
|
||||
universe: ty::UniverseIndex::ROOT,
|
||||
bound: ty::BoundVar::from_u32({
|
||||
let idx = self.idx;
|
||||
self.idx += 1;
|
||||
idx
|
||||
}),
|
||||
},
|
||||
ty::PlaceholderConst { universe: ty::UniverseIndex::ROOT, bound: idx },
|
||||
)
|
||||
} else {
|
||||
c.super_fold_with(self)
|
||||
|
@ -692,7 +681,7 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
|
|||
}
|
||||
}
|
||||
|
||||
args.fold_with(&mut ReplaceParamAndInferWithPlaceholder { tcx, idx: 0 })
|
||||
args.fold_with(&mut ReplaceParamAndInferWithPlaceholder { tcx, idx: ty::BoundVar::ZERO })
|
||||
}
|
||||
|
||||
/// Normalizes the predicates and checks whether they hold in an empty environment. If this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue