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 5 pull requests #108237

Merged
merged 16 commits into from
Feb 19, 2023
Merged

Rollup of 5 pull requests #108237

merged 16 commits into from
Feb 19, 2023

Commits on Feb 17, 2023

  1. Change src/etc/vscode_settings.json to always treat ./library as the …

    …sysroot source
    
    See
    https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/False.20error.20report.20for.20.60rust-analyzer.28private-field.29.60
    for further discussion; previously this had various bugs.
    
    I tested go-to-definition on:
    - `use std::io::Write` in `src/bootstrap/setup.rs`
    - `use std::cell::RefCell` in `src/librustdoc/core.rs`
    - `use rustc_span::symbol::sym` in `src/librustdoc/core.rs`
    - `use std::fmt` in `compiler/rustc_span/src/symbol.rs`
    - `Global` in `library/alloc/src/alloc/tests.rs`
    
    The following things still don't work:
    - `Global.deallocate` in alloc/tests.rs. This function is under
      `cfg(not(test))`, so it can't be enabled without disabling RA in
      `tests.rs` altogether. I think this might be fixable by moving
      `library/alloc/src/alloc/tests.rs` to
      `library/alloc/tests/alloc/lib.rs`, so it's in a different crate, but
      I'd like to avoid blocking this improvement on that change.
    jyn514 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    6209e6c View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2023

  1. Configuration menu
    Copy the full SHA
    0541a0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d47d7c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3adc081 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ae875f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    be55ad5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d42a3fb View commit details
    Browse the repository at this point in the history
  7. Add test

    compiler-errors committed Feb 18, 2023
    Configuration menu
    Copy the full SHA
    3e57b20 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fd62036 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8d801fd View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2023

  1. Configuration menu
    Copy the full SHA
    cd3d4fc View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#107766 - GuillaumeGomez:fix-json-reexports-…

    …of-different-items-with-same-name, r=aDotInTheVoid
    
    Fix json reexports of different items with same name
    
    Fixes  rust-lang#107677.
    
    I renamed `from_item_id*` functions into `id_from_item` instead because it makes more sense now. I also simplified the logic around it a bit so that the `ids` function will now directly pass `&clean::Item` to `id_from_item` and the ID will be consistently generated (it caused an issue when I updated the ID for imports).
    
    So now, the big change of this PR: I changed how imports' ID is generated: it now includes the target item's ID at the end of the ID. It's to prevent two reexported items with the same name (but different types).
    
    r? `@aDotInTheVoid`
    GuillaumeGomez authored Feb 19, 2023
    Configuration menu
    Copy the full SHA
    49d7ed1 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#108129 - GuillaumeGomez:correctly-handle-li…

    …nks-starting-with-whitespace, r=petrochenkov
    
    Correctly handle links starting with whitespace
    
    Part of rust-lang#107995.
    
    I just got this issue, wrote a fix and then saw the issue. So here's the PR. ^^'
    
    r? `@petrochenkov`
    GuillaumeGomez authored Feb 19, 2023
    Configuration menu
    Copy the full SHA
    bd63edc View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#108188 - jyn514:ra-sysroot, r=albertlarsan68

    Change src/etc/vscode_settings.json to always treat ./library as the sysroot source
    
    See
    https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/False.20error.20report.20for.20.60rust-analyzer.28private-field.29.60 for further discussion; previously this had various bugs.
    
    I tested go-to-definition on:
    - `use std::io::Write` in `src/bootstrap/setup.rs`
    - `use std::cell::RefCell` in `src/librustdoc/core.rs`
    - `use rustc_span::symbol::sym` in `src/librustdoc/core.rs`
    - `use std::fmt` in `compiler/rustc_span/src/symbol.rs`
    - `Global` in `library/alloc/src/alloc/tests.rs`
    
    The following things still don't work:
    - `Global.deallocate` in alloc/tests.rs. This function is under `cfg(not(test))`, so it can't be enabled without disabling RA in `tests.rs` altogether. I think this might be fixable by moving `library/alloc/src/alloc/tests.rs` to `library/alloc/tests/alloc/lib.rs`, so it's in a different crate, but I'd like to avoid blocking this improvement on that change.
    
    cc `@thomcc` `@BoxyUwU` `@spastorino` - you've had issues with RA in the past, does this fix them? Are there any other use cases I should test? You can try these changes out by running `cp src/etc/vscode_settings.json .vscode/settings.json`, or running `x setup` and picking a random profile (it won't overwrite config.toml if it already exists). See rust-lang#108135 for plans to make updating the config easier.
    
    r? `@Veykril`
    GuillaumeGomez authored Feb 19, 2023
    Configuration menu
    Copy the full SHA
    243dcd0 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#108203 - compiler-errors:rpitit-fix-default…

    …s-2, r=jackh726
    
    Fix RPITITs in default trait methods (by assuming projection predicates in param-env)
    
    Instead of having special projection logic that allows us to turn `ProjectionTy(RPITIT, [Self#0, ...])` into `OpaqueTy(RPITIT, [Self#0, ...])`, we can instead augment the param-env of default trait method bodies to assume these as projection predicates. This should allow us to only project where we're allowed to!
    
    In order to make this work without introducing a bunch of cycle errors, we additionally tweak the `OpaqueTypeExpander` used by `ParamEnv::with_reveal_all_normalized` to not normalize the right-hand side of projection predicates. This should be fine, because if we use the projection predicate to normalize some other projection type, we'll continue to normalize the opaque that it gets projected to.
    
    This also makes it possible to support default trait methods with RPITITs in an associated-type based RPITIT lowering strategy without too much extra effort.
    
    Fixes rust-lang#107002
    Alternative to rust-lang#108142
    GuillaumeGomez authored Feb 19, 2023
    Configuration menu
    Copy the full SHA
    d2aef58 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#108212 - KittyBorgX:master, r=jyn514

    Download rustfmt regardless of rustc being set in config.toml
    
    Fixes rust-lang#81155
    
    cc : rust-lang#108210 for exact error details
    GuillaumeGomez authored Feb 19, 2023
    Configuration menu
    Copy the full SHA
    24d907a View commit details
    Browse the repository at this point in the history