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

Commit f0a5212

Browse files
committed
fmt
1 parent 4eab5c1 commit f0a5212

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

compiler/rustc_middle/src/traits/structural_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSource<'tcx, N> {
3232
super::ImplSource::TraitAlias(ref d) => write!(f, "{:?}", d),
3333

3434
super::ImplSource::TraitUpcasting(ref d) => write!(f, "{:?}", d),
35-
35+
3636
super::ImplSource::ConstDrop(ref d) => write!(f, "{:?}", d),
3737
}
3838
}

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,26 +1087,25 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
10871087
let tcx = self.tcx();
10881088
// Respect const trait obligations
10891089
if self.is_trait_predicate_const(obligation.predicate.skip_binder()) {
1090-
match candidate {
1091-
// const impl
1092-
ImplCandidate(def_id)
1093-
if tcx.impl_constness(def_id) == hir::Constness::Const => {}
1094-
// const param
1095-
ParamCandidate(ty::ConstnessAnd {
1096-
constness: ty::BoundConstness::ConstIfConst,
1097-
..
1098-
}) => {}
1099-
// auto trait impl
1100-
AutoImplCandidate(..) => {}
1101-
// generator, this will raise error in other places
1102-
// or ignore error with const_async_blocks feature
1103-
GeneratorCandidate => {}
1104-
ConstDropCandidate => {}
1105-
_ => {
1106-
// reject all other types of candidates
1107-
return Err(Unimplemented);
1108-
}
1090+
match candidate {
1091+
// const impl
1092+
ImplCandidate(def_id) if tcx.impl_constness(def_id) == hir::Constness::Const => {}
1093+
// const param
1094+
ParamCandidate(ty::ConstnessAnd {
1095+
constness: ty::BoundConstness::ConstIfConst,
1096+
..
1097+
}) => {}
1098+
// auto trait impl
1099+
AutoImplCandidate(..) => {}
1100+
// generator, this will raise error in other places
1101+
// or ignore error with const_async_blocks feature
1102+
GeneratorCandidate => {}
1103+
ConstDropCandidate => {}
1104+
_ => {
1105+
// reject all other types of candidates
1106+
return Err(Unimplemented);
11091107
}
1108+
}
11101109
}
11111110
// Treat negative impls as unimplemented, and reservation impls as ambiguity.
11121111
if let ImplCandidate(def_id) = candidate {

src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const fn check<T: ~const Drop>() {}
2020

2121
macro_rules! check_all {
2222
($($T:ty),*$(,)?) => {$(
23-
const _: () = check::<$T>();
23+
const _: () = check::<$T>();
2424
)*};
2525
}
2626

0 commit comments

Comments
 (0)