about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-11-12Rollup merge of #132938 - compiler-errors:ed2024-apit-sugg, r=chenyukangMatthias Krüger-0/+52
Make precise capturing suggestion machine-applicable only if it has no APITs cc https://github.com/rust-lang/rust/issues/132932 The only case where this suggestion is not machine-applicable is when we suggest turning arg-position impl trait into type parameters, which may expose type parameters that were not turbofishable before.
2024-11-12Rollup merge of #132901 - clubby789:enable-pass-check, r=jieyouxuMatthias Krüger-0/+47
Warn about invalid `mir-enable-passes` pass names Fixes #132805
2024-11-12Rollup merge of #132541 - RalfJung:const-stable-extern-crate, r=compiler-errorsMatthias Krüger-39/+158
Proper support for cross-crate recursive const stability checks ~~Stacked on top of https://github.com/rust-lang/rust/pull/132492; only the last three commits are new.~~ In a crate without `staged_api` but with `-Zforce-unstable-if-unmarked`, we now subject all functions marked with `#[rustc_const_stable_indirect]` to recursive const stability checks. We require an opt-in so that by default, a crate can be built with `-Zforce-unstable-if-unmarked` and use nightly features as usual. This property is recorded in the crate metadata so when a `staged_api` crate calls such a function, it sees the `#[rustc_const_stable_indirect]` and allows it to be exposed on stable. This, finally, will let us expose `const fn` from hashbrown on stable. The second commit makes const stability more like regular stability: via `check_missing_const_stability`, we ensure that all publicly reachable functions have a const stability attribute -- both in `staged_api` crates and `-Zforce-unstable-if-unmarked` crates. To achieve this, we move around the stability computation so that const stability is computed after regular stability is done. This lets us access the final result of the regular stability computation, which we use so that `const fn` can inherit the regular stability (but only if that is "unstable"). Fortunately, this lets us get rid of an `Option` in `ConstStability`. This is the last PR that I have planned in this series. r? `@compiler-errors`
2024-11-12Validate and test `-Zmir-enable-passes`clubby789-0/+47
2024-11-12Auto merge of #132943 - matthiaskrgr:rollup-164l3ej, r=matthiaskrgrbors-227/+182
Rollup of 8 pull requests Successful merges: - #132651 (Remove attributes from generics in built-in derive macros) - #132668 (Feature gate yield expressions not in 2024) - #132771 (test(configure): cover `parse_args` in `src/bootstrap/configure.py`) - #132895 (Generalize `NonNull::from_raw_parts` per ACP362) - #132914 (Update grammar in std::cell docs.) - #132927 (Consolidate type system const evaluation under `traits::evaluate_const`) - #132935 (Make sure to ignore elided lifetimes when pointing at args for fulfillment errors) - #132941 (Subtree update of `rust-analyzer`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-12Rollup merge of #132935 - compiler-errors:arg-math, r=nnethercoteMatthias Krüger-9/+26
Make sure to ignore elided lifetimes when pointing at args for fulfillment errors See the comment I left in the code. --- If we have something like: ``` fn foo<'a, T: 'a + BoundThatIsNotSatisfied>() {} ``` And the user turbofishes just the type args: ``` foo::<()>(); ``` Then if we try pointing at `()` (i.e. the type argument for `T`), we don't actually consider the possibility that the lifetimes may have been left out of the turbofish. We try indexing incorrectly into the HIR args, and bail on the suggestion.
2024-11-12Rollup merge of #132927 - BoxyUwU:consolidate_type_system_const_eval, ↵Matthias Krüger-213/+80
r=compiler-errors Consolidate type system const evaluation under `traits::evaluate_const` Part of #130704 Fixes #128232 Fixes #118545 Removes `ty::Const::{normalize_internal, eval_valtree}` and `InferCtxt::(try_)const_eval_resolve`, consolidating the associated logic into `evaluate_const` in `rustc_trait_selection`. This results in an API for `ty::Const` that is free of any normalization/evaluation functions that would be incorrect to use under `min_generic_const_args`/`associated_const_equality`/`generic_const_exprs` or, more generally, that would be incorrect to use in the presence of generic type system constants. Moving this logic to `rustc_trait_selection` and out of `rustc_middle` is also a pre-requisite for ensuring that we do not evaluate constants whose where clauses do not hold. From this point it should be relatively simple (hah) to implement more complex normalization of type system constants such as: checking wf'ness before invoking CTFE machinery, or being able to normalize const aliases that still refer to generic parameters. r? `@compiler-errors`
2024-11-12Rollup merge of #132668 - ehuss:yield-gate-2024, r=davidtwcoMatthias Krüger-5/+45
Feature gate yield expressions not in 2024 This changes it so that yield expressions are no longer allowed in the 2024 edition without a feature gate. We are currently only reserving the `gen` keyword in the 2024 edition, and not allowing anything else to be implicitly enabled by the edition. In practice this doesn't have a significant difference since yield expressions can't really be used outside of coroutines or gen blocks, which have their own feature gates. However, it does affect what is accepted pre-expansion, and I would feel more comfortable not allowing yield expressions. I believe the stabilization process for gen blocks or coroutines will not need to check the edition here, so this shouldn't ever be needed.
2024-11-12Rollup merge of #132651 - PonasKovas:master, r=fmeaseMatthias Krüger-0/+31
Remove attributes from generics in built-in derive macros Related issue #132561 Removes all attributes from generics in the expanded implementations of built-in derive macros.
2024-11-12allow rustc_private feature in force-unstable-if-unmarked cratesRalf Jung-5/+3
2024-11-12Rollup merge of #132933 - compiler-errors:never-lint-arg-bug, r=WaffleLapkinMatthias Krüger-9/+117
Make sure that we suggest turbofishing the right type arg for never suggestion I had a bug where rust would suggest the wrong arg to turbofish `()` if there were any early-bound lifetimes... r? WaffleLapkin
2024-11-12Rollup merge of #132653 - BoxyUwU:const_arg_stmt_mac_call, r=compiler-errorsMatthias Krüger-13/+425
Don't use `maybe_unwrap_block` when checking for macro calls in a block expr Fixes #131915 Using `maybe_unwrap_block` to determine if we are looking at a `{ mac_call!{} }` will fail sometimes as `mac_call!{}` could be a `StmtKind::MacCall` not a `StmtKind::Expr`. This caused the def collector to think that `{ mac_call!{} }` was a non-trivial const argument and create a definition for it even though it should not. r? `@compiler-errors` cc `@camelid`
2024-11-12Rollup merge of #132487 - dianne:include-trait-args-in-suggestion, r=fmeaseMatthias Krüger-0/+93
Provide placeholder generics for traits in "no method found for type parameter" suggestions In the diagnostics for the error ``no method named `method` found for type parameter `T` in the current scope [E0599]``, the compiler will suggest adding bounds on `T` for traits that define a method named `method`. However, these suggestions didn't include any generic arguments, so applying them would result in a `missing generics for trait` or `missing lifetime specifier` error. This PR adds placeholder arguments to the suggestion in such cases. Specifically, I tried to base the placeholders off of what's done in suggestions for when generics are missing or too few are provided: - The placeholder for a parameter without a default is the name of the parameter. - Placeholders are not provided for parameters with defaults. Placeholder arguments are enclosed in `/*` and `*/`, and the applicability of the suggestion is downgraded to `Applicability::HasPlaceholders` if any placeholders are provided. Fixes #132407
2024-11-12Make precise capturing suggestion machine-applicable only if it has not APITsMichael Goulet-0/+52
2024-11-12Make sure that we suggest turbofishing the right type argMichael Goulet-9/+117
2024-11-12Consolidate type system const evaluation under `traits::evaluate_const`Boxy-213/+80
mew
2024-11-12Auto merge of #132919 - matthiaskrgr:rollup-ogghyvp, r=matthiaskrgrbors-2/+2
Rollup of 7 pull requests Successful merges: - #120077 (Add Set entry API ) - #132144 (Arbitrary self types v2: (unused) Receiver trait) - #132297 (Document some `check_expr` methods, and other misc `hir_typeck` tweaks) - #132820 (Add a default implementation for CodegenBackend::link) - #132881 (triagebot: Autolabel rustdoc book) - #132912 (Simplify some places that deal with generic parameter defaults) - #132916 (Unvacation fmease) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-12Make sure to ignore elided lifetimes when pointing at args for fulfillment ↵Michael Goulet-9/+26
errors
2024-11-11Rollup merge of #132820 - bjorn3:default_backend_link_impl, r=jieyouxuMatthias Krüger-2/+2
Add a default implementation for CodegenBackend::link As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.
2024-11-11Provide placeholder generic arguments for traits in "no method found for ↵dianne-0/+93
type parameter" suggestions
2024-11-11Auto merge of #132902 - matthiaskrgr:rollup-43qgg3t, r=matthiaskrgrbors-6/+21
Rollup of 4 pull requests Successful merges: - #129627 (Ensure that tail expr receive lifetime extension) - #130999 (Implement file_lock feature) - #132873 (handle separate prefixes in clippy rules) - #132891 (Remove `rustc_session::config::rustc_short_optgroups`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-11remove attributes from generics in built-in derive macrosPonasKovas-0/+31
add a test add github issue link to description of the test replace new ThinVec with clear() Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2024-11-11Rollup merge of #129627 - ↵Matthias Krüger-6/+21
dingxiangfei2009:ensure-tail-expr-in-let-block-works, r=jieyouxu Ensure that tail expr receive lifetime extension cc `@jieyouxu` `@traviscross` It just came to me that we should add a test to make sure that we honor the contract from the temporary lifetime rule #121346. We should continue to implement this rule in Edition 2021 onward and shorter tail expression lifetime should not override it. This is a small PR to improve our assurance and establish a stronger contract. Tracked by rust-lang/rust#123739
2024-11-11Feature gate yield expressions not in 2024Eric Huss-5/+45
2024-11-11ensure that tail expr receive lifetime extensionDing Xiang Fei-6/+21
2024-11-11Auto merge of #127589 - notriddle:notriddle/search-sem-3, r=GuillaumeGomezbors-603/+852
rustdoc-search: simplify rules for generics and type params **Heads up!**: This PR is a follow-up that depends on #124544. It adds 12dc24f46007f82b93ed85614347a42d47580afa, a change to the filtering behavior, and 9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca, a minor ranking tweak. Part of https://github.com/rust-lang/rust-project-goals/issues/112 This PR overturns https://github.com/rust-lang/rust/pull/109802 ## Preview * no results: [`Box<[A]> -> Vec<B>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CB%3E) * results: [`Box<[A]> -> Vec<A>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CA%3E) * [`T -> U`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=T%20-%3E%20U) * [`Cx -> TyCtxt`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3-compiler/rustdoc/index.html?search=Cx%20-%3E%20TyCtxt) ![image](https://github.com/user-attachments/assets/015ae28c-7469-4f7f-be03-157d28d7ec97) ## Description This commit is a response to feedback on the displayed type signatures results, by making generics act stricter. - Order within generics is significant. This means `Vec<Allocator>` now matches only with a true vector of allocators, instead of matching the second type param. It also makes unboxing within generics stricter, so `Result<A, B>` only matches if `B` is in the error type and `A` is in the success type. The top level of the function search is unaffected. - Generics are only "unboxed" if a type is explicitly opted into it. References and tuples are hardcoded to allow unboxing, and Box, Rc, Arc, Option, Result, and Future are opted in with an unstable attribute. Search result unboxing is the process that allows you to search for `i32 -> str` and get back a function with the type signature `&Future<i32> -> Box<str>`. - Instead of ranking by set overlap, it ranks by the number of items in the type signature. This makes it easier to find single type signatures like transmute. ## Find the discussion on * <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149> * <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265> * <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search>
2024-11-11Auto merge of #132885 - jhpratt:rollup-4ddd31p, r=jhprattbors-2/+62
Rollup of 3 pull requests Successful merges: - #131080 (Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features) - #132871 (add regression test for #85763) - #132878 (triagebot: Assign rustdoc tests to T-rustdoc.) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Rollup merge of #132871 - ↵Jacob Pratt-0/+11
lolbinarycat:rustdoc-heterogeneous-first-paragraph-85763, r=aDotInTheVoid add regression test for #85763 closes #85763
2024-11-10Rollup merge of #131080 - alexcrichton:stabilize-more-wasm-target-features, ↵Jacob Pratt-2/+51
r=petrochenkov Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features For the `multivalue` and `reference-types` features this commit is similar to https://github.com/rust-lang/rust/pull/117457 in that it's stabilizing target features specific to WebAssembly targets. The previous PR left out these two features because they weren't expected to change much about compiled code so it was unclear what the rationale was. It has [since been discovered][blog] that `reference-types` can be useful as it changes the binary format of the `call_indirect` instruction. Additionally [on Zulip][zulip] there's a use case of detecting these features at compile time and generating a compile error to better warn users about features not supported on engines. This PR then additionally adds the `tail-call` feature which corresponds to the [tail-call] proposal to WebAssembly. This feature advanced to "phase 4" in the WebAssembly CG awhile back and has been supported in LLVM for quite some time now. Engines are finishing up implementations or have already shipped implementations, so while this is a bit of a late addition to Rust itself it reflects the current status of WebAssembly's state of the feature. A test has been added here not only for these features but other WebAssembly features as well to showcase that they're usable without feature gates in stable Rust. [blog]: https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/wasm32.20reference-types.20.2F.20multivalue.20in.201.2E82-beta.20not.20enabled/near/473893987 [tail-call]: https://github.com/webassembly/tail-call
2024-11-11Auto merge of #126597 - estebank:unicode-output, r=fmeasebors-32/+398
Add Unicode block-drawing compiler output support Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI. In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in. After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ``` After: ![rustc output with unicode box drawing characters](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25) Before: ![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-10Add Unicode block-drawing compiler output supportEsteban Küber-32/+398
Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI: After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ```
2024-11-10Rollup merge of #132426 - Urgau:unreach_pub-super, r=petrochenkovMatthias Krüger-15/+287
Prefer `pub(super)` in `unreachable_pub` lint suggestion This PR updates the `unreachable_pub` lint suggestion to prefer `pub(super)` instead of `pub(crate)` when possible. cc `@petrochenkov` r? `@nnethercote`
2024-11-10Rollup merge of #131781 - taiki-e:arm64ec-stabilize-asm, r=Amanieu,traviscrossMatthias Krüger-3/+3
Stabilize Arm64EC inline assembly This stabilizes inline assembly for Arm64EC ("Emulation Compatible"). Corresponding reference PR: https://github.com/rust-lang/reference/pull/1653 --- From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335 > Each architecture needs to be reviewed before stabilization: > - It must have clobber_abi. Done in https://github.com/rust-lang/rust/pull/131332. > - It must be possible to clobber every register that is normally clobbered by a function call. This is possible from the time of the initial implementation. > - Generally review that the exposed register classes make sense. The registers available in this target are a subset of those available in the AArch64 inline assembly which is already stable. The following registers cannot be used in Arm64EC compared to AArch64: - `x13`, `x14`, `x23`, `x24`, `x28` (register class: `reg`) - `v[16-31]` (register class: `vreg`) - `p[0-15]`, `ffr` (clobber-only register class `preg`) These are disallowed by the ABI (see also [abi docs](https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170#register-mapping) for `reg`/`vreg` and https://github.com/rust-lang/rust/pull/131332#issuecomment-2401189142 for `preg`). Although not listed in the above requirements, preserves_flags is also implemented and the same as AArch64. --- cc `@dpaoliello` r? `@Amanieu` `@rustbot` label O-windows O-AArch64 +A-inline-assembly +T-lang -T-compiler +needs-fcp
2024-11-10add regression test for #85763binarycat-0/+11
2024-11-10Auto merge of #132863 - matthiaskrgr:rollup-1zbjz5f, r=matthiaskrgrbors-178/+181
Rollup of 3 pull requests Successful merges: - #132675 (coverage: Restrict empty-span expansion to only cover `{` and `}`) - #132849 (Miri subtree update) - #132858 (Update minifer version to `0.3.2`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxuMatthias Krüger-178/+181
coverage: Restrict empty-span expansion to only cover `{` and `}` Coverage instrumentation has some tricky code for converting a coverage-relevant `Span` into a set of start/end line/byte-column coordinates that will be embedded in the CGU's coverage metadata. A big part of this complexity is special code for handling empty spans, which are expanded into non-empty spans (if possible) because LLVM's coverage reporter does not handle empty spans well. This PR simplifies that code by restricting it to only apply in two specific situations: when the character after the empty span is `{`, or the character before the empty span is `}`. (As an added benefit, this means that the expanded spans no longer extend awkwardly beyond the end of a physical line, which was common under the previous implementation.) Along the way, this PR also removes some unhelpful code for dealing with function source code spread across multiple files. Functions currently can't have coverage spans in multiple files, and if that ever changes (e.g. to properly support expansion regions) then this code will need to be completely overhauled anyway.
2024-11-10Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` ↵Alex Crichton-2/+51
target features For the `multivalue` and `reference-types` features this commit is similar to #117457 in that it's stabilizing target features specific to WebAssembly targets. The previous PR left out these two features because they weren't expected to change much about compiled code so it was unclear what the rationale was. It has [since been discovered][blog] that `reference-types` can be useful as it changes the binary format of the `call_indirect` instruction. Additionally [on Zulip][zulip] there's a use case of detecting these features at compile time and generating a compile error to better warn users about features not supported on engines. This PR then additionally adds the `tail-call` feature which corresponds to the [tail-call] proposal to WebAssembly. This feature advanced to "phase 4" in the WebAssembly CG awhile back and has been supported in LLVM for quite some time now. Engines are finishing up implementations or have already shipped implementations, so while this is a bit of a late addition to Rust itself it reflects the current status of WebAssembly's state of the feature. A test has been added here not only for these features but other WebAssembly features as well to showcase that they're usable without feature gates in stable Rust. [blog]: https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/wasm32.20reference-types.20.2F.20multivalue.20in.201.2E82-beta.20not.20enabled/near/473893987 [tail-call]: https://github.com/webassembly/tail-call
2024-11-10Re-enable `version-verbose-commit-hash` run-make testJieyou Xu-3/+0
2024-11-10Temporarily disable `version-verbose-commit-hash` to force revert throughJieyou Xu-0/+3
2024-11-10Fix error message for direct usage of sess.opts.crate_typesbjorn3-2/+2
2024-11-10ensure that all publicly reachable const fn have const stability infoRalf Jung-39/+39
2024-11-10Rollup merge of #132816 - compiler-errors:2024-apit, r=jieyouxuMatthias Krüger-13/+126
Dont suggest `use<impl Trait>` when we have an edition-2024-related borrowck issue #131186 implements some machinery to detect in borrowck when we may have RPIT overcaptures due to edition 2024, and suggests adding `+ use<'a, T>` to go back to the edition 2021 capture rules. However, we weren't filtering out cases when there are APITs in scope. This PR implements a more sophisticated diagnostic where we will suggest turning any APITs in scope into type parameters, and applies this to both the borrowck error note, and to the `impl_trait_overcaptures` migration lint. cc #132809
2024-11-10honor rustc_const_stable_indirect in non-staged_api crate with ↵Ralf Jung-0/+121
-Zforce-unstable-if-unmarked
2024-11-10Stabilize Arm64EC inline assemblyTaiki Endo-3/+3
2024-11-10Auto merge of #132831 - workingjubilee:rollup-6fdif44, r=workingjubileebors-971/+3036
Rollup of 6 pull requests Successful merges: - #131258 (Stabilize s390x inline assembly) - #132801 (interpret: get_alloc_info: also return mutability) - #132823 (require const_impl_trait gate for all conditional and trait const calls) - #132824 (Update grammar in wasm-c-abi's compiler flag documentation) - #132825 (Exclude relnotes-tracking-issue from needs-triage) - #132828 (Additional tests to ensure let is rejected during parsing) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-09Rollup merge of #132828 - est31:let_chains_parsing_tests, r=compiler-errorsJubilee-652/+2842
Additional tests to ensure let is rejected during parsing In the original stabilization PR, @ `compiler-errors` has [pointed out](https://github.com/rust-lang/rust/pull/94927#issuecomment-1165156328) that #97295 wasn't enough to address the concerns about having `let` in expressions being rejected at parsing time, instead of later. Thankfully, since then the situation has been greatly improved by #115677. This PR adds some additional tests to `disallowed-positions.rs`, and adds two additional revisions to the "normal" case which is now given the `feature` name: * `no_feature`: Added to incorporate `disallowed-positions-without-feature-gate.rs` into the file, reducing duplication. * `nothing`: like feature, but all functions are cfg'd out. Ensures that the errors are really emitted during parsing. cc tracking issue #53667
2024-11-09Rollup merge of #132823 - RalfJung:conditional-const-calls, ↵Jubilee-317/+192
r=fee1-dead,compiler-errors require const_impl_trait gate for all conditional and trait const calls Alternative to https://github.com/rust-lang/rust/pull/132786. `@compiler-errors` this is basically what I meant with my proposals. I found it's easier to express this in code than English. ;) r? `@compiler-errors`
2024-11-09Rollup merge of #131258 - taiki-e:s390x-stabilize-asm, r=AmanieuJubilee-2/+2
Stabilize s390x inline assembly This stabilizes inline assembly for s390x (SystemZ). Corresponding reference PR: https://github.com/rust-lang/reference/pull/1643 --- From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335 > Each architecture needs to be reviewed before stabilization: > - It must have clobber_abi. Done in https://github.com/rust-lang/rust/pull/130630. > - It must be possible to clobber every register that is normally clobbered by a function call. Done in the PR that added support for clobber_abi. > - Generally review that the exposed register classes make sense. The followings can be used as input/output: - `reg` (`r[0-10]`, `r[12-14]`): General-purpose register - `reg_addr` (`r[1-10]`, `r[12-14]`): General-purpose register except `r0` which is evaluated as zero in an address context This class is needed because `r0`, which may be allocated when using the `reg` class, cannot be used as a register in certain contexts. This is identical to the `a` constraint in LLVM and GCC. See https://github.com/rust-lang/rust/pull/119431 for details. - `freg` (`f[0-15]`): Floating-point register The followings are clobber-only: - `vreg` (`v[0-31]`): Vector register Technically `vreg` should be able to accept `#[repr(simd)]` types as input/output if the unstable `vector` target feature added is enabled, but `core::arch` has no s390x vector type and both `#[repr(simd)]` and `core::simd` are unstable. Everything related is unstable, so the fact that this is currently a clobber-only should not be considered a stabilization blocker. (https://github.com/rust-lang/rust/issues/130869 tracks unstable stuff here) - `areg` (`a[2-15]`): Access register All of the above register classes except `reg_addr` are needed for `clobber_abi`. The followings cannot be used as operands for inline asm (see also [getReservedRegs](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp#L258-L282) and [SystemZELFRegisters](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h#L107-L128) in LLVM): - `r11`: frame pointer - `r15`: stack pointer - `a0`, `a1`: Reserved for system use - `c[0-15]` (control register) Reserved by the kernel Although not listed in the above requirements, `preserves_flags` is implemented in https://github.com/rust-lang/rust/pull/111331. --- cc ``@uweigand`` r? ``@Amanieu`` ``@rustbot`` label +O-SystemZ +A-inline-assembly
2024-11-10Auto merge of #132173 - veluca93:abi_checks, r=RalfJung,compiler-errorsbors-61/+229
Emit warning when calling/declaring functions with unavailable vectors. On some architectures, vector types may have a different ABI depending on whether the relevant target features are enabled. (The ABI when the feature is disabled is often not specified, but LLVM implements some de-facto ABI.) As discussed in rust-lang/lang-team#235, this turns out to very easily lead to unsound code. This commit makes it a post-monomorphization future-incompat warning to declare or call functions using those vector types in a context in which the corresponding target features are disabled, if using an ABI for which the difference is relevant. This ensures that these functions are always called with a consistent ABI. See the [nomination comment](https://github.com/rust-lang/rust/pull/127731#issuecomment-2288558187) for more discussion. Part of #116558 r? RalfJung
2024-11-10Add more places where expressions can occurest31-398/+835