- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
std: Stablize the macros module #20657
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
| r? @aturon | 
| r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) | 
fb397cf    to
    25dc7e8      
    Compare
  
    25dc7e8    to
    5f42217      
    Compare
  
            
          
                src/libstd/macros.rs
              
                Outdated
          
        
      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.
What's the rationale for dropping the functionality here, rather than beefing up unimplemented?
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'd personally like to remove both of them as they're just longer versions of panic! in my mind, but failing that I'd rather stick to a more conservative approach where we don't just duplicate-panic-in-each-macro just yet.
| This basically looks good to me, but we may want to get input from someone with deeper macros knowledge. Also, are we 100% sure we want to stabilize  | 
| With regard to  
 I do agree though that we've put ourselves in a corner with  | 
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.
If this is being removed, shouldn't the ext::bytes module be removed as well?
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.
Aha, indeed!
| The commit should be tagged as a  | 
| @alexcrichton Yep, those were pretty much exactly my thoughts. The only question is whether we want to fully commit now, or wait till beta to admit that we have to. | 
5f42217    to
    e7c9102      
    Compare
  
    | I think the best case outcome for  | 
| These changes look good to me. | 
e7c9102    to
    dc49783      
    Compare
  
    | rebased, re-r? @aturon | 
dc49783    to
    940fe74      
    Compare
  
    This commit performs a pass over the `std::macros` module, applying stability attributes where necessary. In particular, this audits macros for patterns such as: * Standard use of forward-to-format-args via `$($arg:tt)*` (or `+`) * Prevent macro-defined identifiers from leaking into expression arguments as hygiene is not perfectly implemented. * Wherever possible, `$crate` is used now. Specifically, the following actions were taken: * The `std::macros` module itself is no longer public. * The `panic!` macro is stable * The `assert!` macro is stable * The `assert_eq!` macro is stable * The `debug_assert!` macro is stable * The `debug_assert_eq!` macro is stable * The `unreachable!` macro is stable after removing the extra forms to bring the definition in line with the `unimplemented!` macro. * The `try!` macro is stable * The `vec!` macro is stable [breaking-change]
940fe74    to
    209c701      
    Compare
  
    …mplete-let Fix extra semicolon before else in let-stmt
This commit performs a pass over the
std::macrosmodule, applying stabilityattributes where necessary. In particular, this audits macros for patterns such
as:
$($arg:tt)*(or+)hygiene is not perfectly implemented.
$crateis used now.Specifically, the following actions were taken:
std::macrosmodule itself is no longer public.panic!macro is stableassert!macro is stableassert_eq!macro is stabledebug_assert!macro is stabledebug_assert_eq!macro is stableunreachable!macro is stable after removing the extra forms to bring thedefinition in line with the
unimplemented!macro.try!macro is stablevec!macro is stable