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 7 pull requests #113672

Closed
wants to merge 17 commits into from

Commits on Jul 10, 2023

  1. Configuration menu
    Copy the full SHA
    4965caf View commit details
    Browse the repository at this point in the history
  2. Only use max_line_length = 100 for *.rs

    This setting was added to match rustfmt, but it's been taking effect on
    all file editing, which I notice most on git `COMMIT_EDITMSG`. I want to
    keep my default 72-width commit messages, please. :)
    cuviper committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    a219505 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. Add jump to doc

    GuillaumeGomez committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    3fd36bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6d44879 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5cf570f View commit details
    Browse the repository at this point in the history
  4. make MCP510 behavior explicitly opt-in

    because sometimes users can't opt out
    lqd committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    2b61a5e View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. refactor proof tree formatting

    lcnr committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    f446894 View commit details
    Browse the repository at this point in the history
  2. typo

    lcnr committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    1b4b2e0 View commit details
    Browse the repository at this point in the history
  3. self type param infer, avoid ICE

    lcnr committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    cf78716 View commit details
    Browse the repository at this point in the history
  4. Add Adt to SMIR

    spastorino committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    c80a0f3 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#113536 - lcnr:proof-tree-select, r=BoxyUwU

    avoid building proof trees in select
    
    otherwise we ICE because select isn't currently set up to print proof trees.
    
    r? ````@BoxyUwU````
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    693063c View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#113558 - cuviper:rs100, r=Mark-Simulacrum

    Only use max_line_length = 100 for *.rs
    
    This setting was added to match rustfmt, but it's been taking effect on
    all file editing, which I notice most on git `COMMIT_EDITMSG`. I want to
    keep my default 72-width commit messages, please. :)
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    3cd3bba View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#113570 - lcnr:inspect-format, r=BoxyUwU

    refactor proof tree formatting
    
    mostly:
    - handle indentation via a separate formatter
    - change nested to use a closure
    
    tested it after rebasing on top of rust-lang#113536 and everything looks good.
    
    r? ````@BoxyUwU````
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    691b91f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#113623 - GuillaumeGomez:add-jump-to-doc, r=…

    …notriddle
    
    Add jump to doc
    
    I'm using the source code pages of the compiler quite a lot, but one thing missing is the possibility to jump back from the source code to the item documentation. Since I also got a few others complaining about it, I think it's fine to add it since this option is nightly only.
    
    This PR adds a link to jump back to item's documentation on the item definition (so on `Bar` in `struct Bar {... }`, as described in the unofficial [RFC](https://github.com/GuillaumeGomez/rfcs/blob/rustdoc-jump-to-definition/text/000-rustdoc-jump-to-definition.md)).
    
    r? ```@notriddle```
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    988558c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#113629 - spastorino:smir-types-3, r=oli-obk

    Add Adt to SMIR
    
    r? ```@oli-obk```
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    cf7f464 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#113631 - lqd:fix-113597, r=petrochenkov

    make MCP510 behavior opt-in to avoid conflicts between the CLI and target flavors
    
    Fixes rust-lang#113597, which contains more details on how this happens through the code, and showcases an unexpected `Gnu(Cc::Yes, Lld::Yes)` flavor.
    
    rust-lang#112910 added support to use `lld` when the flavor requests it, but didn't explicitly do so only when using `-Clink-self-contained=+linker` or one of the unstable `-Clinker-flavor`s.
    
    The problem: some targets have a `lld` linker and flavor, e.g. `thumbv6m-none-eabi` from that issue. Users can override the linker but there are no linker flavors precise enough to describe the linker opting out of lld: when using `-Clinker=arm-none-eabi-gcc`, we infer this is a `Cc::Yes` linker flavor, but the `lld` component is unknown and therefore defaulted to the target's linker flavor, `Lld::Yes`.
    
    <details>
    <summary>Walkthrough of how this happens</summary>
    
    The linker flavor used is a mix between what can be inferred from the CLI (`-C linker`) and the target's default linker flavor:
    
    - there is no linker flavor on the CLI (and that also offers another workaround on nightly: `-C linker-flavor=gnu-cc -Zunstable-options`), so it will have to be inferred [from here](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_codegen_ssa/src/back/link.rs#L1334-L1336) to [here](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_codegen_ssa/src/back/link.rs#L1321-L1327).
    - in [`infer_linker_hints`](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_target/src/spec/mod.rs#L320-L352) `-C linker=arm-none-eabi-gcc` infers a `Some(Cc::Yes)` cc hint, and no hint about lld.
    - the target's `linker_flavor` is combined in `with_cli_hints` with these hints. We have our `Cc::Yes`, but there is no hint about lld, [so the target's flavor `lld` component is used](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_target/src/spec/mod.rs#L356-L358). It's [`Gnu(Cc::No, Lld::Yes)`](https://github.com/rust-lang/rust/blob/993deaa0bf8bab9dd3eadfd1fbeb093328e95afe/compiler/rustc_target/src/spec/thumb_base.rs#L35).
    - so we now have our `Gnu(Cc::Yes, Lld::Yes)` flavor
    
    </details>
    
    This results in a `Gnu(Cc::Yes, Lld::Yes)` flavor on a non-lld linker, causing an additional unexpected `-fuse-ld=lld` argument to be passed.
    
    I don't know if this target defaulting to `rust-lld` is expected, but until MCP510's new linker flavor are stable, when people will be able to describe their linker/flavor accurately, this PR keeps the stable behavior of not doing anything when the linker/flavor on the CLI unexpectedly conflict with the target's.
    
    I've tested this on a `no_std` `-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles --target thumbv6m-none-eabi` example, trying to simulate one of `cortex-m`'s test mentioned in issue rust-lang#113597 (I don't know how to build a local complete  `thumbv6m-none-eabi` toolchain to run the exact test), and checked that `-fuse-lld` was indeed gone and the error disappeared.
    
    r? ````@petrochenkov````
    matthiaskrgr authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    6d6bf6c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f34365d View commit details
    Browse the repository at this point in the history