diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-09-02 09:02:19 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-09-09 05:21:31 +0000 |
| commit | f0a52128ee2d522e12893637428d88a3287c818e (patch) | |
| tree | 85d3aa41e8f48414795c4779fc2df9036737bf64 /compiler/rustc_trait_selection/src | |
| parent | 4eab5c1f7b672b2d59328e24e05bc191e448d7d9 (diff) | |
| download | rust-f0a52128ee2d522e12893637428d88a3287c818e.tar.gz rust-f0a52128ee2d522e12893637428d88a3287c818e.zip | |
fmt
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 777e4ffc080..987ad4bc31b 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1087,26 +1087,25 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let tcx = self.tcx(); // Respect const trait obligations if self.is_trait_predicate_const(obligation.predicate.skip_binder()) { - match candidate { - // const impl - ImplCandidate(def_id) - if tcx.impl_constness(def_id) == hir::Constness::Const => {} - // const param - ParamCandidate(ty::ConstnessAnd { - constness: ty::BoundConstness::ConstIfConst, - .. - }) => {} - // auto trait impl - AutoImplCandidate(..) => {} - // generator, this will raise error in other places - // or ignore error with const_async_blocks feature - GeneratorCandidate => {} - ConstDropCandidate => {} - _ => { - // reject all other types of candidates - return Err(Unimplemented); - } + match candidate { + // const impl + ImplCandidate(def_id) if tcx.impl_constness(def_id) == hir::Constness::Const => {} + // const param + ParamCandidate(ty::ConstnessAnd { + constness: ty::BoundConstness::ConstIfConst, + .. + }) => {} + // auto trait impl + AutoImplCandidate(..) => {} + // generator, this will raise error in other places + // or ignore error with const_async_blocks feature + GeneratorCandidate => {} + ConstDropCandidate => {} + _ => { + // reject all other types of candidates + return Err(Unimplemented); } + } } // Treat negative impls as unimplemented, and reservation impls as ambiguity. if let ImplCandidate(def_id) = candidate { |
