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 #125976

Merged
merged 20 commits into from
Jun 4, 2024
Merged

Commits on May 28, 2024

  1. Configuration menu
    Copy the full SHA
    a04ac26 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Configuration menu
    Copy the full SHA
    39b39da View commit details
    Browse the repository at this point in the history
  2. Refactor #[diagnostic::do_not_recommend] support

    This commit refactors the `#[do_not_recommend]` support in the old
    parser to also apply to projection errors and not only to selection
    errors. This allows the attribute to be used more widely.
    weiznich committed May 29, 2024
    Configuration menu
    Copy the full SHA
    f9adc1e View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Configuration menu
    Copy the full SHA
    08fe940 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9af9674 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2024

  1. Fix ICE caused by ignoring EffectVars in type inference

    Signed-off-by: Andrew Wock <[email protected]>
    ajwock committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    66a1386 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. Streamline nested calls.

    `TyCtxt` impls `PpAnn` in `compiler/rustc_middle/src/hir/map/mod.rs`. We
    can call that impl, which then calls the one on `intravisit::Map`,
    instead of calling the one on `intravisit::Map` directly, avoiding a
    cast and extra references.
    nnethercote committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    4798c20 View commit details
    Browse the repository at this point in the history
  2. Remove out-of-date comment.

    Exhaustiveness and usefulness checking are now in
    `rustc_pattern_analysis`.
    nnethercote committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    6b47c5e View commit details
    Browse the repository at this point in the history
  3. Reduce pub exposure.

    A lot of errors don't need to be visible outside the crate, and some
    other things as well.
    nnethercote committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    5a5e248 View commit details
    Browse the repository at this point in the history
  4. Downsize ty::Expr

    BoxyUwU committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    f076dec View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7e08f80 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    67a73f2 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#125667 - oli-obk:taintify, r=TaKO8Ki

    Silence follow-up errors directly based on error types and regions
    
    During type_of, we used to just return an error type if there were any errors encountered. This is problematic, because it means a struct declared as `struct Foo<'static>` will end up not finding any inherent or trait impls because those impl blocks' `Self` type will be `{type error}` instead of `Foo<'re_error>`. Now it's the latter, silencing nonsensical follow-up errors about `Foo` not having any methods.
    
    Unfortunately that now allows for new follow-up errors, because borrowck treats `'re_error` as `'static`, causing nonsensical errors about non-error lifetimes not outliving `'static`. So what I also did was to just strip all outlives bounds that borrowck found, thus never letting it check them. There are probably more nuanced ways to do this, but I worried there would be other nonsensical errors if some outlives bounds were missing. Also from the test changes, it looked like an improvement everywhere.
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    5019bb6 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#125717 - weiznich:move/do_not_recommend_to_…

    …diganostic_namespace, r=compiler-errors
    
    Refactor `#[diagnostic::do_not_recommend]` support
    
    This commit refactors the `#[do_not_recommend]` support in the old parser to also apply to projection errors and not only to selection errors. This allows the attribute to be used more widely.
    
    Part of rust-lang#51992
    
    r? `@compiler-errors`
    
    <!--
    If this PR is related to an unstable feature or an otherwise tracked effort,
    please link to the relevant tracking issue here. If you don't know of a related
    tracking issue or there are none, feel free to ignore this.
    
    This PR will get automatically assigned to a reviewer. In case you would like
    a specific user to review your work, you can assign it to them by using
    
        r​? <reviewer name>
    -->
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    46a0339 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#125795 - lucasscharenbroch:undescore-prefix…

    …-suggestion, r=compiler-errors
    
    Improve renaming suggestion for names with leading underscores
    
    Fixes rust-lang#125650
    
    Before:
    ```
    error[E0425]: cannot find value `p` in this scope
     --> test.rs:2:13
      |
    2 |     let _ = p;
      |             ^
      |
    help: a local variable with a similar name exists, consider renaming `_p` into `p`
      |
    1 | fn a(p: i32) {
      |      ~
    ```
    
    After:
    ```
    error[E0425]: cannot find value `p` in this scope
     --> test.rs:2:13
      |
    1 | fn a(_p: i32) {
      |      -- `_p` defined here
    2 |     let _ = p;
      |             ^
      |
    help: the leading underscore in `_p` marks it as unused, consider renaming it to `p`
      |
    1 | fn a(p: i32) {
      |      ~
    ```
    
    This change doesn't exactly conform to what was proposed in the issue:
    
    1. I've kept the suggested code instead of solely replacing it with the label
    2. I've removed the "...similar name exists..." message instead of relocating to the usage span
    3. You could argue that it still isn't completely clear that the change is referring to the definition (not the usage), but I'm not sure how to do this without playing down the fact that the error was caused by the usage of an undefined name.
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    7e5528f View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#125865 - ajwock:ice_not_fully_resolved, r=f…

    …ee1-dead
    
    Fix ICE caused by ignoring EffectVars in type inference
    
    Fixes rust-lang#119830
    ​r? ```@matthiaskrgr```
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    7699da4 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#125953 - nnethercote:streamline-nested-call…

    …s, r=lqd
    
    Streamline `nested` calls.
    
    `TyCtxt` impls `PpAnn` in `compiler/rustc_middle/src/hir/map/mod.rs`. We can call that impl, which then calls the one on `intravisit::Map`, instead of calling the one on `intravisit::Map` directly, avoiding a cast and extra references.
    
    r? `@lqd`
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    23f39a2 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#125959 - nnethercote:rustc_mir_build-cleanu…

    …ps, r=compiler-errors
    
    Reduce `pub` exposure in `rustc_mir_build`
    
    r? compiler
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    8272c6d View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#125967 - BoxyUwU:split_smir_const, r=oli-obk

    Split smir `Const` into `TyConst` and `MirConst`
    
    Part of rust-lang#125958
    
    Building a `smir::Const` currently requires accessing the `Ty<'tcx>` of a `ty::Const`. This will stop being possible in the future. Replicate the split in rustc of having a representation of type level constants and mir constants with the latter being able to store the former. Ideally we wouldnt have `MirConst::Ty` but 🤷‍♀️
    
    r? `@oli-obk`
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    288727e View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#125968 - BoxyUwU:shrink_ty_expr, r=oli-obk

    Store the types of `ty::Expr` arguments in the `ty::Expr`
    
    Part of rust-lang#125958
    
    In attempting to remove the `ty` field on `Const` it will become necessary to store the `Ty<'tcx>` inside of `Expr<'tcx>`. In order to do this without blowing up the size of `ConstKind`, we start storing the type/const args as `GenericArgs`
    
    r? `@oli-obk`
    compiler-errors authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    a5dc684 View commit details
    Browse the repository at this point in the history