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 6 pull requests #119237

Merged
merged 44 commits into from
Dec 23, 2023
Merged

Rollup of 6 pull requests #119237

merged 44 commits into from
Dec 23, 2023

Commits on Dec 16, 2023

  1. Hoist fn absent

    workingjubilee committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    6959818 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f116bc6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b525f76 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8facfb2 View commit details
    Browse the repository at this point in the history

Commits on Dec 21, 2023

  1. Configuration menu
    Copy the full SHA
    7a246dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1d36e3a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b487775 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    532080c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ba430a3 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2023

  1. Add IntoAsyncIterator

    eholk committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    8e34391 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    acb6f17 View commit details
    Browse the repository at this point in the history
  3. Update test outputs

    eholk committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    aaa3e76 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c6aa16c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f6af747 View commit details
    Browse the repository at this point in the history
  6. Clarify the situation with dummy patterns and PatData

    Use an explicit `Option` instead of requiring a `Default` bound
    Nadrieril committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    5fccaee View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0044505 View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2023

  1. Add comments to Level.

    There is room for improvement on some of these, but something is better
    than nothing.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    c8c1615 View commit details
    Browse the repository at this point in the history
  2. Streamline struct_lint_level.

    We can just get the error level in the `match` and then use
    `DiagnosticBuilder::new`. This then means a number of `DiagCtxt`
    functions are no longer needed, because this was the one place that used
    them.
    
    Note: the commit changes the treatment of spans for `Expect`, which was
    different to all the other cases, but this has no apparent effect.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    de303b8 View commit details
    Browse the repository at this point in the history
  3. Improve use items in compiler/rustc_errors/src/lib.rs.

    There are a bunch of them about 400 lines down, which is weird and
    annoying. This commit moves them up and puts them in a more sensible
    order.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    1b36958 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aec78dd View commit details
    Browse the repository at this point in the history
  5. Use IntoDiagnostic default.

    `IntoDiagnostic` defaults to `G = ErrorGuaranteed`. Take advantage of
    this in one place that currently doesn't.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    6257f3b View commit details
    Browse the repository at this point in the history
  6. Give DiagnosticBuilder a default type.

    `IntoDiagnostic` defaults to `ErrorGuaranteed`, because errors are the
    most common diagnostic level. It makes sense to do likewise for the
    closely-related (and much more widely used) `DiagnosticBuilder` type,
    letting us write `DiagnosticBuilder<'a, ErrorGuaranteed>` as just
    `DiagnosticBuilder<'a>`. This cuts over 200 lines of code due to many
    multi-line things becoming single line things.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    757d6f6 View commit details
    Browse the repository at this point in the history
  7. Tweak flush_delayed.

    - Take a `Vec` instead of an iterator, because that's all that is
      needed.
    - Do an early return for the "no bugs" case.
    - Use `enumerate` and an `i == 0` test to identify the first bug.
    
    Those changes mean the `no_bug` variable can be removed, which I found
    hard to read.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    a108a3b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6f147af View commit details
    Browse the repository at this point in the history
  9. Introduce DiagCtxt::treat_next_err_as_bug.

    To fix a FIXME.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    1502596 View commit details
    Browse the repository at this point in the history
  10. Remove DiagCtxtInner::span_bug.

    `DiagCtxt::span_bug` is different to the other `DiagCtxt::span_*`
    methods. This commit makes it the same, which requires changing
    `DiagCtxt::span_delayed_bug` to not do everything within the
    `inner.borrow_mut()`.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    1f08bfa View commit details
    Browse the repository at this point in the history
  11. Rename EarlyDiagCtxt methods to match DiagCtxt.

    - `early_error_no_abort` -> `early_err`
    - `early_error` -> `early_fatal`
    - `early_struct_error` -> `early_struct_fatal`
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    3a1b8e6 View commit details
    Browse the repository at this point in the history
  12. Remove Diagnostic::new_with_code.

    Its single use can be replaced with `Diagnostic::new_with_messages`.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    d7a3b62 View commit details
    Browse the repository at this point in the history
  13. Improve some names.

    Lots of vectors of messages called `message` or `msg`. This commit
    pluralizes them.
    
    Note that `emit_message_default` and `emit_messages_default` both
    already existed, and both process a vector, so I renamed the former
    `emit_messages_default_inner` because it's called by the latter.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    824667f View commit details
    Browse the repository at this point in the history
  14. Remove render_span args from Diagnostic::{sub,sub_with_highlight}.

    They're always `None`.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    125337b View commit details
    Browse the repository at this point in the history
  15. Remove SubDiagnostic::render_span.

    It's only ever set to `None`.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    ce0f703 View commit details
    Browse the repository at this point in the history
  16. Remove LabelKind.

    It has three variants, but only `LabelKind::Label` is ever used. This
    means `SingleLabelManySpans::kind` can also be removed.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    49040d0 View commit details
    Browse the repository at this point in the history
  17. Take full advantage of a use Level::*;.

    Some of the `Level::` qualifiers in this file are omitted. This commit
    removes the remainder.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    e0461f9 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3944301 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    81f50fd View commit details
    Browse the repository at this point in the history
  20. Fix a comment.

    There are quite a few hand-written `IntoDiagnostic` impls.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    3db58e6 View commit details
    Browse the repository at this point in the history
  21. Remove all uses of DiagnosticBuilder::forget_guarantee().

    There are only three. It's simpler to make the type
    `DiagnosticBuilder<'_, ()>` from the start, no matter the level, than to
    change the guarantee later.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    00e8485 View commit details
    Browse the repository at this point in the history
  22. Remove DiagnosticBuilder::forget_guarantee.

    It's unused. And this means `DiagnosticBuilderInner` no longer needs to
    be separate from `DiagnosticBuilder`.
    nnethercote committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    2cd14bc View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#119012 - workingjubilee:extract-enum-layout…

    …-fn, r=b-naber
    
    Extract `layout_of_{struct,enum}` fn
    
    While writing rust-lang#118974 I noticed it was annoying to navigate a huge, several hundred line function, which handles many subcases, and make confident declarations about what part of the flow of execution the compiler would be in. To help with that, this breaks out `layout_of_struct_or_enum`'s fundamental logic into a pair of functions, one for each case. It changes essentially none of that logic, merely moves it around.
    
    Because "the layout of an ADT" feels like a somewhat nebulous subject, I chose to deliberately avoid any expansions to LayoutCalculator's public API, though such does feel like a possible logical next step. There are, indeed, many logical next steps. I'm not taking any of them here, yet, because this comparatively tiny refactor is a prerequisite for all of them.
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    aaff415 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#119077 - tmiasko:lint, r=cjgillot

    Separate MIR lints from validation
    
    Add a MIR lint pass, enabled with -Zlint-mir, which identifies undefined or
    likely erroneous behaviour.
    
    The initial implementation mostly migrates existing checks of this nature from
    MIR validator, where they did not belong (those checks have false positives and
    there is nothing inherently invalid about MIR with undefined behaviour).
    
    Fixes rust-lang#104736
    Fixes rust-lang#104843
    Fixes rust-lang#116079
    Fixes rust-lang#116736
    Fixes rust-lang#118990
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    7dd0955 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#119171 - nnethercote:cleanup-errors-4, r=co…

    …mpiler-errors
    
    Cleanup error handlers: round 4
    
    More `rustc_errors` cleanups. A sequel to rust-lang#118933.
    
    r? `@compiler-errors`
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    e0d7a72 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#119198 - compiler-errors:desugaring, r=eholk

    Split coroutine desugaring kind from source
    
    What a coroutine is desugared from (gen/async gen/async) should be separate from where it comes (fn/block/closure).
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    ae0a6e8 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#119222 - eholk:into-async-iterator, r=compi…

    …ler-errors,dtolnay
    
    Add `IntoAsyncIterator`
    
    This introduces the `IntoAsyncIterator` trait and uses it in the desugaring of the unstable `for await` loop syntax. This is mostly added for symmetry with `Iterator` and `IntoIterator`.
    
    r? `@compiler-errors`
    
    cc `@rust-lang/libs-api,` `@rust-lang/wg-async`
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    eef023c View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#119230 - Nadrieril:librarify-even-further, …

    …r=compiler-errors
    
    Exhaustiveness: clean up after librarification
    
    This cleans up some things that weren't done nicely by rust-lang#118842.
    
    r? `@compiler-errors`
    compiler-errors committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    8c50e3e View commit details
    Browse the repository at this point in the history