Teach concat!() to concatenate byte str literals#52838
Teach concat!() to concatenate byte str literals#52838estebank wants to merge 3623 commits intorust-lang:masterfrom
concat!() to concatenate byte str literals#52838Conversation
rfc, const-repeat-expr: notes on is_rvalue_promotable(expr)
Issues are not feature requests
Add missing Copy bound for K in get_default in RFC 2094
Markdown style link for mdbook (same as rust-lang#2199)
Stable SIMD in Rust
Allow `loop` in constant evaluation
Update RFC 0430 to allow underscores between numbers in CamelCase names
The Cretonne project is now renamed to Cranelift. Update the names in the SIMD RFC and add links to the project page.
Rename Cretonne to Cranelift.
Fix link in RFC template and stuff
…unds RFC: Associated type bounds of form `MyTrait<AssociatedType: Bounds>`
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
CC @rust-lang/lang |
|
I think the new behavior of |
This comment has been minimized.
This comment has been minimized.
src/libsyntax/ast.rs
Outdated
| } | ||
| } | ||
|
|
||
| /// Returns a `LitKind::ByteStr` from `content`. |
There was a problem hiding this comment.
Why does this need to have a constructor method, specifically?
src/libsyntax_ext/concat.rs
Outdated
| if b_accumulator.len() > 0 { | ||
| base::MacEager::expr(cx.expr_lit( | ||
| sp, | ||
| ast::LitKind::new_byte_str(b_accumulator), |
There was a problem hiding this comment.
You might want instead a cx.expr_byte_str.
@kennytm other than bad style of introducing insta-stable behavior, do you foresee any problems with the new behavior? If the PR also included support to mix and match |
|
@estebank The usual concern there would be if there's some subtle aspect of the new behavior that we don't catch before shipping it, people start relying on that aspect, and we then can't change it even if we want to. |
src/libsyntax_ext/concat.rs
Outdated
There was a problem hiding this comment.
Just noticed that this error (and suggestion) will be wrong when doing concat!(b"asdf", true, 3).
This comment has been minimized.
This comment has been minimized.
|
Oh boy... I really messed this up, trying to push to the RFCS repo. Refiled at #52932. |
Fix #52710.