aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-02-04 14:07:09 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-02-04 14:07:09 +0000
commit550b17d7cf321c2aebff75d00b1654b55beca53c (patch)
treea7759795877d2d5fef25915997c2679af0cd3e94 /tests
parentb86e87c8885895e5b3fcec021ee65003d64c4cbe (diff)
parent351107d0b143e2c3497bd0f424f0d76bc51df0c0 (diff)
Merge #43
43: Ctx r=matklad a=matklad
Diffstat (limited to 'tests')
-rw-r--r--tests/data/parser/inline/0009_unsafe_auto_trait.rs1
-rw-r--r--tests/data/parser/inline/0009_unsafe_auto_trait.txt13
-rw-r--r--tests/data/parser/inline/0010_unsafe_default_impl.rs1
-rw-r--r--tests/data/parser/inline/0010_unsafe_default_impl.txt13
-rw-r--r--tests/data/parser/inline/0011_unsafe_fn.rs1
-rw-r--r--tests/data/parser/inline/0011_unsafe_fn.txt13
-rw-r--r--tests/data/parser/inline/0012_unsafe_extern_fn.rs1
-rw-r--r--tests/data/parser/inline/0012_unsafe_extern_fn.txt18
-rw-r--r--tests/data/parser/inline/0013_unsafe_block_in_mod.rs1
-rw-r--r--tests/data/parser/inline/0013_unsafe_block_in_mod.txt27
10 files changed, 89 insertions, 0 deletions
diff --git a/tests/data/parser/inline/0009_unsafe_auto_trait.rs b/tests/data/parser/inline/0009_unsafe_auto_trait.rs
new file mode 100644
index 000000000..03d29f324
--- /dev/null
+++ b/tests/data/parser/inline/0009_unsafe_auto_trait.rs
@@ -0,0 +1 @@
unsafe auto trait T {}
diff --git a/tests/data/parser/inline/0009_unsafe_auto_trait.txt b/tests/data/parser/inline/0009_unsafe_auto_trait.txt
new file mode 100644
index 000000000..0a9a1e117
--- /dev/null
+++ b/tests/data/parser/inline/0009_unsafe_auto_trait.txt
@@ -0,0 +1,13 @@
1FILE@[0; 23)
2 TRAIT_ITEM@[0; 23)
3 UNSAFE_KW@[0; 6)
4 WHITESPACE@[6; 7)
5 AUTO_KW@[7; 11)
6 WHITESPACE@[11; 12)
7 TRAIT_KW@[12; 17)
8 WHITESPACE@[17; 18)
9 IDENT@[18; 19) "T"
10 WHITESPACE@[19; 20)
11 L_CURLY@[20; 21)
12 R_CURLY@[21; 22)
13 WHITESPACE@[22; 23)
diff --git a/tests/data/parser/inline/0010_unsafe_default_impl.rs b/tests/data/parser/inline/0010_unsafe_default_impl.rs
new file mode 100644
index 000000000..9cd6c57bd
--- /dev/null
+++ b/tests/data/parser/inline/0010_unsafe_default_impl.rs
@@ -0,0 +1 @@
unsafe default impl Foo {}
diff --git a/tests/data/parser/inline/0010_unsafe_default_impl.txt b/tests/data/parser/inline/0010_unsafe_default_impl.txt
new file mode 100644
index 000000000..7450381cb
--- /dev/null
+++ b/tests/data/parser/inline/0010_unsafe_default_impl.txt
@@ -0,0 +1,13 @@
1FILE@[0; 27)
2 IMPL_ITEM@[0; 27)
3 UNSAFE_KW@[0; 6)
4 WHITESPACE@[6; 7)
5 DEFAULT_KW@[7; 14)
6 WHITESPACE@[14; 15)
7 IMPL_KW@[15; 19)
8 WHITESPACE@[19; 20)
9 IDENT@[20; 23) "Foo"
10 WHITESPACE@[23; 24)
11 L_CURLY@[24; 25)
12 R_CURLY@[25; 26)
13 WHITESPACE@[26; 27)
diff --git a/tests/data/parser/inline/0011_unsafe_fn.rs b/tests/data/parser/inline/0011_unsafe_fn.rs
new file mode 100644
index 000000000..33cfc4cd7
--- /dev/null
+++ b/tests/data/parser/inline/0011_unsafe_fn.rs
@@ -0,0 +1 @@
unsafe fn foo() {}
diff --git a/tests/data/parser/inline/0011_unsafe_fn.txt b/tests/data/parser/inline/0011_unsafe_fn.txt
new file mode 100644
index 000000000..23eca1d65
--- /dev/null
+++ b/tests/data/parser/inline/0011_unsafe_fn.txt
@@ -0,0 +1,13 @@
1FILE@[0; 19)
2 FN_ITEM@[0; 19)
3 UNSAFE_KW@[0; 6)
4 WHITESPACE@[6; 7)
5 FN_KW@[7; 9)
6 WHITESPACE@[9; 10)
7 IDENT@[10; 13) "foo"
8 L_PAREN@[13; 14)
9 R_PAREN@[14; 15)
10 WHITESPACE@[15; 16)
11 L_CURLY@[16; 17)
12 R_CURLY@[17; 18)
13 WHITESPACE@[18; 19)
diff --git a/tests/data/parser/inline/0012_unsafe_extern_fn.rs b/tests/data/parser/inline/0012_unsafe_extern_fn.rs
new file mode 100644
index 000000000..1295c2cd2
--- /dev/null
+++ b/tests/data/parser/inline/0012_unsafe_extern_fn.rs
@@ -0,0 +1 @@
unsafe extern "C" fn foo() {}
diff --git a/tests/data/parser/inline/0012_unsafe_extern_fn.txt b/tests/data/parser/inline/0012_unsafe_extern_fn.txt
new file mode 100644
index 000000000..547cb499d
--- /dev/null
+++ b/tests/data/parser/inline/0012_unsafe_extern_fn.txt
@@ -0,0 +1,18 @@
1FILE@[0; 30)
2 FN_ITEM@[0; 30)
3 UNSAFE_KW@[0; 6)
4 ABI@[6; 18)
5 WHITESPACE@[6; 7)
6 EXTERN_KW@[7; 13)
7 WHITESPACE@[13; 14)
8 STRING@[14; 17)
9 WHITESPACE@[17; 18)
10 FN_KW@[18; 20)
11 WHITESPACE@[20; 21)
12 IDENT@[21; 24) "foo"
13 L_PAREN@[24; 25)
14 R_PAREN@[25; 26)
15 WHITESPACE@[26; 27)
16 L_CURLY@[27; 28)
17 R_CURLY@[28; 29)
18 WHITESPACE@[29; 30)
diff --git a/tests/data/parser/inline/0013_unsafe_block_in_mod.rs b/tests/data/parser/inline/0013_unsafe_block_in_mod.rs
new file mode 100644
index 000000000..26141e904
--- /dev/null
+++ b/tests/data/parser/inline/0013_unsafe_block_in_mod.rs
@@ -0,0 +1 @@
fn foo(){} unsafe { } fn bar(){}
diff --git a/tests/data/parser/inline/0013_unsafe_block_in_mod.txt b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt
new file mode 100644
index 000000000..2e319be73
--- /dev/null
+++ b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt
@@ -0,0 +1,27 @@
1FILE@[0; 33)
2 FN_ITEM@[0; 11)
3 FN_KW@[0; 2)
4 WHITESPACE@[2; 3)
5 IDENT@[3; 6) "foo"
6 L_PAREN@[6; 7)
7 R_PAREN@[7; 8)
8 L_CURLY@[8; 9)
9 R_CURLY@[9; 10)
10 WHITESPACE@[10; 11)
11 UNSAFE_KW@[11; 17)
12 ERROR@[17; 22)
13 err: `expected `trait`, `impl` or `fn``
14 WHITESPACE@[17; 18)
15 L_CURLY@[18; 19)
16 WHITESPACE@[19; 20)
17 R_CURLY@[20; 21)
18 WHITESPACE@[21; 22)
19 FN_ITEM@[22; 33)
20 FN_KW@[22; 24)
21 WHITESPACE@[24; 25)
22 IDENT@[25; 28) "bar"
23 L_PAREN@[28; 29)
24 R_PAREN@[29; 30)
25 L_CURLY@[30; 31)
26 R_CURLY@[31; 32)
27 WHITESPACE@[32; 33)