- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Remove the deprecated unstable concat_idents! macro
          #142704
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| rustbot has assigned @WaffleLapkin. Use  | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| This shouldn't need any specific approval because of the completed FCP at #137653 (comment), but just as a heads up: @rust-lang/lang @rust-lang/libs | 
| should we do a crater run? | 
| I don't think we necessarily need to act on any crater results, since anyone using this should already be getting the deprecation warnings. But it also doesn't hurt to see what those results might be. @bors2 try | 
Remove the deprecated `concat_idents!` macro In [#137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e ("Add #concat_idents[] and #ident_to_str[]"). The syntax looks a bit different but it still works about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: #29599 [#137653]: #137653 [`macro_metavar_expr_concat`]: #124225
| @craterbot check | 
| 👌 Experiment  ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more | 
| 🚧 Experiment  ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more | 
concat_idents! macroconcat_idents! macro
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this PR the feature appears unknown to end users. That's not the best migration UX; so we should probably add this to the list in compiler/rustc_feature/src/removed.rs (AFAIK, no other way to do this for removed lib features).
        
          
                tests/ui/unpretty/exhaustive.rs
              
                Outdated
          
        
      | /// TyKind::MacCall | ||
| #[expect(deprecated)] // concat_idents is deprecated | ||
| fn ty_mac_call() { | ||
| let _: concat_idents!(T); | ||
| let _: concat_idents![T]; | ||
| let _: concat_idents! { T }; | ||
| let _ = concat!("T"); | ||
| let _ = concat!["T"]; | ||
| let _ = concat! { "T" }; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect; the test requires a macro at type position (TyKind::MacCall). this probably needs a helper macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not exactly sure what this is testing, but I added a macro that forwards a $ty metavar.
| There are changes to the  cc @jieyouxu | 
| Comments should be addressed, added  @rustbot ready | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after squash
c4e45d1    to
    9b1f7ad      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
`concat_idents!` is in the process of being removed, but a few things it is used to test will still be relevant. Migrate these tests to something other than `concat_idents`.
These tests were updated in the previous commit; while they are being cleaned up, move them to a non-issue directory.
In [137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).
This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.
History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
about the same:
    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");
    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");
(That test existed from introduction until its removal here.)
Closes: https://www.github.com/rust-lang/rust/issues/29599
[137653]: https://www.github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://www.github.com/rust-lang/rust/issues/124225
    9b1f7ad    to
    0e4de4c      
    Compare
  
    | Thanks! @bors r=fee1-dead | 
Rollup of 7 pull requests Successful merges: - #137268 (Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`.) - #142704 (Remove the deprecated unstable `concat_idents!` macro) - #142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2) - #142843 (Enable reproducible-build-2 for Windows MSVC) - #142916 (rustdoc-json: Add test for `#[optimize(..)]`) - #142919 (rustdoc-json: Add test for `#[cold]`) - #142944 (Stats output tweaks) Failed merges: - #142825 (Port `#[track_caller]` to the new attribute system) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-dead Remove the deprecated unstable `concat_idents!` macro In [#137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e ("Add #concat_idents[] and #ident_to_str[]"). The syntax looks a bit different but it still works about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: #29599 [#137653]: #137653 [`macro_metavar_expr_concat`]: #124225
…ee1-dead Remove the deprecated unstable `concat_idents!` macro In [rust-lang#137653], the lang and libs-API teams did a joint FCP to deprecate and eventually remove the long-unstable `concat_idents!` macro. The deprecation is landing in 1.88, so do the removal here (target version 1.90). This macro has been superseded by the more recent `${concat(...)}` metavariable expression language feature, which avoids some of the limitations of `concat_idents!`. The metavar expression is unstably available under the [`macro_metavar_expr_concat`] feature. History is mildly interesting here: `concat_idents!` goes back to 2011 when it was introduced with 513276e ("Add #concat_idents[] and #ident_to_str[]"). The syntax looks a bit different but it still works about the same: let asdf_fdsa = "<.<"; assert(#concat_idents[asd,f_f,dsa] == "<.<"); assert(#ident_to_str[use_mention_distinction] == "use_mention_distinction"); (That test existed from introduction until its removal here.) Closes: rust-lang#29599 [rust-lang#137653]: rust-lang#137653 [`macro_metavar_expr_concat`]: rust-lang#124225
In rust-lang/rust#137653, the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable
concat_idents!macro. Thedeprecation is landing in 1.88, so do the removal here (target version
1.90).
This macro has been superseded by the more recent
${concat(...)}metavariable expression language feature, which avoids some of the
limitations of
concat_idents!. The metavar expression is unstablyavailable under the
macro_metavar_expr_concatfeature.History is mildly interesting here:
concat_idents!goes back to 2011when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:
(That test existed from introduction until its removal here.)
Closes: #29599