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 9 pull requests #130671

Closed
wants to merge 32 commits into from

Commits on Sep 11, 2024

  1. rustc_expand: remember module #[path]s during expansion

    this fixes cycle detection for modules that need a second invocation collection pass after parsing
    dianne committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    9a7644e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a187d0a View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2024

  1. Avoid re-validating UTF-8 in FromUtf8Error::into_utf8_lossy

    Refactor `into_utf8_lossy` to copy valid UTF-8 bytes into the buffer,
    avoiding double validation of bytes.
    Add tests that mirror the `String::from_utf8_lossy` tests
    okaneco committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    b94c5a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6d788a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    19881b5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    51b51bb View commit details
    Browse the repository at this point in the history
  5. Flesh out some TODOs

    compiler-errors committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    7c8e281 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    174c3f9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    af24d0b View commit details
    Browse the repository at this point in the history
  8. Add --enable-profiler to armhf dist

    Adds the --enable-profiler flag to the RUST_CONFIGURE_ARGS for armhf distribution for Linux.  This enables running coverage for tests
    qwertynerd97 authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    50b8915 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b94f293 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1ddd67a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5722a80 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a33dcb3 View commit details
    Browse the repository at this point in the history
  13. Add assembly test for the cmse unstable features

    verifies that the correct return instructions are emitted.
    
    Co-authored-by: Tamme Dittrich <tamme@tweedegolf.com>
    folkertdev and tdittr committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    a41c209 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4d75a4f View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ac9a49f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    1de894f View commit details
    Browse the repository at this point in the history
  17. Update Tests

    veera-sivarajan committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    a35da65 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    669f610 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    93993c7 View commit details
    Browse the repository at this point in the history
  20. Assert that explicit_super_predicates_of and explicit_item_bounds tru…

    …ly only bounds for the type itself
    compiler-errors committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    a846d55 View commit details
    Browse the repository at this point in the history
  21. Don't elaborate effects predicates into bounds list unless we're actu…

    …ally collecting implied bounds, not super bounds
    compiler-errors committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    4f3d06f View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#127766 - folkertdev:c-cmse-nonsecure-entry,…

    … r=jackh726
    
    add `extern "C-cmse-nonsecure-entry" fn`
    
    tracking issue rust-lang#75835
    
    in rust-lang#75835 (comment) it was decided that using an abi, rather than an attribute, was the right way to go for this feature.
    
    This PR adds that ABI and removes the `#[cmse_nonsecure_entry]` attribute. All relevant tests have been updated, some are now obsolete and have been removed.
    
    Error 0775 is no longer generated. It contains the list of targets that support the CMSE feature, and maybe we want to still use this? right now a generic "this abi is not supported on this platform" error is returned when this abi is used on an unsupported platform. On the other hand, users of this abi are likely to be experienced rust users, so maybe the generic error is good enough.
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    bc8631e View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#129629 - compiler-errors:rtn-in-path, r=jac…

    …kh726
    
    Implement Return Type Notation (RTN)'s path form in where clauses
    
    Implement return type notation (RTN) in path position for where clauses. We already had RTN in associated type position ([e.g.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=627a4fb8e2cb334863fbd08ed3722c09)), but per [the RFC](https://rust-lang.github.io/rfcs/3654-return-type-notation.html#where-rtn-can-be-used-for-now):
    
    > As a standalone type, RTN can only be used as the Self type of a where-clause [...]
    
    Specifically, in order to enable code like:
    
    ```rust
    trait Foo {
        fn bar() -> impl Sized;
    }
    
    fn is_send(_: impl Send) {}
    
    fn test<T>()
    where
        T: Foo,
        T::bar(..): Send,
    {
        is_send(T::bar());
    }
    ```
    
    * In the resolver, when we see a `TyKind::Path` whose final segment is `GenericArgs::ParenthesizedElided` (i.e. `(..)`), resolve that path in the *value* namespace, since we're looking for a method.
    * When lowering where clauses in HIR lowering, we first try to intercept an RTN self type via `lower_ty_maybe_return_type_notation`. If we find an RTN type, we lower it manually in a way that respects its higher-ranked-ness (see below) and resolves to the corresponding RPITIT. Anywhere else, we'll emit the same "return type notation not allowed in this position yet" error we do when writing RTN in every other position.
    * In `resolve_bound_vars`, we add some special treatment for RTN types in where clauses. Specifically, we need to add new lifetime variables to our binders for the early- and late-bound vars we encounter on the method. This implements the higher-ranked desugaring [laid out in the RFC](https://rust-lang.github.io/rfcs/3654-return-type-notation.html#converting-to-higher-ranked-trait-bounds).
    
    This PR also adds a bunch of tests, mostly negative ones (testing error messages).
    
    In a follow-up PR, I'm going to mark RTN as no longer incomplete, since this PR basically finishes the impl surface that we should initially stabilize, and the RFC was accepted.
    
    cc [RFC 3654](rust-lang/rfcs#3654) and rust-lang#109417
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    7b36e60 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#130246 - dianne:issue-97589-fix, r=petroche…

    …nkov
    
    rustc_expand: remember module `#[path]`s during expansion
    
    During invocation collection, if a module item parsed from a `#[path]` attribute needed a second pass after parsing, its path wouldn't get added to the file path stack, so cycle detection broke. This checks the `#[path]` in such cases, so that it gets added appropriately. I think it should work identically to the case for external modules that don't need a second pass, but I'm not 100% sure.
    
    Fixes rust-lang#97589
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    d4c78f2 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#130408 - okaneco:into_lossy_refactor, r=Nor…

    …atrieb
    
    Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`
    
    Part of the unstable feature `string_from_utf8_lossy_owned` - rust-lang#129436
    
    Refactor `FromUtf8Error::into_utf8_lossy` to copy valid UTF-8 bytes into the buffer, avoiding double validation of bytes.
    Add tests that mirror the `String::from_utf8_lossy` tests.
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    6d76140 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#130651 - qwertynerd97:patch-1, r=Kobzol

    Add --enable-profiler to armhf dist
    
    Adds the --enable-profiler flag to the RUST_CONFIGURE_ARGS for armhf distribution for Linux.  This enables running coverage for tests in builds for this target
    
    try-job: dist-armhf-linux
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    9df13d0 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#130653 - RalfJung:result-abi-compat, r=trav…

    …iscross
    
    ABI compatibility: mention Result guarantee
    
    This has been already documented in https://doc.rust-lang.org/std/result/index.html#representation, but for `Option` we mirrored those docs in the "ABI compatibility" section, so let's do the same here.
    
    Cc `@workingjubilee` `@rust-lang/lang`
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    6fde507 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#130665 - veera-sivarajan:fix-118612, r=comp…

    …iler-errors
    
    Prevent Deduplication of `LongRunningWarn`
    
    Fixes rust-lang#118612
    
    As mention in the issue, `LongRunningWarn` is meant to be repeated multiple times.
    
    Therefore, this PR stores a unique number in every instance of `LongRunningWarn` so that it's not hashed into the same value and omitted by the deduplication mechanism.
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    c261642 View commit details
    Browse the repository at this point in the history
  29. Rollup merge of rust-lang#130666 - compiler-errors:super-bounds, r=fe…

    …e1-dead,fmease
    
    Assert that `explicit_super_predicates_of` and `explicit_item_super_predicates` truly only contains bounds for the type itself
    
    We distinguish _implied_ predicates (anything that is implied from elaborating a trait bound) from _super_ predicates, which are are the subset of implied predicates that share the same self type as the trait predicate we're elaborating. This was originally done in rust-lang#107614, which fixed a large class of ICEs and strange errors where the compiler expected the self type of a trait predicate not to change when elaborating super predicates.
    
    Specifically, super predicates are special for various reasons: they're the valid candidates for trait upcasting, are the only predicates we elaborate when doing closure signature inference, etc. So making sure that we get this list correct and don't accidentally "leak" any other predicates into this list is quite important.
    
    This PR adds some debug assertions that we're in fact not doing so, and it fixes an oversight in the effect desugaring rework.
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    653e9a2 View commit details
    Browse the repository at this point in the history
  30. Rollup merge of rust-lang#130667 - workingjubilee:she-is-c-c-c-cold, …

    …r=compiler-errors
    
    compiler: Accept "improper" ctypes in extern "rust-cold" fn
    matthiaskrgr authored Sep 21, 2024
    Configuration menu
    Copy the full SHA
    0fc976d View commit details
    Browse the repository at this point in the history