]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_parse/lexer/mod.rs
Auto merge of #68827 - ssomers:btree_navigation_revisited, r=Mark-Simulacrum
[rust.git] / src / librustc_parse / lexer / mod.rs
index af56e9d344d2e81733dcaf18cda59520c38ff2fc..66280638a2d4067121bfcc2bc6829e5b84621d40 100644 (file)
@@ -248,8 +248,9 @@ fn cook_lexer_token(&self, token: rustc_lexer::TokenKind, start: BytePos) -> Tok
                                    a future release!",
                             )
                             .note(
-                                "for more information, see issue #42326 \
-                                   <https://github.com/rust-lang/rust/issues/42326>",
+                                "see issue #42326 \
+                                 <https://github.com/rust-lang/rust/issues/42326> \
+                                 for more information",
                             )
                             .emit();
                         None
@@ -326,8 +327,7 @@ fn cook_lexer_literal(
         match kind {
             rustc_lexer::LiteralKind::Char { terminated } => {
                 if !terminated {
-                    self.fatal_span_(start, suffix_start, "unterminated character literal".into())
-                        .raise()
+                    self.fatal_span_(start, suffix_start, "unterminated character literal").raise()
                 }
                 let content_start = start + BytePos(1);
                 let content_end = suffix_start - BytePos(1);
@@ -337,12 +337,8 @@ fn cook_lexer_literal(
             }
             rustc_lexer::LiteralKind::Byte { terminated } => {
                 if !terminated {
-                    self.fatal_span_(
-                        start + BytePos(1),
-                        suffix_start,
-                        "unterminated byte constant".into(),
-                    )
-                    .raise()
+                    self.fatal_span_(start + BytePos(1), suffix_start, "unterminated byte constant")
+                        .raise()
                 }
                 let content_start = start + BytePos(2);
                 let content_end = suffix_start - BytePos(1);
@@ -352,7 +348,7 @@ fn cook_lexer_literal(
             }
             rustc_lexer::LiteralKind::Str { terminated } => {
                 if !terminated {
-                    self.fatal_span_(start, suffix_start, "unterminated double quote string".into())
+                    self.fatal_span_(start, suffix_start, "unterminated double quote string")
                         .raise()
                 }
                 let content_start = start + BytePos(1);
@@ -366,7 +362,7 @@ fn cook_lexer_literal(
                     self.fatal_span_(
                         start + BytePos(1),
                         suffix_start,
-                        "unterminated double quote byte string".into(),
+                        "unterminated double quote byte string",
                     )
                     .raise()
                 }