fmt
This commit is contained in:
parent
4eab5c1f7b
commit
f0a52128ee
3 changed files with 20 additions and 21 deletions
|
@ -32,7 +32,7 @@ impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSource<'tcx, N> {
|
||||||
super::ImplSource::TraitAlias(ref d) => write!(f, "{:?}", d),
|
super::ImplSource::TraitAlias(ref d) => write!(f, "{:?}", d),
|
||||||
|
|
||||||
super::ImplSource::TraitUpcasting(ref d) => write!(f, "{:?}", d),
|
super::ImplSource::TraitUpcasting(ref d) => write!(f, "{:?}", d),
|
||||||
|
|
||||||
super::ImplSource::ConstDrop(ref d) => write!(f, "{:?}", d),
|
super::ImplSource::ConstDrop(ref d) => write!(f, "{:?}", d),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1087,26 +1087,25 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
let tcx = self.tcx();
|
let tcx = self.tcx();
|
||||||
// Respect const trait obligations
|
// Respect const trait obligations
|
||||||
if self.is_trait_predicate_const(obligation.predicate.skip_binder()) {
|
if self.is_trait_predicate_const(obligation.predicate.skip_binder()) {
|
||||||
match candidate {
|
match candidate {
|
||||||
// const impl
|
// const impl
|
||||||
ImplCandidate(def_id)
|
ImplCandidate(def_id) if tcx.impl_constness(def_id) == hir::Constness::Const => {}
|
||||||
if tcx.impl_constness(def_id) == hir::Constness::Const => {}
|
// const param
|
||||||
// const param
|
ParamCandidate(ty::ConstnessAnd {
|
||||||
ParamCandidate(ty::ConstnessAnd {
|
constness: ty::BoundConstness::ConstIfConst,
|
||||||
constness: ty::BoundConstness::ConstIfConst,
|
..
|
||||||
..
|
}) => {}
|
||||||
}) => {}
|
// auto trait impl
|
||||||
// auto trait impl
|
AutoImplCandidate(..) => {}
|
||||||
AutoImplCandidate(..) => {}
|
// generator, this will raise error in other places
|
||||||
// generator, this will raise error in other places
|
// or ignore error with const_async_blocks feature
|
||||||
// or ignore error with const_async_blocks feature
|
GeneratorCandidate => {}
|
||||||
GeneratorCandidate => {}
|
ConstDropCandidate => {}
|
||||||
ConstDropCandidate => {}
|
_ => {
|
||||||
_ => {
|
// reject all other types of candidates
|
||||||
// reject all other types of candidates
|
return Err(Unimplemented);
|
||||||
return Err(Unimplemented);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Treat negative impls as unimplemented, and reservation impls as ambiguity.
|
// Treat negative impls as unimplemented, and reservation impls as ambiguity.
|
||||||
if let ImplCandidate(def_id) = candidate {
|
if let ImplCandidate(def_id) = candidate {
|
||||||
|
|
|
@ -20,7 +20,7 @@ const fn check<T: ~const Drop>() {}
|
||||||
|
|
||||||
macro_rules! check_all {
|
macro_rules! check_all {
|
||||||
($($T:ty),*$(,)?) => {$(
|
($($T:ty),*$(,)?) => {$(
|
||||||
const _: () = check::<$T>();
|
const _: () = check::<$T>();
|
||||||
)*};
|
)*};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue