Skip to content

Commit 3f3a10f

Browse files
committed
nyahggdshjjghsdfhgsf
1 parent 408a086 commit 3f3a10f

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

compiler/rustc_middle/src/ty/consts/kind.rs

+3
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,22 @@ pub struct Unevaluated<'tcx, P = Option<Promoted>> {
2121
}
2222

2323
impl<'tcx> Unevaluated<'tcx> {
24+
#[inline]
2425
pub fn shrink(self) -> Unevaluated<'tcx, ()> {
2526
debug_assert_eq!(self.promoted, None);
2627
Unevaluated { def: self.def, substs: self.substs, promoted: () }
2728
}
2829
}
2930

3031
impl<'tcx> Unevaluated<'tcx, ()> {
32+
#[inline]
3133
pub fn expand(self) -> Unevaluated<'tcx> {
3234
Unevaluated { def: self.def, substs: self.substs, promoted: None }
3335
}
3436
}
3537

3638
impl<'tcx, P: Default> Unevaluated<'tcx, P> {
39+
#[inline]
3740
pub fn new(def: ty::WithOptConstParam<DefId>, substs: SubstsRef<'tcx>) -> Unevaluated<'tcx, P> {
3841
Unevaluated { def, substs, promoted: Default::default() }
3942
}

compiler/rustc_trait_selection/src/traits/wf.rs

-2
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
442442
GenericArgKind::Const(constant) => {
443443
match constant.val {
444444
ty::ConstKind::Unevaluated(uv) => {
445-
assert!(uv.promoted.is_none());
446-
447445
let obligations = self.nominal_obligations(uv.def.did, uv.substs);
448446
self.out.extend(obligations);
449447

compiler/rustc_typeck/src/check/check.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ pub(super) fn check_opaque_for_inheriting_lifetimes<'tcx>(
491491
}
492492

493493
struct ProhibitOpaqueVisitor<'tcx> {
494+
tcx: TyCtxt<'tcx>,
494495
opaque_identity_ty: Ty<'tcx>,
495496
generics: &'tcx ty::Generics,
496-
tcx: TyCtxt<'tcx>,
497497
selftys: Vec<(Span, Option<String>)>,
498498
}
499499

@@ -1471,8 +1471,8 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
14711471
.filter_map(|e| typeck_results.node_type_opt(e.hir_id).map(|t| (e.span, t)))
14721472
.filter(|(_, ty)| !matches!(ty.kind(), ty::Never))
14731473
{
1474-
struct VisitTypes(Vec<DefId>);
1475-
impl<'tcx> ty::fold::TypeVisitor<'tcx> for VisitTypes {
1474+
struct OpaqueTypeCollector(Vec<DefId>);
1475+
impl<'tcx> ty::fold::TypeVisitor<'tcx> for OpaqueTypeCollector {
14761476
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
14771477
match *t.kind() {
14781478
ty::Opaque(def, _) => {
@@ -1483,7 +1483,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
14831483
}
14841484
}
14851485
}
1486-
let mut visitor = VisitTypes(vec![]);
1486+
let mut visitor = OpaqueTypeCollector(vec![]);
14871487
ty.visit_with(&mut visitor);
14881488
for def_id in visitor.0 {
14891489
let ty_span = tcx.def_span(def_id);

src/tools/clippy/clippy_lints/src/escape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn is_non_trait_box(ty: Ty<'_>) -> bool {
5454
struct EscapeDelegate<'a, 'tcx> {
5555
cx: &'a LateContext<'tcx>,
5656
set: HirIdSet,
57-
trait_self_ty: Option<Ty<'a>>,
57+
trait_self_ty: Option<Ty<'tcx>>,
5858
too_large_for_stack: u64,
5959
}
6060

src/tools/clippy/clippy_lints/src/non_copy_const.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,10 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D
188188

189189
let result = cx.tcx.const_eval_resolve(
190190
cx.param_env,
191-
ty::Unevaluated {
192-
def: ty::WithOptConstParam::unknown(def_id),
191+
ty::Unevaluated::new(
192+
ty::WithOptConstParam::unknown(def_id),
193193
substs,
194-
promoted: None,
195-
},
194+
),
196195
None,
197196
);
198197
is_value_unfrozen_raw(cx, result, ty)

src/tools/clippy/clippy_utils/src/consts.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,10 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
413413
.tcx
414414
.const_eval_resolve(
415415
self.param_env,
416-
ty::Unevaluated {
417-
def: ty::WithOptConstParam::unknown(def_id),
416+
ty::Unevaluated::new(
417+
ty::WithOptConstParam::unknown(def_id),
418418
substs,
419-
promoted: None,
420-
},
419+
),
421420
None,
422421
)
423422
.ok()

0 commit comments

Comments
 (0)