@@ -25,16 +25,6 @@ supported as inputs:
2525
2626- byte string literals (` b"..." ` )
2727- byte literals (` b'b' ` )
28- - numeric literals – must fit in ` u8 ` , any number larger than ` u8::MAX ` causes
29- a compile time error like the following:
30-
31- ```
32- error: cannot concatenate a non-`u8` literal in a byte string literal
33- --> $FILE:XX:YY
34- |
35- XX | concat_bytes!(256, b"val");
36- | ^^^ this value is larger than `255`
37- ```
3828- numeric array literals – if any literal is outside of ` u8 ` range, it will
3929 cause a compile time error:
4030
@@ -64,6 +54,11 @@ string literals, like a previous revision of this RFC proposed. This would make
6454it hard to ensure the right output type is produced – users would have to use
6555hacks like adding a dummy ` b"" ` argument to force a byte literal output.
6656
57+ An earlier version of this RFC proposed to support integer literals outside of
58+ arrays, but that was rejected since it would make the output of
59+ ` byte_concat!(123, b"\n") ` inconsistent with the equivalent ` concat! `
60+ invocation.
61+
6762# Unresolved questions
6863[ unresolved-questions ] : #unresolved-questions
6964
@@ -72,8 +67,3 @@ hacks like adding a dummy `b""` argument to force a byte literal output.
7267 support those as well (support ` &[0, 1, 2] ` in addition to ` [0, 1, 2] ` ).
7368- What to do with string and character literals? They could either be supported
7469 with their underlying UTF-8 representation being concatenated, or rejected.
75- - If supported, it would probably make sense to also support boolean literals
76- so ` concat_bytes!() ` supports all inputs ` concat!() ` does.
77- - If rejected, it would probably makes sense to also reject boolean literals
78- to avoid any possible confusion about their representation (` true ` and
79- ` false ` vs. ` 1 ` and ` 0 ` ).
0 commit comments