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

Rollup of 8 pull requests #119864

Merged
merged 34 commits into from
Jan 11, 2024
Merged

Rollup of 8 pull requests #119864

merged 34 commits into from
Jan 11, 2024

Commits on Jan 7, 2024

  1. Configuration menu
    Copy the full SHA
    5b153b5 View commit details
    Browse the repository at this point in the history
  2. tidy: add\remove deps

    klensy committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    46cf55a View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2024

  1. chore: remove unnecessary blank line

    Signed-off-by: hi-rustin <rustin.liu@gmail.com>
    Rustin170506 committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    784b50c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f98b54 View commit details
    Browse the repository at this point in the history
  3. coverage: Store extracted spans as a flat list of mappings

    This is less elegant in some ways, since we no longer visit a BCB's spans as a
    batch, but will make it much easier to add support for other kinds of coverage
    mapping regions (e.g. branch regions or gap regions).
    Zalathar committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    c593218 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    124fff0 View commit details
    Browse the repository at this point in the history
  5. Inline and remove DiagCtxtInner::bump_{lint_err,err}_count.

    They have one and two call sites respectively, and they just make the
    code harder to read.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    f0a3684 View commit details
    Browse the repository at this point in the history
  6. Use the right level with -Ztreat-err-as-bug.

    Errors in `DiagCtxtInner::emit_diagnostic` are never set to
    `Level::Bug`, because the condition never succeeds, because
    `self.treat_err_as_bug()` is called *before* the error counts are
    incremented.
    
    This commit switches to `self.treat_next_err_as_bug()`, fixing the
    problem. This changes the error message output to actually say "internal
    compiler error".
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    2aac288 View commit details
    Browse the repository at this point in the history
  7. Move code around.

    No point computing `warnings` and `errors` if we're going to return
    early before they're used.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    a0f5431 View commit details
    Browse the repository at this point in the history
  8. Remove DiagnosticBuilder::into_diagnostic from -Ztreat-err-as-bug

    … consideration.
    
    It seems very wrong to have a `-Ztreat-err-as-bug` check here before the
    error is even emitted.
    
    Once that's done:
    - `into_diagnostic` is infallible, so its return type doesn't need the
      `Option`;
    - the `&'a DiagCtxt` also isn't needed, because only one callsite uses
      it, and it already have access to it via `self.dcx`;
    - the comments about dcx disabling buffering are no longer true, this is
      unconditional now;
    - and the `debug!` seems unnecessary... the comment greatly overstates
      its importance because few diagnostics come through `into_diagnostic`,
      and `-Ztrack-diagnostics` exists anyway.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    552bed8 View commit details
    Browse the repository at this point in the history
  9. Inline and remove three functions.

    Each of these has a single call site: `source_file_to_parser`,
    `try_file_to_source_file`, `file_to_source_file`. Having them separate
    just makes the code longer and harder to read.
    
    Also, `maybe_file_to_stream` doesn't need to be `pub`.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    f5c0cd0 View commit details
    Browse the repository at this point in the history
  10. Use struct_fatal in new_parser_from_file.

    It's a little more concise, and the standard way to do it.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    d5aafb8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2668270 View commit details
    Browse the repository at this point in the history
  12. Stop using DiagnosticBuilder::buffer in Checker.

    This requires cancelling the "secondary" errors when they're not
    emitted, to prevent panics due to unconsumed `DiagnosticBuilder`s.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    29c601a View commit details
    Browse the repository at this point in the history
  13. Stop using DiagnosticBuilder::buffer in BorrowckErrors.

    But we can't easily switch from `Vec<Diagnostic>` to
    `Vec<DiagnosticBuilder<G>>` because there's a mix of errors and warnings
    which result in different `G` types. So we must make
    `DiagnosticBuilder::into_diagnostic` public, but that's ok, and it will
    get more use in subsequent commits.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    fbe68bc View commit details
    Browse the repository at this point in the history
  14. Fix lifetimes in StringReader.

    Two different lifetimes are conflated. This doesn't matter right now,
    but needs to be fixed for the next commit to work. And the more
    descriptive lifetime names make the code easier to read.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    d02150f View commit details
    Browse the repository at this point in the history
  15. Stop using DiagnosticBuilder::buffer in the parser.

    One consequence is that errors returned by
    `maybe_new_parser_from_source_str` now must be consumed, so a bunch of
    places that previously ignored those errors now cancel them. (Most of
    them explicitly dropped the errors before. I guess that was to indicate
    "we are explicitly ignoring these", though I'm not 100% sure.)
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    6656413 View commit details
    Browse the repository at this point in the history
  16. Remove DiagnosticBuilder::buffer.

    All its uses have been removed.
    nnethercote committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    4fd1db1 View commit details
    Browse the repository at this point in the history
  17. Bubble up error type

    oli-obk committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    252ac15 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    af7f8f9 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    55cab53 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    4580f4a View commit details
    Browse the repository at this point in the history
  21. apply fmt

    klensy committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    aa696c5 View commit details
    Browse the repository at this point in the history
  22. rint: further doc tweaks

    RalfJung committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    6b6f2a5 View commit details
    Browse the repository at this point in the history
  23. fix: update broken stderr

    Signed-off-by: hi-rustin <rustin.liu@gmail.com>
    Rustin170506 committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    90cc8ba View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    db86056 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#119448 - klensy:annotate-snippets-0.10, r=d…

    …avidtwco
    
    annotate-snippets: update to 0.10
    
    Ports `annotate-snippets` to 0.10, temporary dupes versions; other crates left that depends on 0.9 is `ui_test` and `rustfmt`.
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    fe97e93 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#119813 - oli-obk:even_more_follow_up_errors…

    …2, r=estebank
    
    Silence some follow-up errors [2/x]
    
    this is one piece of the requested cleanups from rust-lang#117449
    
    the `type_of` query frequently uses astconv to convert a `hir::Ty` to a `ty::Ty`. This process is infallible, but may produce errors as it goes. All the error reporting sites that had access to the `ItemCtxt` are now tainting it, causing `type_of` to return a `ty::Error` instead of anything else.
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    bd61caf View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#119836 - hi-rustin:rustin-patch-docs-blank-…

    …line, r=ChrisDenton
    
    chore: remove unnecessary blank line
    
    It seems no need to add an unnecessary line here.
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    6beb676 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#119841 - nnethercote:rm-DiagnosticBuilder-b…

    …uffer, r=oli-obk
    
    Remove `DiagnosticBuilder::buffer`
    
    `DiagnosticBuilder::buffer` doesn't do much, and part of what it does (for `-Ztreat-err-as-bug`) it shouldn't.
    
    This PR strips it back, replaces its uses, and finally removes it, making a few cleanups in the vicinity along the way.
    
    r? ``@oli-obk``
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    f5387a1 View commit details
    Browse the repository at this point in the history
  29. Rollup merge of rust-lang#119842 - Zalathar:kind, r=oli-obk

    coverage: Add enums to accommodate other kinds of coverage mappings
    
    Extracted from  rust-lang#118305.
    
    LLVM supports several different kinds of coverage mapping regions, but currently we only ever emit ordinary “code” regions.  This PR performs the plumbing required to add other kinds of regions as enum variants, but does not add any specific variants other than `Code`.
    
    The main motivation for this change is branch coverage, but it will also allow separate experimentation with gap regions and skipped regions, which might help in producing more accurate and useful coverage reports.
    
    ---
    
    ``@rustbot`` label +A-code-coverage
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    8294356 View commit details
    Browse the repository at this point in the history
  30. Rollup merge of rust-lang#119845 - RalfJung:rint, r=nagisa

    rint: further doc tweaks
    
    r? ``@nagisa``
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    1a4d3c9 View commit details
    Browse the repository at this point in the history
  31. Rollup merge of rust-lang#119852 - RalfJung:const-err4, r=compiler-er…

    …rors
    
    give const-err4 a more descriptive name
    
    Also, doesn't look like this still needs to be per-bitwidth
    
    r? ``@oli-obk``
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    ca17ce4 View commit details
    Browse the repository at this point in the history
  32. Rollup merge of rust-lang#119853 - klensy:rustfmt-ignore, r=cuviper

    rustfmt.toml: don't ignore just any tests path, only root one
    
    Previously ignored any `tests` path, now only /tests at repo root.
    
    For reference, https://git-scm.com/docs/gitignore#_pattern_format
    matthiaskrgr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    b3d15eb View commit details
    Browse the repository at this point in the history