- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
docs: autogenerate compiler flag stubs based on -Zhelp #142135
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
| Failed to set assignee to  
 | 
| r? compiler | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
42a4c2d    to
    2cfd494      
    Compare
  
    | r? compiler | 
| @bors r+ | 
…piler-errors docs: autogenerate compiler flag stubs based on -Zhelp Adds autogenerated compiler flag stubs to the unstable book by building rustc, passing it's path to `unstable-book-gen`, and using that to call the compiler with `-Zhelp` and create a similar `Features` that is used for library and lang stubs. Example: ```md # `combine_cgu` combine CGUs into a single one This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use. ------------------------ ``` Closes rust-lang#141525
…piler-errors docs: autogenerate compiler flag stubs based on -Zhelp Adds autogenerated compiler flag stubs to the unstable book by building rustc, passing it's path to `unstable-book-gen`, and using that to call the compiler with `-Zhelp` and create a similar `Features` that is used for library and lang stubs. Example: ```md # `combine_cgu` combine CGUs into a single one This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use. ------------------------ ``` Closes rust-lang#141525
…piler-errors docs: autogenerate compiler flag stubs based on -Zhelp Adds autogenerated compiler flag stubs to the unstable book by building rustc, passing it's path to `unstable-book-gen`, and using that to call the compiler with `-Zhelp` and create a similar `Features` that is used for library and lang stubs. Example: ```md # `combine_cgu` combine CGUs into a single one This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use. ------------------------ ``` Closes rust-lang#141525
Rollup of 9 pull requests Successful merges: - #138016 (Added `Clone` implementation for `ChunkBy`) - #140770 (add `extern "custom"` functions) - #141162 (refactor `AttributeGate` and `rustc_attr!` to emit notes during feature checking) - #141474 (Add `ParseMode::Diagnostic` and fix multiline spans in diagnostic attribute lints) - #141947 (Specify that "option-like" enums must be `#[repr(Rust)]` to be ABI-compatible with their non-1ZST field.) - #142135 (docs: autogenerate compiler flag stubs based on -Zhelp) - #142252 (Improve clarity of `core::sync::atomic` docs about "Considerations" in regards to CAS operations) - #142337 (miri: add flag to suppress float non-determinism) - #142353 (compiler: Ease off the accelerator on `unsupported_calling_conventions`) r? `@ghost` `@rustbot` modify labels: rollup
| @bors r- | 
| @rmehri01 | 
| 
 Hey! Sorry I'm not exactly sure what went wrong here, it seems like it has to do something with getting the output of  Edit: nvm I think I messed up the host argument to  | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
bc500ae    to
    00ce4f5      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
bd8cdf2    to
    0e7711e      
    Compare
  
    | @rustbot review | 
| ☔ The latest upstream changes (presumably #145210) made this pull request unmergeable. Please resolve the merge conflicts. | 
0e7711e    to
    8e0034d      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
d633a45    to
    91ee21b      
    Compare
  
    | ☔ The latest upstream changes (presumably #145011) made this pull request unmergeable. Please resolve the merge conflicts. | 
91ee21b    to
    3104e57      
    Compare
  
    | r? bootstrap | 
|  | ||
| fn collect_compiler_flags(rustc_path: impl AsRef<Path>) -> Features { | ||
| let mut rustc = Command::new(rustc_path.as_ref()); | ||
| rustc.arg("-Zhelp"); | 
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.
Rather than running -Zhelp and then trying to parse that, maybe we can parse the options! macro (
rust/compiler/rustc_session/src/options.rs
Line 2116 in 040a98a
| options! { | 
I'm OK with sticking with -Z/-C parsing since the syntax is both fairly simple and controlled by us, though.
We'd likely also want (perhaps in a separate PR) to enforce that all the -C flags in codegen options (also in the linked file) have documentation in the non-unstable book. That could be done in tidy.
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.
It would probably be nice to have the file/line to link to, do you mean just literally reading and parsing the rust source file to do that or is there a better way to go about it?
3104e57    to
    41eb772      
    Compare
  
    | ☔ The latest upstream changes (presumably #146592) made this pull request unmergeable. Please resolve the merge conflicts. | 
Adds autogenerated compiler flag stubs to the unstable book by building rustc, passing it's path to
unstable-book-gen, and using that to call the compiler with-Zhelpand create a similarFeaturesthat is used for library and lang stubs.Example:
Closes #141525