Skip to content

Commit

Permalink
fix(utils): remove extra braces to work around a compiler bug
Browse files Browse the repository at this point in the history
This commit implements a work-around for this issue:
<rust-lang/rust#73120>
  • Loading branch information
yvt committed Jun 8, 2020
1 parent 23b3ef4 commit ac461cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/constance/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//!
//! **This module is exempt from the API stability guarantee** unless specified
//! otherwise. It's exposed only because it's needed by macros.
// FIXME: Work-around for `rust-analyzer` denying `false` in generic parameters
#![allow(unused_braces)]
use core::marker::PhantomData;

/// Conditional type
Expand Down Expand Up @@ -33,9 +31,9 @@ pub trait TypeFn {
#[doc(hidden)]
pub struct Conditional<T, F, const B: bool>(PhantomData<(T, F)>);

impl<T, F> TypeFn for Conditional<T, F, { false }> {
impl<T, F> TypeFn for Conditional<T, F, false> {
type Output = F;
}
impl<T, F> TypeFn for Conditional<T, F, { true }> {
impl<T, F> TypeFn for Conditional<T, F, true> {
type Output = T;
}

0 comments on commit ac461cc

Please sign in to comment.