rust/compiler
bors 03360be6b7 Auto merge of #92066 - Smittyvb:concat_bytes-repeat, r=nagisa
Support [x; n] expressions in concat_bytes!

Currently trying to use `concat_bytes!` with a repeating array value like `[42; 5]` results in an error:
```
error: expected a byte literal
 --> src/main.rs:3:27
  |
3 |     let x = concat_bytes!([3; 4]);
  |                           ^^^^^^
  |
  = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()`
```

This makes it so repeating array syntax can be used the same way normal arrays can be. The RFC doesn't explicitly mention repeat expressions, but it seems reasonable to allow them as well, since normal arrays are allowed.

It is possible to make the compiler get stuck compiling forever with `concat_bytes!([3; 999999999])`, but I don't think that's much of an issue since you can do that already with `const X: [u8; 999999999] = [3; 999999999];`.

Contributes to #87555.
2022-01-02 12:38:41 +00:00
..
rustc Remove useless #[global_allocator] from rustc and rustdoc. 2021-12-23 17:23:21 +11:00
rustc_apfloat Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_arena Add some comments. 2021-11-19 07:52:59 +11:00
rustc_ast Auto merge of #92294 - Kobzol:rustdoc-meta-kind, r=GuillaumeGomez 2022-01-01 02:03:23 +00:00
rustc_ast_lowering Tighten span when suggesting lifetime on path 2021-12-27 23:34:52 -08:00
rustc_ast_passes Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_ast_pretty Rollup merge of #92420 - dtolnay:patrange, r=Mark-Simulacrum 2022-01-01 10:48:56 +01:00
rustc_attr Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
rustc_borrowck Use SparseIntervalMatrix instead of SparseBitMatrix 2021-12-30 22:33:52 -05:00
rustc_builtin_macros Auto merge of #92066 - Smittyvb:concat_bytes-repeat, r=nagisa 2022-01-02 12:38:41 +00:00
rustc_codegen_cranelift Merge commit '40b00f4200fbdeefd11815398cb46394b8cb0a5e' into sync_cg_clif-2021-12-30 2021-12-30 14:53:41 +01:00
rustc_codegen_gcc Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_codegen_llvm Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_codegen_ssa Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_const_eval Extend check for UnsafeCell in consts to cover unions 2021-12-31 08:53:12 +01:00
rustc_data_structures Auto merge of #92130 - Kobzol:stable-hash-str, r=cjgillot 2021-12-28 01:04:33 +00:00
rustc_driver Upgrade tracing-subscriber 2021-12-22 10:47:36 -06:00
rustc_error_codes docs(error-codes): Add long error explanation for E0227 2021-12-28 15:46:20 +03:00
rustc_errors Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_expand Rollup merge of #91519 - petrochenkov:cratexp2, r=Aaron1011 2021-12-30 13:12:33 +01:00
rustc_feature Stabilize destructuring_assignment 2021-12-14 22:38:51 -05:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_hir Remove PartialOrd and Ord from LocalDefId 2021-12-22 10:50:57 -06:00
rustc_hir_pretty Fix whitespace in pretty printed PatKind::Range 2021-12-29 13:02:14 -08:00
rustc_incremental Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_index Introduce IntervalSet 2021-12-30 22:33:44 -05:00
rustc_infer Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
rustc_interface Rollup merge of #92468 - NieDzejkob:silent-cfg, r=petrochenkov 2022-01-01 22:49:53 +01:00
rustc_lexer Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
rustc_lint Rollup merge of #91770 - TaKO8Ki:suggest-adding-cfg-test, r=joshtriplett 2021-12-21 08:33:39 +01:00
rustc_lint_defs Rollup merge of #91770 - TaKO8Ki:suggest-adding-cfg-test, r=joshtriplett 2021-12-21 08:33:39 +01:00
rustc_llvm Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_macros Remove in_band_lifetimes from rustc_middle 2021-12-15 19:50:43 -05:00
rustc_metadata Auto merge of #92034 - petrochenkov:nolinknores, r=joshtriplett 2022-01-02 06:28:34 +00:00
rustc_middle Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
rustc_mir_build Store a DefId instead of an AdtDef in AggregateKind::Adt 2021-12-22 14:36:34 -05:00
rustc_mir_dataflow Remove in_band_lifetimes from rustc_mir_dataflow 2021-12-16 14:29:43 -05:00
rustc_mir_transform Auto merge of #91342 - RalfJung:fn-abi, r=eddyb,oli-obk 2021-12-24 04:59:05 +00:00
rustc_monomorphize Rollup merge of #91895 - pitaj:91867-monomorphize, r=Aaron1011 2021-12-19 17:38:34 +01:00
rustc_parse Parse and suggest moving where clauses after equals for type aliases 2021-12-28 14:20:15 -05:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Add Attribute::meta_kind 2021-12-26 16:56:34 +01:00
rustc_plugin_impl replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy Rollup merge of #90586 - jswrenn:relax-privacy-lints, r=petrochenkov 2021-12-27 21:42:25 +01:00
rustc_query_impl Import SourceFiles from crate before decoding foreign Span 2021-12-23 12:56:12 -05:00
rustc_query_system Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_resolve Rollup merge of #92237 - compiler-errors:issue-92100, r=cjgillot 2021-12-29 10:17:10 +01:00
rustc_save_analysis Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_serialize Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkov 2021-12-13 07:30:38 +00:00
rustc_session Auto merge of #92175 - Aaron1011:fix-missing-source-file, r=cjgillot 2021-12-31 16:38:23 +00:00
rustc_span Remove PartialOrd and Ord from LocalDefId 2021-12-22 10:50:57 -06:00
rustc_symbol_mangling Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_target Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
rustc_trait_selection Auto merge of #92244 - petrochenkov:alltraits, r=cjgillot 2021-12-29 19:22:33 +00:00
rustc_traits Auto merge of #91929 - anuvratsingh:remove_in_band_lifetimes_compiler_rustc_traits, r=jackh726 2021-12-31 05:08:24 +00:00
rustc_ty_utils Use a const ParamEnv when in default_method_body_is_const 2021-12-17 20:42:48 +08:00
rustc_type_ir Fix HashStable implementation on InferTy 2021-12-13 20:36:17 -08:00
rustc_typeck Auto merge of #92294 - Kobzol:rustdoc-meta-kind, r=GuillaumeGomez 2022-01-01 02:03:23 +00:00