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 10 pull requests #94134

Merged
merged 25 commits into from
Feb 19, 2022
Merged

Rollup of 10 pull requests #94134

merged 25 commits into from
Feb 19, 2022

Commits on Feb 9, 2022

  1. mips64-openwrt-linux-musl: correct soft-foat

    MIPS64 targets under OpenWrt require soft-float fpu support.
    
    Rust-lang requires soft-float defined in tuple definition and
    isn't over-ridden by toolchain compile-time CFLAGS/LDFLAGS
    
    Set explicit soft-float for tuple.
    
    Signed-off-by: Donald Hoskins <[email protected]>
    Grommish committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    bfd16ab View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2022

  1. kmc-solid: Use the filesystem thread-safety wrapper

    Neither the SOLID filesystem API nor built-in filesystems guarantee
    thread safety by default. Although this may suffice in general embedded-
    system use cases, and in fact the API can be used from multiple threads
    without any problems in many cases, this has been a source of
    unsoundness in `std::sys::solid::fs`.
    
    This commit updates the `std` code to leverage the filesystem thread-
    safety wrapper to enforce thread safety. This is done by prefixing all
    paths passed to the filesystem API with `\TS`. (Note that relative paths
    aren't supported in this platform.)
    kawadakk committed Feb 10, 2022
    Configuration menu
    Copy the full SHA
    64406c5 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2022

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

Commits on Feb 12, 2022

  1. Configuration menu
    Copy the full SHA
    fbbcb08 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7c6ff4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e660d52 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5aae654 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

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

Commits on Feb 15, 2022

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

Commits on Feb 16, 2022

  1. Implement --check-cfg option (RFC 3013)

    Co-authored-by: Urgau <[email protected]>
    Co-authored-by: Marcelina Kościelnicka <[email protected]>
    Urgau and mwkmwkmwk committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    3a73ca5 View commit details
    Browse the repository at this point in the history
  2. MemTagSanitizer Support

    Adds support for the LLVM MemTagSanitizer.
    ivanloz committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    568aeda View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2022

  1. Configuration menu
    Copy the full SHA
    f04f732 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    207fb5f View commit details
    Browse the repository at this point in the history
  3. Suggest impl Trait return type

    Address rust-lang#85991
    
    Suggest the `impl Trait` return type syntax if the user tried to return a generic parameter and we get a type mismatch
    
    The suggestion is not emitted if the param appears in the function parameters, and only get the bounds that actually involve `T: ` directly
    
    It also checks whether the generic param is contained in any where bound (where it isn't the self type), and if one is found (like `Option<T>: Send`), it is not suggested.
    
    This also adds `TyS::contains`, which recursively vistits the type and looks if the other type is contained anywhere
    Noratrieb committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    4bed748 View commit details
    Browse the repository at this point in the history
  4. asm: Allow the use of r8-r14 as clobbers on Thumb1

    Previously these were entirely disallowed, except for r11 which was
    allowed by accident.
    Amanieu committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    11250b8 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#89892 - Nilstrieb:suggest-return-impl-trait…

    …, r=jackh726
    
    Suggest `impl Trait` return type when incorrectly using a generic return type
    
    Address rust-lang#85991
    
    When there is a type mismatch error and the return type is generic, and that generic parameter is not used in the function parameters, suggest replacing that generic with the `impl Trait` syntax.
    
    r? `@estebank`
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    f8b83a2 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#91675 - ivanloz:memtagsan, r=nagisa

    Add MemTagSanitizer Support
    
    Add support for the LLVM [MemTagSanitizer](https://llvm.org/docs/MemTagSanitizer.html).
    
    On hardware which supports it (see caveats below), the MemTagSanitizer can catch bugs similar to AddressSanitizer and HardwareAddressSanitizer, but with lower overhead.
    
    On a tag mismatch, a SIGSEGV is signaled with code SEGV_MTESERR / SEGV_MTEAERR.
    
    # Usage
    
    `-Zsanitizer=memtag -C target-feature="+mte"`
    
    # Comments/Caveats
    
    * MemTagSanitizer is only supported on AArch64 targets with hardware support
    * Requires `-C target-feature="+mte"`
    * LLVM MemTagSanitizer currently only performs stack tagging.
    
    # TODO
    
    * Tests
    * Example
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    0bb72a2 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#92806 - compiler-errors:better-impl-trait-d…

    …eny, r=estebank
    
    Add more information to `impl Trait` error
    
    Fixes rust-lang#92458
    
    Let me know if I went overboard here, or if the suggestions could use some refinement.
    
    r? `@estebank`
    Feel free to reassign to someone else
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    5c08c39 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#93497 - willcrichton:rustdoc-scrape-test, r…

    …=GuillaumeGomez
    
    Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped
    
    As a part of stabilizing the scrape examples extension in Cargo, I uncovered a bug where examples cannot be scraped from tests. See this test: https://github.com/rust-lang/cargo/pull/10343/files#diff-27aa4f012ebfebaaee61498d91d2370de460628405d136b05e77efe61e044679R2496
    
    The issue is that when rustdoc is run on a test file, because `--test` is not passed as a rustc option, then functions annotated with `#[test]` are ignored by the compiler. So this PR changes rustdoc so when `--test` is passed in conjunction with a `--scrape-example-<suffix>` flag, then the `test` field of `rustc_interface::Config` is true.
    
    r? `@camelid`
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    e3a1e19 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#93814 - Itus-Shield:mips64-openwrt, r=bjorn3

    mips64-openwrt-linux-musl: correct soft-foat
    
    MIPS64 targets under OpenWrt require soft-float fpu support.
    
    Rust-lang requires soft-float defined in tuple definition and
    isn't over-ridden by toolchain compile-time CFLAGS/LDFLAGS
    
    Set explicit soft-float for tuple.
    
    Signed-off-by: Donald Hoskins <[email protected]>
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    32c8acd View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#93847 - solid-rs:fix-kmc-solid-fs-ts, r=yaahc

    kmc-solid: Use the filesystem thread-safety wrapper
    
    Fixes the thread unsafety of the `std::fs` implementation used by the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.
    
    Neither the SOLID filesystem API nor built-in filesystem drivers guarantee thread safety by default. Although this may suffice in general embedded-system use cases, and in fact the API can be used from multiple threads without any problems in many cases, this has been a source of unsoundness in `std::sys::solid::fs`.
    
    This commit updates the implementation to leverage the filesystem thread-safety wrapper (which uses a pluggable synchronization mechanism) to enforce thread safety. This is done by prefixing all paths passed to the filesystem API with `\TS`. (Note that relative paths aren't supported in this platform.)
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    724cca6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#93877 - Amanieu:asm_fixes, r=nagisa

    asm: Allow the use of r8-r14 as clobbers on Thumb1
    
    Previously these were entirely disallowed, except for r11 which was allowed by accident.
    
    cc `@hudson-ayers`
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    cb35370 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#93892 - compiler-errors:issue-92917, r=jack…

    …h726,nikomatsakis
    
    Only mark projection as ambiguous if GAT substs are constrained
    
    A slightly more targeted version of rust-lang#92917, where we only give up with ambiguity if we infer something about the GATs substs when probing for a projection candidate.
    
    fixes rust-lang#93874
    also note (but like the previous PR, does not fix) rust-lang#91762
    
    r? `@jackh726`
    cc `@nikomatsakis` who reviewed rust-lang#92917
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    1e2f63d View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#93915 - Urgau:rfc-3013, r=petrochenkov

    Implement --check-cfg option (RFC 3013), take 2
    
    This pull-request implement RFC 3013: Checking conditional compilation at compile time (rust-lang/rfcs#3013) and is based on the previous attempt rust-lang#89346 by `@mwkmwkmwk` that was closed due to inactivity.
    
    I have address all the review comments from the previous attempt and added some more tests.
    
    cc rust-lang#82450
    r? `@petrochenkov`
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    576afec View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#93953 - jackh726:known_bug, r=Mark-Simulacrum

    Add the `known-bug` test directive, use it, and do some cleanup
    
    cc rust-lang/compiler-team#476
    
    Now tests can be annotated with `known-bug`, which should indicate that the test *should* pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort.
    
    I've used this attribute for the GAT tests added in rust-lang#93757.
    
    Finally, I've also cleaned up `header.rs` in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions from `Config` and makes `TestProps::load_from` read nicer.
    
    I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward.
    
    r? ``@Mark-Simulacrum``
    matthiaskrgr authored Feb 18, 2022
    Configuration menu
    Copy the full SHA
    620b0c5 View commit details
    Browse the repository at this point in the history