Skip to content
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

More rustc_interface cleanups #117376

Merged
merged 11 commits into from
Oct 30, 2023
Merged

Commits on Oct 30, 2023

  1. Delay parsing of --cfg and --check-cfg options.

    By storing the unparsed values in `Config` and then parsing them within
    `run_compiler`, the parsing functions can use the main symbol interner,
    and not create their own short-lived interners.
    
    This change also eliminates the need for one `EarlyErrorHandler` in
    rustdoc, because parsing errors can be reported by another, slightly
    later `EarlyErrorHandler`.
    nnethercote committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    678e01a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bfcff79 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e4ac98 View commit details
    Browse the repository at this point in the history
  4. Make Cfg and CheckCfg non-generic.

    They now only ever contains symbols.
    nnethercote committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    5c6a12c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    371f972 View commit details
    Browse the repository at this point in the history
  6. Remove out-of-date comment.

    It was added in 51938c6, a commit with
    a 7,720 line diff and a one line commit message. Even then the comment
    was incorrect; there was a removed a `build_output_filenames` call with
    a `&[]` argument in rustdoc, but the commit removed that call. In such a
    large commit, it's easy for small errors to occur.
    nnethercote committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    85e56e8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a60d643 View commit details
    Browse the repository at this point in the history
  8. Remove check_output.

    Using `find` and `any` from `std` makes the code shorter and clearer.
    nnethercote committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    95b0088 View commit details
    Browse the repository at this point in the history
  9. Streamline collect_crate_types.

    - The early return can be right at the top.
    - The control flow is simplified with `if let`.
    - The `collect` isn't necessary.
    - The "Unconditionally" comment is erroneously duplicated from
      `check_attr_crate_type`, and can be removed.
    nnethercote committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    be8fd8b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    90862f6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0c381ec View commit details
    Browse the repository at this point in the history