about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-03-07Rollup merge of #138173 - compiler-errors:incoherent-negative-impl, r=oli-obkJacob Pratt-0/+30
Delay bug for negative auto trait rather than ICEing Fixes #138149 r? oli-obk
2025-03-07Rollup merge of #138033 - obi1kenobi:pg/json-attrs-tests, r=aDotInTheVoidJacob Pratt-0/+58
rustdoc: Add attribute-related tests for rustdoc JSON. Add rustdoc JSON tests covering the use of the following attributes: - `#[non_exhaustive]` applied to enums, variants, and structs - `#[must_use]`, both with and without a message - `#[no_mangle]`, in both edition 2021 and 2024 (`#[unsafe(no_mangle)]`) flavors - `#[export_name]`, also in both edition 2021 and 2024 flavors Related to #137645; this is a subset of the attributes that `cargo-semver-checks` relies on and tests in its own test suite or in the test suites of its components such as `trustfall-rustdoc-adapter`. Helps with #81359 r? `@aDotInTheVoid`
2025-03-07Rollup merge of #137957 - Noratrieb:no, r=wesleywiserJacob Pratt-8/+1
Remove i586-pc-windows-msvc See [MCP 840](https://github.com/rust-lang/compiler-team/issues/840). I left a specialized error message that should help users that hit this in the wild (for example, because they use it in their CI). ``` error: Error loading target specification: the `i586-pc-windows-msvc` target has been removed. Use the `i686-pc-windows-msvc` target instead. Windows 10 (the minimum required OS version) requires a CPU baseline of at least i686 so you can safely switch. Run `rustc --print target-list` for a list of built-in targets ``` ``@workingjubilee`` ``@calebzulawski`` fyi portable-simd uses this target in CI, if you wanna remove it already before this happens
2025-03-07Rollup merge of #137537 - jieyouxu:daily-rmake, r=KobzolJacob Pratt-14/+16
Prevent `rmake.rs` from using unstable features, and fix 3 run-make tests that currently do Addresses (mostly) #137532. Follow-up to #137373. ### Summary - Fix 3 run-make tests that currently use unstable features: 1. `tests/run-make/issue-107495-archive-permissions/rmake.rs` uses `#![feature(rustc_private)]` for `libc` on `unix`, but `run_make_support` already exports `libc`, so just use that. 2. `tests/run-make/cross-lang-lto/rmake.rs` uses `#![feature(path_file_prefix)]` for convenience, replaced with similar filename prefix logic. 3. `tests/run-make/broken-pipe-no-ice/rmake.rs` uses `#![feature(anonymous_pipe)]` for anonymous pipes. This is more complicated[^race-condition], and I decided to temporarily introduce a dependency on [`os_pipe`] before std's `anonymous_pipe` library feature is stabilized[^pipe-stab]. I left a FIXME tracked by #137532 to make the switch once `anonymous_pipe` stabilizes and reaches beta. - Use `RUSTC_BOOTSTRAP=-1` when building `rmake.rs` to have the stage 0 rustc reject any unstable features used in `rmake.rs`. - The requirement that `rmake.rs` may not use any unstable features is now documented in rustc-dev-guide. - This PR does not impose `RUSTC_BOOTSTRAP=-1` when building `run-make-support`, but I suppose we could. r? `@Kobzol` try-job: x86_64-msvc-1 try-job: x86_64-mingw-1 [`os_pipe`]: https://github.com/oconnor663/os_pipe.rs [^race-condition]: We can't just try to spawn `rustc` and immediate close the stderr handle because of race condition, as there's no guarantee `rustc` will not try to print to stderr before the handle gets closed. [^pipe-stab]: In-progress stabilization PR over at https://github.com/rust-lang/rust/pull/135822.
2025-03-07Rollup merge of #138141 - tcpdumppy:master, r=compiler-errorsMatthias Krüger-6/+6
tests: fix some typos in comment fix some typos in comment
2025-03-07Rollup merge of #138042 - xizheyin:issue-135759, r=nnethercoteMatthias Krüger-0/+81
Suggest struct or union to add generic that impls trait Fixes #135759 cc ```@tdittr```
2025-03-07Rollup merge of #137977 - nnethercote:less-kw-Empty-1, r=spastorinoMatthias Krüger-12/+51
Reduce `kw::Empty` usage, part 1 This PR fixes some confusing `kw::Empty` usage, fixing a crash test along the way. r? ```@spastorino```
2025-03-07Rollup merge of #134797 - spastorino:ergonomic-ref-counting-1, r=nikomatsakisMatthias Krüger-20/+736
Ergonomic ref counting This is an experimental first version of ergonomic ref counting. This first version implements most of the RFC but doesn't implement any of the optimizations. This was left for following iterations. RFC: https://github.com/rust-lang/rfcs/pull/3680 Tracking issue: https://github.com/rust-lang/rust/issues/132290 Project goal: https://github.com/rust-lang/rust-project-goals/issues/107 r? ```@nikomatsakis```
2025-03-07Delay bug for negative auto trait rather than ICEingMichael Goulet-0/+30
2025-03-07Auto merge of #138155 - matthiaskrgr:rollup-xq5buio, r=matthiaskrgrbors-5/+51
Rollup of 6 pull requests Successful merges: - #137674 (Enable `f16` for LoongArch) - #138034 (library: Use `size_of` from the prelude instead of imported) - #138060 (Revert #138019 after further discussion about how hir-pretty printing should work) - #138073 (Break critical edges in inline asm before code generation) - #138107 (`librustdoc`: clippy fixes) - #138111 (Use `default_field_values` for `rustc_errors::Context`, `rustc_session::config::NextSolverConfig` and `rustc_session::config::ErrorOutputType`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-07Fix `broken-pipe-no-ice` to not depend on unstable `anonymous_pipe` feature许杰友 Jieyou Xu (Joe)-4/+4
2025-03-07Fix `cross-lang-lto` to not use `path_file_prefix`许杰友 Jieyou Xu (Joe)-8/+12
2025-03-07Fix `issue-107495-archive-permissions` to not rely on `rustc_private`许杰友 Jieyou Xu (Joe)-3/+1
2025-03-07Make synthetic RPITIT assoc ty name handling more rigorous.Nicholas Nethercote-12/+51
Currently it relies on special treatment of `kw::Empty`, which is really easy to get wrong. This commit makes the special case clearer in the type system by using `Option`. It's a bit clumsy, but the synthetic name handling itself is a bit clumsy; better to make it explicit than sneak it in. Fixes #133426.
2025-03-07Rollup merge of #138073 - tmiasko:inline-asm-critical-edges, r=bjorn3Matthias Krüger-0/+37
Break critical edges in inline asm before code generation An inline asm terminator defines outputs along its target edges -- a fallthrough target and labeled targets. Code generation implements this by inserting code directly into the target blocks. This approach works only if the target blocks don't have other predecessors. Establish required invariant by extending existing code that breaks critical edges before code generation. Fixes #137867. r? ``@bjorn3``
2025-03-07Rollup merge of #138060 - jdonszelmann:revert-138019, r=compiler-errorsMatthias Krüger-5/+14
Revert #138019 after further discussion about how hir-pretty printing should work After some more discussion, #138019 was probably merged a little fast. Though there probably is a real bug in pretty printing, it is not feasible to add similar pretty printing routines for all attributes, and making this specific exception is likely not desired either. For more context, see post-merge comments on #138019 I kept the tests around, but reverted the hir-pretty change. r? ```@compiler-errors```
2025-03-07Rollup merge of #138115 - compiler-errors:static-typo, r=BoxyUwUMatthias Krüger-0/+33
Suggest typo fix for static lifetime ...and don't try to introduce a new lifetime param named something like `'statoc`.
2025-03-07Rollup merge of #137904 - scottmcm:ordering-is, r=workingjubileeMatthias Krüger-3/+116
Improve the generic MIR in the default `PartialOrd::le` and friends It looks like I regressed this accidentally in #137197 due to #137901 So this PR does two things: 1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit. 2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.
2025-03-07Auto merge of #138127 - compiler-errors:rollup-kcarqrz, r=compiler-errorsbors-51/+75
Rollup of 17 pull requests Successful merges: - #137827 (Add timestamp to unstable feature usage metrics) - #138041 (bootstrap and compiletest: Use `size_of_val` from the prelude instead of imported) - #138046 (trim channel value in `get_closest_merge_commit`) - #138053 (Increase the max. custom try jobs requested to `20`) - #138061 (triagebot: add a `compiler_leads` ad-hoc group) - #138064 (Remove - from xtensa targets cpu names) - #138075 (Use final path segment for diagnostic) - #138078 (Reduce the noise of bootstrap changelog warnings in --dry-run mode) - #138081 (Move `yield` expressions behind their own feature gate) - #138090 (`librustdoc`: flatten nested ifs) - #138092 (Re-add `DynSend` and `DynSync` impls for `TyCtxt`) - #138094 (a small borrowck cleanup) - #138098 (Stabilize feature `const_copy_from_slice`) - #138103 (Git ignore citool's target directory) - #138105 (Fix broken link to Miri intrinsics in documentation) - #138108 (Mention me (WaffleLapkin) when changes to `rustc_codegen_ssa` occur) - #138117 ([llvm/PassWrapper] use `size_t` when building arg strings) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-07tests: fix some typos in commenttcpdumppy-6/+6
Signed-off-by: tcpdumppy <847462026@qq.com>
2025-03-06Add slight variation to feature-gate ergonomic clones testSantiago Pastorino-4/+17
2025-03-06Make feature flag incompleteSantiago Pastorino-24/+42
2025-03-06Parse and allow const use closuresSantiago Pastorino-0/+11
2025-03-06Give a better error message on async use in edition 2015Santiago Pastorino-0/+14
2025-03-06Change feature flag error to be ergonomic clones are experimentalSantiago Pastorino-7/+7
2025-03-06Add more testsSantiago Pastorino-0/+91
2025-03-06Fail gracefully if mutating on a use closure and the closure it not declared mutSantiago Pastorino-0/+27
2025-03-06Allow to mutate use capturesSantiago Pastorino-0/+11
2025-03-06Fix use closure parsing error messageSantiago Pastorino-12/+4
2025-03-06Add testsSantiago Pastorino-0/+357
2025-03-06Support nested use closuresSantiago Pastorino-0/+20
2025-03-06Separate closures, async and dotuse tests in directoriesSantiago Pastorino-9/+16
2025-03-06Add UseCloned trait related codeSantiago Pastorino-17/+73
2025-03-06Generate the right MIR for by use closuresSantiago Pastorino-29/+13
2025-03-06Use closure parse codeSantiago Pastorino-56/+88
2025-03-06Implement .use keyword as an alias of cloneSantiago Pastorino-16/+53
2025-03-06Add ergonomic_clones feature flagSantiago Pastorino-0/+46
2025-03-06Rollup merge of #138094 - lcnr:cleanup-borrowck, r=fee1-deadMichael Goulet-16/+5
a small borrowck cleanup
2025-03-06Rollup merge of #138081 - eholk:yield-feature, r=oli-obkMichael Goulet-29/+59
Move `yield` expressions behind their own feature gate In order to make progress with the `iter!` macro (e.g. in #137725), we need `yield` expressions to be available without the `coroutines` feature. This PR moves `yield` to be guarded by the `yield_expr` feature so that we can stabilize that independently (or at least, concurrently with the `iter_macro` feature). Note that once `yield` is stable, it will still be an error to use `yield` expressions outside something like a generator or coroutine, and these features remain unstable. r? `@oli-obk`
2025-03-06Rollup merge of #138075 - compiler-errors:final-seg, r=NoratriebMichael Goulet-3/+3
Use final path segment for diagnostic Test changes should prove the effect of this PR; we want to mention the *function name* not the arbitrary first segment of the path.
2025-03-06Rollup merge of #137827 - yaahc:timestamp-metrics, r=estebankMichael Goulet-3/+8
Add timestamp to unstable feature usage metrics part of https://github.com/rust-lang/rust/issues/129485 with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard r? ```@estebank```
2025-03-06Add the yield_expr featureEric Holk-29/+59
2025-03-06Break critical edges in inline asm before code generationTomasz Miąsko-0/+37
An inline asm terminator defines outputs along its target edges -- a fallthrough target and labeled targets. Code generation implements this by inserting code directly into the target blocks. This approach works only if the target blocks don't have other predecessors. Establish required invariant by extending existing code that breaks critical edges before code generation.
2025-03-06Suggest typo fix for static lifetimeMichael Goulet-0/+33
2025-03-06Rollup merge of #137910 - compiler-errors:async-fn-goal-error, r=oli-obkMichael Goulet-0/+31
Improve error message for `AsyncFn` trait failure for RPIT Use a `WellFormedDerived` obligation cause to make sure we can turn an `AsyncFnKindHelper` trait goal into its parent `AsyncFn*` goal, then fix the logic for reporting `AsyncFn*` kind mismatches. Best reviewed without whitespace. Fixes #137905 r? oli-obk
2025-03-06Rollup merge of #137825 - estebank:rtn-sugg-2, r=compiler-errorsMichael Goulet-11/+70
Provide more context on resolve error caused from incorrect RTN When encountering a resolve E0575 error for an associated method (when a type was expected), see if it could have been an intended return type notation bound. ``` error[E0575]: expected associated type, found associated function `Trait::method` --> $DIR/bad-inputs-and-output.rs:31:36 | LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type | help: you might have meant to use the return type notation syntax | LL - fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {} LL + fn foo_qualified<T: Trait>() where T::method(..): Send {} | ``` Built on top of #137824, only second commit is relevant for review. r? ````````@compiler-errors````````
2025-03-06Rollup merge of #137808 - jswrenn:droppy-unsafe-fields, r=nnethercoteMichael Goulet-16/+3
Do not require that unsafe fields lack drop glue Instead, we adopt the position that introducing an `unsafe` field itself carries a safety invariant: that if you assign an invariant to that field weaker than what the field's destructor requires, you must ensure that field is in a droppable state in your destructor. See: - https://github.com/rust-lang/rfcs/pull/3458#discussion_r1971676100 - https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/unsafe.20fields.20RFC/near/502113897 Tracking Issue: #132922
2025-03-06Rollup merge of #137805 - RalfJung:layout-debug-print, r=NoratriebMichael Goulet-161/+161
adjust Layout debug printing to match the internal field name The field got renamed a while ago, but the debug printing was not updated to match.
2025-03-06Rollup merge of #137764 - compiler-errors:always-applicable-negative-impl, ↵Michael Goulet-90/+220
r=lcnr Ensure that negative auto impls are always applicable r? lcnr (or reassign if you dont want to review) https://github.com/rust-lang/rust/issues/68318#issuecomment-2689265030
2025-03-06Rollup merge of #137758 - jdonszelmann:fix-137662, r=nnethercoteMichael Goulet-0/+20
fix usage of ty decl macro fragments in attributes See the test case. Due to one missing code path (and also the changes in #137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way. Closes #137662