summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-05-09ReviewMichael Goulet-1/+1
2025-05-09Only include associated type bounds for Self:Sized associated types if they ↵Michael Goulet-3/+46
are provided
2025-05-09Don't delay a bug on malformed meta items involving interpolated tokensLeón Orell Valerian Liehr-0/+24
Co-authored-by: Jana Dönszelmann <jana@donsz.nl>
2025-05-02rustdoc: Fix doctest heuristic for main fn wrappingLeón Orell Valerian Liehr-51/+154
(cherry picked from commit 714ea10ea41e97310a1b3d90fed4cfb3e2dd6b73)
2025-05-02Fix bad handling of macros if there is already a `main` functionGuillaume Gomez-0/+23
(cherry picked from commit aa69e3a0cb8f1b2e086709a038baad6f39249150)
2025-05-02If there is a `;` alone, we consider that the doctest needs to be put inside ↵Guillaume Gomez-27/+4
a function (cherry picked from commit 3ef98a55ef95b058e55897f1b213dd965839e3ed)
2025-05-02Add regression ui test for #140162 and for #139651Guillaume Gomez-0/+28
(cherry picked from commit 81438c0b05f177ae7bc0d6511d1cc507652eb241)
2025-05-02set subsections_via_symbols for ld64 helper sectionsusamoi-0/+47
(cherry picked from commit b1a38313cb0dee9a7c5573ae37ad48b0a347cb7c)
2025-05-02Add test for format_args!("{}", 0) in const.Mara Bos-1/+14
(cherry picked from commit 56426db0b634fcd8d7e5842f39593651a594e602)
2025-04-24Bless ui/associated-consts/issue-93835Josh Stone-25/+10
Beta-backporting #140228 has the same effect on this test as #139341 already had on master.
2025-04-24Revert overzealous parse recovery for single colonsLeón Orell Valerian Liehr-79/+46
(cherry picked from commit 16da97be2f1e94a550985f22289975db4b32c18d)
2025-04-24Don't warn about `v128` in wasm ABI transitionAlex Crichton-2/+41
This has other warnings if necessary and doesn't need extra warnings from this FCW. cc #138762 (cherry picked from commit 19e44d463bf671f6ec1b02b32837ad54dd5d626f)
2025-04-24Ignore zero-sized types in wasm future-compat warningAlex Crichton-0/+6
This commit fixes a false positive of the warning triggered for #138762 and the fix is to codify that zero-sized types are "safe" in both the old and new ABIs. (cherry picked from commit f9091e24a0af713378ee705c86689c1435d0b157)
2025-04-24Do not mix normalized and unnormalized caller bounds when constructing ↵Michael Goulet-13/+39
param-env for receiver_is_dispatchable (cherry picked from commit 4f2baaa9c6b75d4267eea9e1096339d56d380615)
2025-04-17Use `eprint!` instead of `eprintln!`Guillaume Gomez-32/+22
(cherry picked from commit f9927ee042f7d7418fbb64082272ce1feff4d895)
2025-04-17Add regression test for #137970Guillaume Gomez-0/+44
(cherry picked from commit fff2484700bb7d1fa320a666109d1868767dfa6a)
2025-03-28Rollup merge of #139075 - oli-obk:resolver-item-lifetime, r=compiler-errorsMatthias Krüger-0/+13
Do not treat lifetimes from parent items as influencing child items ```rust struct A; impl Bar<'static> for A { const STATIC: &str = ""; // ^ no future incompat warning } ``` has no future incompat warning, because there is no ambiguity. But ```rust struct C; impl Bar<'_> for C { // ^^ this lifeimte const STATIC: &'static str = { struct B; impl Bar<'static> for B { const STATIC: &str = ""; // causes ^ to emit a future incompat warning } "" }; } ``` had one before this PR, because the impl for `B` (which is just a copy of `A`) thought it was influenced by a lifetime on the impl for `C`. I double checked all other `lifetime_ribs` iterations and all of them do check for `Item` boundaries. This feels very fragile tho, and ~~I think we should do not even be able to see ribs from parent items, but that's a different refactoring that I'd rather not do at the same time as a bugfix~~. EDIT: ah nevermind, this is needed for improving diagnostics like "use of undeclared lifetime" being "can't use generic parameters from outer item" instead. r? `@compiler-errors`
2025-03-28Rollup merge of #139063 - fmease:fix-tait-atpit-gating, r=oli-obkMatthias Krüger-13/+193
Fix TAIT & ATPIT feature gating in the presence of anon consts Fixes #139055 (https://github.com/rust-lang/rust/issues/119924#issuecomment-1928659690). r? oli-obk or anybody else
2025-03-28Fix TAIT & ATPIT feature gating in the presence of anon constsLeón Orell Valerian Liehr-13/+193
2025-03-28Do not treat lifetimes from parent items as influencing child itemsOli Scherer-0/+13
2025-03-28Auto merge of #139054 - matthiaskrgr:rollup-2bk2fb4, r=matthiaskrgrbors-18/+47
Rollup of 7 pull requests Successful merges: - #137889 (update outdated doc with new example) - #138104 (Greatly simplify doctest parsing and information extraction) - #138678 (rustc_resolve: fix instability in lib.rmeta contents) - #138986 (feat(config): Add ChangeId enum for suppressing warnings) - #139038 (Update target maintainers for thumb targets to reflect new REWG Arm team name) - #139045 (bootstrap: update `test_find` test) - #139047 (Remove ScopeDepth) Failed merges: - #139044 (bootstrap: Avoid cloning `change-id` list) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-28Rollup merge of #138104 - GuillaumeGomez:simplify-doctest-parsing, r=fmeaseMatthias Krüger-18/+47
Greatly simplify doctest parsing and information extraction The original process was pretty terrible, as it tried to extract information such as attributes by performing matches over tokens like `#!`, which doesn't work very well considering you can have `# ! [`, which is valid. Also, it now does it in one pass: if the parser is happy, then we try to extract information, otherwise we return early. r? `@fmease`
2025-03-28Auto merge of #138503 - bjorn3:string_merging, r=tmiaskobors-24/+51
Avoid wrapping constant allocations in packed structs when not necessary This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes. try-job: armhf-gnu
2025-03-28Update `coverage-run-rustdoc` outputGuillaume Gomez-8/+8
2025-03-28Add test and commentbjorn3-0/+27
2025-03-28Avoid wrapping constant allocations in packed structs when not necessarybjorn3-24/+24
This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.
2025-03-28Auto merge of #139037 - jhpratt:rollup-4c74y8a, r=jhprattbors-5/+51
Rollup of 6 pull requests Successful merges: - #138720 (Specify a concrete stack size in channel tests) - #139010 (Improve `xcrun` error handling) - #139021 (std: get rid of pre-Vista fallback code) - #139025 (Do not trim paths in MIR validator) - #139026 (Use `abs_diff` where applicable) - #139030 (saethlin goes on vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-28Auto merge of #138965 - nnethercote:less-kw-Empty-hir-Lifetime, r=lcnrbors-3/+190
Remove `kw::Empty` uses from `hir::Lifetime::ident` `hir::Lifetime::ident` is sometimes set to `kw::Empty` and it's really confusing. This PR stops that. Helps with #137978. r? `@lcnr`
2025-03-27Rollup merge of #139025 - compiler-errors:trim-validator-err, r=jieyouxuJacob Pratt-0/+36
Do not trim paths in MIR validator From my inline comment: ``` // The type checker formats a bunch of strings with type names in it, but these strings // are not always going to be encountered on the error path since the inliner also uses // the validator, and there are certain kinds of inlining (even for valid code) that // can cause validation errors (mostly around where clauses and rigid projections). ``` Fixes https://github.com/rust-lang/rust/issues/138979 r? `@jieyouxu`
2025-03-27Rollup merge of #138720 - Jeff-A-Martin:channel-stack-overflow-test-fuchsia, ↵Jacob Pratt-5/+15
r=wesleywiser Specify a concrete stack size in channel tests The channel-stack-overflow-issue-102246 regression test fails on platforms with a small default stack size (e.g. Fuchsia, with a default of 256KiB). Update the test to specify an exact stack size for both the sender and receiver operations, to ensure it is platform agnostic. Set the stack size to less than the total allocation size of the mpsc channel, to continue to prove that the allocation is on the heap.
2025-03-28Don't use `kw::Empty` in `hir::Lifetime::ident`.Nicholas Nethercote-5/+5
`hir::Lifetime::ident` currently sometimes uses `kw::Empty` for elided lifetimes and sometimes uses `kw::UnderscoreLifetime`, and the distinction is used when creating some error suggestions, e.g. in `Lifetime::suggestion` and `ImplicitLifetimeFinder::visit_ty`. I found this *really* confusing, and it took me a while to understand what was going on. This commit replaces all uses of `kw::Empty` in `hir::Lifetime::ident` with `kw::UnderscoreLifetime`. It adds a new field `hir::Lifetime::is_path_anon` that mostly replaces the old empty/underscore distinction and makes things much clearer. Some other notable changes: - Adds a big comment to `Lifetime` talking about permissable field values. - Adds some assertions in `new_named_lifetime` about what ident values are permissible for the different `LifetimeRes` values. - Adds a `Lifetime::new` constructor that does some checking to make sure the `is_elided` and `is_anonymous` states are valid. - `add_static_impl_trait_suggestion` now looks at `Lifetime::res` instead of the ident when creating the suggestion. This is the one case where `is_path_anon` doesn't replace the old empty/underscore distinction. - A couple of minor pretty-printing improvements.
2025-03-27Auto merge of #138702 - m-ou-se:spawn-in-atexit, r=Mark-Simulacrumbors-0/+24
Allow spawning threads after TLS destruction Fixes #138696
2025-03-28Add a HIR pretty-printing test focused on lifetimes.Nicholas Nethercote-0/+187
HIR printing currently gets very little testing. This increases coverage a bit, with a focus on lifetimes. There are some FIXME comments for cases that are printed in a dubious fashion. This PR won't address those; the point of adding this test is to ensure that the subsequent commits don't hurt pretty-printing.
2025-03-27Do not trim paths in MIR validatorMichael Goulet-0/+36
2025-03-27Rollup merge of #139014 - xizheyin:issue-138931, r=oli-obkJacob Pratt-0/+83
Improve suggest construct with literal syntax instead of calling Closing #138931 When constructing a structure through a format similar to calling a constructor, we can use verbose suggestions to hint at using literal syntax for clearer advice. The case of multiple fields is also considered here, provided that the field has the same number of arguments as CallExpr. r? compiler
2025-03-27Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercoteJacob Pratt-64/+41
expand: Leave traces when expanding `cfg` attributes This is the same as https://github.com/rust-lang/rust/pull/138515, but for `cfg(true)` instead of `cfg_attr`. The difference is that `cfg(true)`s already left "traces" after themselves - the `cfg` attributes themselves, with `expanded_inert_attrs` set to true, with full tokens, available to proc macros. This is not a reasonably expected behavior, but it could not be removed without a replacement, because a [major rustdoc feature](https://github.com/rust-lang/rfcs/pull/3631) and a number of clippy lints rely on it. This PR implements a replacement. This needs a crater run, because it changes observable behavior (in an intended way) - proc macros can no longer see expanded `cfg(true)` attributes. (Some minor unnecessary special casing for `sym::cfg_attr` is also removed in this PR.) r? `@nnethercote`
2025-03-27Mark test as only-unix.Mara Bos-0/+1
2025-03-27Improve suggest construct with literal syntax instead of callingxizheyin-2/+15
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-27Add ui test for struct construction by calling syntaxxizheyin-0/+70
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-27Correctly handle line comments in attributes and generate extern cratesGuillaume Gomez-7/+36
outside of wrapping function
2025-03-27Update rustdoc-ui testsGuillaume Gomez-3/+3
2025-03-27Add needs-threads to test.Mara Bos-0/+1
2025-03-27Rollup merge of #138987 - madsmtm:fix-108825, r=jieyouxuStuart Cook-0/+16
Always emit `native-static-libs` note, even if it is empty Fixes https://github.com/rust-lang/rust/issues/108825. Retry of https://github.com/rust-lang/rust/pull/121216, finally got around to fixing the test, the errors in that PR were because `libcore` uses the `#[link]` attribute on MSVC. try-job: x86_64-msvc r? wesleywiser
2025-03-27Rollup merge of #138985 - oli-obk:push-mvlqmtmyozro, r=compiler-errorsStuart Cook-34/+16
Use the correct binder scope for elided lifetimes in assoc consts Beyond diagnostics this has no real effect, and it's also just about a future incompat lint. But it causes ICEs in some refactorings that I'm doing, so trying to get it out of the way
2025-03-27Rollup merge of #138980 - tmiasko:collect-var-debug-info, r=compiler-errorsStuart Cook-0/+24
Collect items referenced from var_debug_info The collection is limited to full debuginfo builds to match behavior of FunctionCx::compute_per_local_var_debug_info. Fixes #138942.
2025-03-27Rollup merge of #138964 - compiler-errors:usage-of-interner, r=lcnrStuart Cook-0/+31
Implement lint against using Interner and InferCtxtLike in random compiler crates Often `Interner` defines similar methods to `TyCtxt` (but often simplified due to the simpler API surface of the type system layer for the new solver), which people will either unintentionally or intentionally import and use. Let's discourage that. r? lcnr
2025-03-27Rollup merge of #130883 - madsmtm:env-var-query, r=petrochenkovStuart Cook-0/+36
Add environment variable query Generally, `rustc` prefers command-line arguments, but in some cases, an environment variable really is the most sensible option. We should make sure that this works properly with the compiler's change-tracking mechanisms, such that changing the relevant environment variable causes a rebuild. This PR is a first step forwards in doing that. Part of the work needed to do https://github.com/rust-lang/rust/issues/118204, see https://github.com/rust-lang/rust/pull/129342 for some discussion. r? ``@petrochenkov``
2025-03-26Always emit native-static-libs note, even if it is emptyMads Marquart-0/+16
2025-03-26Test that env! works with incremental compilationMads Marquart-0/+36
This currently works because it's part of expansion, and that isn't yet tracked by the query system. But we want to ensure it continues working, even if that is changed.
2025-03-26Use the correct binder scope for elided lifetimes in assoc constsOli Scherer-34/+16