Annotate input reference tests

This commit is contained in:
Eric Huss 2024-10-30 16:47:47 -07:00
parent 759e07f063
commit 37c3884152
22 changed files with 55 additions and 33 deletions

View File

@ -1,6 +1,8 @@
// (This line has BOM so it's ignored by compiletest for directives)
//
//@ compile-flags: --json=diagnostic-short --error-format=json
//@ reference: input.byte-order-mark
//@ reference: input.crlf
// ignore-tidy-cr
#[path = "json-bom-plus-crlf-multifile-aux.rs"]

View File

@ -1,6 +1,8 @@
// (This line has BOM so it's ignored by compiletest for directives)
//
//@ compile-flags: --json=diagnostic-short --error-format=json
//@ reference: input.byte-order-mark
//@ reference: input.crlf
// ignore-tidy-cr
// For easier verifying, the byte offsets in this file should match those

View File

@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":608,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":598,"byte_end":604,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":608,"byte_end":608,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types: expected `String`, found integer
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":672,"byte_end":673,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":663,"byte_end":669,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":673,"byte_end":673,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types: expected `String`, found integer
"}
{"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":668,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":658,"byte_end":664,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":668,"byte_end":668,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types: expected `String`, found integer
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":732,"byte_end":733,"line_start":20,"line_end":20,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":723,"byte_end":729,"line_start":20,"line_end":20,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":733,"byte_end":733,"line_start":20,"line_end":20,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:20:22: error[E0308]: mismatched types: expected `String`, found integer
"}
{"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":732,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":721,"byte_end":727,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":732,"byte_end":732,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types: expected `String`, found integer
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":796,"byte_end":797,"line_start":24,"line_end":24,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":792,"line_start":23,"line_end":23,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":797,"byte_end":797,"line_start":24,"line_end":24,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:24:1: error[E0308]: mismatched types: expected `String`, found integer
"}
{"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":787,"byte_end":795,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":778,"byte_end":784,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types: expected `String`, found `()`
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":852,"byte_end":860,"line_start":26,"line_end":27,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":843,"byte_end":849,"line_start":26,"line_end":26,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:26:22: error[E0308]: mismatched types: expected `String`, found `()`
"}
{"$message_type":"diagnostic","message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
"}

View File

@ -1,4 +1,5 @@
//@ run-pass
//@ reference: input.crlf
// ignore-tidy-cr
// ignore-tidy-cr (repeated again because of tidy bug)
// license is ignored because tidy can't handle the CRLF here properly.

View File

@ -1,4 +1,6 @@
//@ error-pattern: did not contain valid UTF-8
//@ reference: input.encoding.utf8
//@ reference: input.encoding.invalid
fn foo() {
include!("not-utf8.bin")

View File

@ -1,5 +1,5 @@
error: couldn't read $DIR/not-utf8.bin: stream did not contain valid UTF-8
--> $DIR/not-utf8.rs:4:5
--> $DIR/not-utf8.rs:6:5
|
LL | include!("not-utf8.bin")
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,2 +1,4 @@
#!B //~ expected `[`, found `B`
//@ reference: input.shebang

View File

@ -1,6 +1,7 @@
#!
[allow(unused_variables)]
//@ check-pass
//@ reference: input.shebang.inner-attribute
fn main() {
let x = 5;

View File

@ -1,5 +1,6 @@
#![allow(unused_variables)]
//@ check-pass
//@ reference: input.shebang.inner-attribute
fn main() {
let x = 5;
}

View File

@ -1,6 +1,7 @@
#!/usr/bin/env run-cargo-script
//@ check-pass
//@ reference: input.shebang.inner-attribute
#![allow(unused_variables)]

View File

@ -1,6 +1,7 @@
#!//bin/bash
//@ check-pass
//@ reference: input.shebang
fn main() {
println!("a valid shebang (that is also a rust comment)")
}

View File

@ -1,3 +1,5 @@
#!///bin/bash
[allow(unused_variables)]
//~^ ERROR expected item, found `[`
//@ reference: input.shebang.inner-attribute

View File

@ -1,4 +1,5 @@
#!
//@ check-pass
//@ reference: input.shebang
fn main() {}

View File

@ -1,6 +1,8 @@
// something on the first line for tidy
#!/bin/bash //~ expected `[`, found `/`
//@ reference: input.shebang
fn main() {
println!("ok!");
}

View File

@ -1,5 +1,6 @@
#!
//@ check-pass
//@ reference: input.shebang
// ignore-tidy-end-whitespace
fn main() {}

View File

@ -11,6 +11,7 @@
[allow(unused_variables)]
//@ check-pass
//@ reference: input.shebang.inner-attribute
fn main() {
let x = 5;
}

View File

@ -1,6 +1,7 @@
#!/usr/bin/env run-cargo-script
//@ check-pass
//@ reference: input.shebang
fn main() {
println!("Hello World!");
}

View File

@ -1,5 +1,5 @@
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:1
--> $DIR/utf16-be-without-bom.rs:5:1
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -7,7 +7,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:3
--> $DIR/utf16-be-without-bom.rs:5:3
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -15,7 +15,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:5
--> $DIR/utf16-be-without-bom.rs:5:5
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -23,7 +23,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:7
--> $DIR/utf16-be-without-bom.rs:5:7
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -31,7 +31,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:9
--> $DIR/utf16-be-without-bom.rs:5:9
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -39,7 +39,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:11
--> $DIR/utf16-be-without-bom.rs:5:11
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -47,7 +47,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:13
--> $DIR/utf16-be-without-bom.rs:5:13
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -55,7 +55,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:15
--> $DIR/utf16-be-without-bom.rs:5:15
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -63,7 +63,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:17
--> $DIR/utf16-be-without-bom.rs:5:17
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -71,7 +71,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:19
--> $DIR/utf16-be-without-bom.rs:5:19
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -79,7 +79,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:21
--> $DIR/utf16-be-without-bom.rs:5:21
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -87,7 +87,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:23
--> $DIR/utf16-be-without-bom.rs:5:23
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -95,7 +95,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-be-without-bom.rs:4:25
--> $DIR/utf16-be-without-bom.rs:5:25
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -103,7 +103,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: expected one of `!` or `::`, found `n`
--> $DIR/utf16-be-without-bom.rs:4:4
--> $DIR/utf16-be-without-bom.rs:5:4
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^ expected one of `!` or `::`

View File

@ -1,5 +1,5 @@
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:2
--> $DIR/utf16-le-without-bom.rs:5:2
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -7,7 +7,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:4
--> $DIR/utf16-le-without-bom.rs:5:4
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -15,7 +15,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:6
--> $DIR/utf16-le-without-bom.rs:5:6
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -23,7 +23,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:8
--> $DIR/utf16-le-without-bom.rs:5:8
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -31,7 +31,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:10
--> $DIR/utf16-le-without-bom.rs:5:10
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -39,7 +39,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:12
--> $DIR/utf16-le-without-bom.rs:5:12
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -47,7 +47,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:14
--> $DIR/utf16-le-without-bom.rs:5:14
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -55,7 +55,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:16
--> $DIR/utf16-le-without-bom.rs:5:16
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -63,7 +63,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:18
--> $DIR/utf16-le-without-bom.rs:5:18
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -71,7 +71,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:20
--> $DIR/utf16-le-without-bom.rs:5:20
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -79,7 +79,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:22
--> $DIR/utf16-le-without-bom.rs:5:22
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -87,7 +87,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:4:24
--> $DIR/utf16-le-without-bom.rs:5:24
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^
@ -95,7 +95,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/utf16-le-without-bom.rs:5:1
--> $DIR/utf16-le-without-bom.rs:6:1
|
LL | ␀
| ^
@ -103,7 +103,7 @@ LL | ␀
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: expected one of `!` or `::`, found `n`
--> $DIR/utf16-le-without-bom.rs:4:3
--> $DIR/utf16-le-without-bom.rs:5:3
|
LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
| ^ expected one of `!` or `::`

View File

@ -1,4 +1,5 @@
// This file has utf-8 BOM, it should be compiled normally without error.
//@ run-pass
//@ reference: input.byte-order-mark
pub fn main() {}