about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-03-07Make trimming logic work on more than one span at a timeEsteban Küber-17/+55
2025-03-07Fix multiline span start special caseEsteban Küber-226/+210
2025-03-07Fix rustdoc testEsteban Küber-2/+2
2025-03-07Refactor `emitter` to better account for unicode chars when trimmingEsteban Küber-251/+363
Change the way that underline positions are calculated by delaying using the "visual" column position until the last possible moment, instead using the "file"/byte position in the file, and then calculating visual positioning as late as possible. This should make the underlines more resilient to non-1-width unicode chars. Unfortunately, as part of this change (which fixes some visual bugs) comes with the loss of some eager tab codepoint handling, but the output remains legible despite some minor regression on the "margin trimming" logic.
2025-03-07On long spans, trim the middle of them to make them fit in the terminal widthEsteban Küber-4/+49
When encountering a single line span that is wider than the terminal, we keep context at the start and end of the span but otherwise remove the code from the middle. This is somewhat independent from whether the left and right margins of the output have been trimmed as well. ``` error[E0308]: mismatched types --> $DIR/long-span.rs:6:15 | LL | ... = [0, 0, 0, 0, ..., 0, 0]; | ^^^^^^^^^^^^^...^^^^^^^ expected `u8`, found `[{integer}; 1681]` ``` Address part of #137680 (missing handling of the long suggestion). Fix #125581.
2025-03-07Support rmeta inputs for --crate-type=bin --emit=objSam McCall-0/+32
This already works for --emit=metadata, but is possible anytime we're not linking. Tests: `rmeta_bin` checks we're not changing --emit=link (already passes) `rmeta_bin-pass` tests the new behavior for --emit=obj (would fail today) and also --emit=metadata which isn't changing
2025-03-07Delay bug for negative auto trait rather than ICEingMichael Goulet-0/+30
2025-03-07mir_build: consider privacy when checking for irrefutable patternsMaja Kądziołka-0/+70
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-06Use `trunc nuw`+`br` for 0/1 branches even in optimized buildsScott McMurray-8/+84
Rather than needing to use `switch` for them to include the `unreachable` arm
2025-03-07More denesting of invisibly-delimited groups.Nicholas Nethercote-0/+28
This time when converting them to proc-macro `Group` form.
2025-03-07Remove `NtItem` and `NtStmt`.Nicholas Nethercote-42/+59
This involves replacing `nt_pretty_printing_compatibility_hack` with `stream_pretty_printing_compatibility_hack`. The handling of statements in `transcribe` is slightly different to other nonterminal kinds, due to the lack of `from_ast` implementation for empty statements. Notable test changes: - `tests/ui/proc-macro/expand-to-derive.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar.
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 test for `escape_debug` without bounds check.Markus Reiter-0/+14
2025-03-06Fix target-feature inline test to be less flakyMichael Goulet-6/+2
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-06Exclude global_asm from mir_keysMichael Goulet-1/+27
2025-03-06Construct MIR error body for global_asm correctlyMichael Goulet-0/+20