Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4833ce8

Browse files
BoxyUwUJulianKnodt
authored andcommitted
fmt
1 parent f59b91e commit 4833ce8

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

compiler/rustc_middle/src/ty/abstract_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TrivialTypeTraversalAndLiftImpls! {
3535
pub type BoundAbstractConst<'tcx> = Result<Option<EarlyBinder<ty::Const<'tcx>>>, ErrorGuaranteed>;
3636

3737
impl<'tcx> TyCtxt<'tcx> {
38-
/// Returns a const with substs applied by
38+
/// Returns a const without substs applied
3939
fn bound_abstract_const(self, uv: ty::WithOptConstParam<DefId>) -> BoundAbstractConst<'tcx> {
4040
let ac = if let Some((did, param_did)) = uv.as_const_arg() {
4141
self.thir_abstract_const_of_const_arg((did, param_did))

compiler/rustc_middle/src/ty/relate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ pub fn super_relate_consts<'tcx, R: TypeRelation<'tcx>>(
647647
(ty::ConstKind::Placeholder(p1), ty::ConstKind::Placeholder(p2)) => p1 == p2,
648648
(ty::ConstKind::Value(a_val), ty::ConstKind::Value(b_val)) => a_val == b_val,
649649

650-
(ty::ConstKind::Unevaluated(_au), ty::ConstKind::Unevaluated(_bu))
650+
(ty::ConstKind::Unevaluated(_), ty::ConstKind::Unevaluated(_))
651651
if tcx.features().generic_const_exprs =>
652652
{
653653
if let (Ok(Some(a)), Ok(Some(b))) = (
@@ -681,7 +681,7 @@ pub fn super_relate_consts<'tcx, R: TypeRelation<'tcx>>(
681681
(ty::ConstKind::Expr(ae), ty::ConstKind::Expr(be)) => {
682682
let r = relation;
683683

684-
// FIXME(julianknodt): is it possible to relate two consts which are not identical
684+
// FIXME(generic_const_exprs): is it possible to relate two consts which are not identical
685685
// exprs? Should we care about that?
686686
let expr = match (ae, be) {
687687
(Expr::Binop(a_op, al, ar), Expr::Binop(b_op, bl, br))

compiler/rustc_privacy/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ where
286286
fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> {
287287
self.visit_ty(c.ty())?;
288288
let tcx = self.def_id_visitor.tcx();
289-
if let ty::ConstKind::Unevaluated(uv) = c.kind() &&
290-
let Ok(Some(ct)) = tcx.expand_unevaluated_abstract_const(uv.def, uv.substs) {
289+
if let ty::ConstKind::Unevaluated(uv) = c.kind()
290+
&& let Ok(Some(ct)) = tcx.expand_unevaluated_abstract_const(uv.def, uv.substs)
291+
{
291292
ct.super_visit_with(self)?;
292293
}
293294
ControlFlow::CONTINUE

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn is_const_evaluatable<'tcx>(
7878
// compilation with a useful error.
7979
Err(_) if tcx.sess.is_nightly_build()
8080
&& let Ok(Some(ac)) = tcx.expand_abstract_consts(ct)
81-
&& let ty::ConstKind::Expr(_) = ac.kind() =>
81+
&& let ty::ConstKind::Expr(_) = ac.kind() =>
8282
{
8383
tcx.sess
8484
.struct_span_fatal(

src/test/ui/const-generics/issues/issue-83249.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn foo<T: Foo>(_: [u8; T::N]) -> T {
1515

1616
pub fn bar() {
1717
let _: u8 = foo([0; 1]);
18-
18+
1919
let _ = foo([0; 1]);
2020
//~^ ERROR type annotations needed
2121
}

0 commit comments

Comments
 (0)