From b0a8e96d34d5c2041e983375d3238b0f3bc1eb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besnier?= Date: Thu, 26 Nov 2020 08:37:09 +0100 Subject: [PATCH] remove unreachable! in favor of `debug_assert!(false);` --- compiler/fmt/src/annotation.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/fmt/src/annotation.rs b/compiler/fmt/src/annotation.rs index 0244dcae9c..ee01005281 100644 --- a/compiler/fmt/src/annotation.rs +++ b/compiler/fmt/src/annotation.rs @@ -331,10 +331,10 @@ impl<'a> Formattable<'a> for TypeAnnotation<'a> { SpaceAfter(ann, spaces) => { ann.format_with_options(buf, parens, newlines, indent); fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent); - // seems like a lot of spaceAfter are not constructible - // since most of the time we use "SpaceBefore". - // Is this specific case really unreachable? - unreachable!("cannot have space after type annotation"); + // seems like this SpaceAfter is not constructible + // so this branch hasn't be tested. Please add some test if + // this branch is actually reached and remove this dbg_assert. + debug_assert!(false); } Malformed(raw) => buf.push_str(raw),