rust/src/test/ui/unsafe
bors de42550d0a Auto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnay
Get piece unchecked in `write`

We already use specialized `zip`, but it seems like we can do a little better by not checking `pieces` length at all.

`Arguments` constructors are now unsafe. So the `format_args!` expansion now includes an `unsafe` block.

<details>
<summary>Local Bench Diff</summary>

```text
 name                        before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 fmt::write_str_macro1       22,967          19,718               -3,249  -14.15%   x 1.16
 fmt::write_str_macro2       35,527          32,654               -2,873   -8.09%   x 1.09
 fmt::write_str_macro_debug  571,953         575,973               4,020    0.70%   x 0.99
 fmt::write_str_ref          9,579           9,459                  -120   -1.25%   x 1.01
 fmt::write_str_value        9,573           9,572                    -1   -0.01%   x 1.00
 fmt::write_u128_max         176             173                      -3   -1.70%   x 1.02
 fmt::write_u128_min         138             134                      -4   -2.90%   x 1.03
 fmt::write_u64_max          139             136                      -3   -2.16%   x 1.02
 fmt::write_u64_min          129             135                       6    4.65%   x 0.96
 fmt::write_vec_macro1       24,401          22,273               -2,128   -8.72%   x 1.10
 fmt::write_vec_macro2       37,096          35,602               -1,494   -4.03%   x 1.04
 fmt::write_vec_macro_debug  588,291         589,575               1,284    0.22%   x 1.00
 fmt::write_vec_ref          9,568           9,732                   164    1.71%   x 0.98
 fmt::write_vec_value        9,516           9,625                   109    1.15%   x 0.99
```
</details>
2021-08-23 22:55:19 +00:00
..
access_union_field.mir.stderr Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
access_union_field.rs Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
access_union_field.thir.stderr Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
inline_asm.mir.stderr Add needs-asm-support to more tests 2021-08-17 18:43:09 -07:00
inline_asm.rs Add needs-asm-support to more tests 2021-08-17 18:43:09 -07:00
inline_asm.thir.stderr Add needs-asm-support to more tests 2021-08-17 18:43:09 -07:00
issue-45087-unreachable-unsafe.mir.stderr Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
issue-45087-unreachable-unsafe.rs Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
issue-45087-unreachable-unsafe.thir.stderr Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs Apply suggestions from code review 2021-05-24 16:50:01 -04:00
issue-87414-query-cycle.rs Properly find owner of closure in THIR unsafeck 2021-07-30 19:05:34 +02:00
ranged_ints.mir.stderr Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints.rs Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints.thir.stderr Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints2.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints2.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints2.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints2_const.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints2_const.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints2_const.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_const.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_const.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_const.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_match.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_match.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints3_match.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4_const.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4_const.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints4_const.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
ranged_ints_const.mir.stderr Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints_const.rs Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints_const.thir.stderr Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
ranged_ints_macro.rs Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr Run THIR unsafeck on unsafe_op_in_unsafe_fn test 2021-05-25 20:12:42 +02:00
rfc-2585-unsafe_op_in_unsafe_fn.rs Run THIR unsafeck on unsafe_op_in_unsafe_fn test 2021-05-25 20:12:42 +02:00
rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr Run THIR unsafeck on unsafe_op_in_unsafe_fn test 2021-05-25 20:12:42 +02:00
union-assignop.mirunsafeck.stderr Test dropping union fields more 2021-08-03 15:11:04 -04:00
union-assignop.rs Test dropping union fields more 2021-08-03 15:11:04 -04:00
union-assignop.thirunsafeck.stderr Test dropping union fields more 2021-08-03 15:11:04 -04:00
union.mir.stderr Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
union.rs Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
union_access_through_block.rs Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
union_destructure.mir.stderr Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
union_destructure.rs Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
union_wild_or_wild.rs Check for union field accesses in THIR unsafeck 2021-07-09 13:51:28 -04:00
unsafe-around-compiler-generated-unsafe.mir.stderr Add unnecessary unsafe test 2021-08-16 16:28:16 +00:00
unsafe-around-compiler-generated-unsafe.rs Add unnecessary unsafe test 2021-08-16 16:28:16 +00:00
unsafe-around-compiler-generated-unsafe.thir.stderr Add unnecessary unsafe test 2021-08-16 16:28:16 +00:00
unsafe-assign.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-assign.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-assign.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-block-without-braces.rs parser: fuse free fn parsing together. 2020-02-13 10:39:24 +01:00
unsafe-block-without-braces.stderr more reuse in block parsing & improve diagnostics. 2020-03-10 08:32:34 +01:00
unsafe-borrow.mirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-borrow.rs Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-borrow.thirunsafeck.stderr Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck 2021-07-10 16:33:00 +02:00
unsafe-const-fn.mir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-const-fn.rs Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-const-fn.thir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-assign-deref-ptr.mir.stderr Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-fn-assign-deref-ptr.rs Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-fn-assign-deref-ptr.thir.stderr Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
unsafe-fn-autoderef.rs Remove licenses 2018-12-25 21:08:33 -07:00
unsafe-fn-autoderef.stderr Update tests 2019-03-11 23:10:26 +03:00
unsafe-fn-called-from-safe.mir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-called-from-safe.rs Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-called-from-safe.thir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-deref-ptr.mir.stderr Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-fn-deref-ptr.rs Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-fn-deref-ptr.thir.stderr Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
unsafe-fn-used-as-value.mir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-used-as-value.rs Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-fn-used-as-value.thir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
unsafe-subtyping.rs Remove licenses 2018-12-25 21:08:33 -07:00
unsafe-subtyping.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
unsafe-trait-impl.rs Highlight parts of fn in type errors 2019-11-23 16:50:28 -08:00
unsafe-trait-impl.stderr Highlight parts of fn in type errors 2019-11-23 16:50:28 -08:00
unsafe-unstable-const-fn.mir.stderr Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-unstable-const-fn.rs Check for raw pointer dereference in THIR unsafeck 2021-05-20 00:01:05 +02:00
unsafe-unstable-const-fn.thir.stderr Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00