about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-07-05cleaned up some testsKivooeo-68/+126
2025-07-05cleaned up some testsKivooeo-55/+70
2025-07-05Use relative visibility when noting sealed trait to reduce false positivexizheyin-3/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-05cleaned up some testsKivooeo-22/+36
2025-07-05moved & deleted testsKivooeo-17/+0
opeq.rs was removed as duplicating test logic in other tests
2025-07-05cleaned up some testsKivooeo-108/+168
2025-07-05moved testsKivooeo-0/+0
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-21/+28
2025-07-04Fix pretty printing of placeholder typesMichael Goulet-21/+22
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-12/+12
2025-07-04Add a regression test for ld64dianqk-0/+24
2025-07-04Rollup merge of #143308 - compiler-errors:no-pointer-like, r=oli-obkMatthias Krüger-38/+0
Remove `PointerLike` trait r? oli-obk
2025-07-04Rollup merge of #143286 - Muscraft:track-diagnostics-note, r=WaffleLapkinMatthias Krüger-19/+37
Make -Ztrack-diagnostics emit like a note [#t-compiler/diagnostics > Rendering -Ztrack-diagnostics like a note](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/Rendering.20-Ztrack-diagnostics.20like.20a.20note/with/526608647) As discussed on the Zulip thread above, I want to make `-Ztrack-diagnostics` emit like a `note`. This is because I find its current output jarring, and the fact that it gets rendered completely left-aligned, [even in the middle of a snippet](https://github.com/rust-lang/rust/blob/86e05cd300fac9e83e812c4d46582b48db780d8f/tests/ui/track-diagnostics/track6.stderr), seems like something that should be changed. Turning it into a `note` seems like the best choice, as it would align it with the rest of the output, and `note` is already used for somewhat similar things, like seeing why a lint was fired. --- Note: turning `-Ztrack-diagnostics` into a `note` will also make `annotate-snippets` API a bit cleaner
2025-07-04Add test false-sealed-traits-note.rsxizheyin-0/+34
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-04treat box patterns as deref patterns in THIR and usefulness analysisdianne-15/+27
This removes special-casing of boxes from `rustc_pattern_analysis`, as a first step in replacing `box_patterns` with `deref_patterns`. Incidentally, it fixes a bug caused by box patterns being represented as structs rather than pointers, where `exhaustive_patterns` could generate spurious `unreachable_patterns` lints on arms required for exhaustiveness; following the lint's advice would result in an error.
2025-07-04Auto merge of #143237 - JonathanBrouwer:no_implicit_prelude_parser, ↵bors-18/+21
r=jdonszelmann,oli-obk Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure Ports no_implicit_prelude to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@oli-obk` cc `@jdonszelmann`
2025-07-03mbe: Gracefully handle macro rules that end after `=>`Josh Triplett-0/+78
Add a test for various cases of invalid macro definitions. Closes: https://github.com/rust-lang/rust/issues/143351
2025-07-04Rollup merge of #143307 - compiler-errors:fast-path-nitpicks, r=lcnrJacob Pratt-0/+23
Fast path nitpicks Miscellaneous commits that I didn't really want to fold into anything else. Fixes one theoretical bug with the fast path not considering polarity for `T: !Sized` bounds.
2025-07-03Remove PointerLike traitMichael Goulet-38/+0
2025-07-03gai: remove typo from test file, and add a reference idTshepang Mbambo-0/+1
2025-07-03Port `#[no_implicit_prelude]` to the new attribute parsing infrastructureJonathan Brouwer-18/+21
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-03Rework logic and provide structured suggestionEsteban Küber-3/+64
2025-07-03Return early when `self` resolve failure because of `let self = ...`xizheyin-7/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-03Add ui test resolve/false-self-in-macro-issue-143134.rsxizheyin-0/+22
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-03move `tests/ui/resolve/suggest*` to `tests/ui/resolve/suggestions/`xizheyin-0/+0
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-03refactor: Make -Ztrack-diagnostics emit like a noteScott Schafer-19/+37
2025-07-03Rollup merge of #143329 - folkertdev:minicore-diagnostic-on-unimplemented, ↵Jana Dönszelmann-20/+39
r=jieyouxu minicore: use core's `diagnostic::on_unimplemented` messages Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to https://github.com/rust-lang/rust/issues/137531. The modified test files are reported in https://github.com/rust-lang/rust/issues/143319 as failing for `--target=riscv64gc-unknown-linux-gnu`. Using `minicore` for them makes it easier to troubleshoot this sort of issue. r? ``@jieyouxu``
2025-07-03Rollup merge of #143038 - Qelxiros:142676-private-dependency-traits, r=tgross35Jana Dönszelmann-0/+78
avoid suggesting traits from private dependencies fixes rust-lang/rust#142676 fixes rust-lang/rust#138191 r? ``@tgross35``
2025-07-03Rollup merge of #142876 - JonathanBrouwer:target_feature_parser, r=oli-obkJana Dönszelmann-112/+153
Port `#[target_feature]` to new attribute parsing infrastructure Ports `target_feature` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-07-03Rollup merge of #134006 - klensy:typos, r=nnethercoteJana Dönszelmann-10/+10
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03minicore: use core's `diagnostic::on_unimplemented` messagesFolkert de Vries-20/+39
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-10/+10
2025-07-03Port `#[target_feature]` to the new attribute parsing infrastructureJonathan Brouwer-112/+153
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-03Rollup merge of #143273 - 1c3t3a:enum-check-negative, r=SparrowLiiMatthias Krüger-0/+67
Make the enum check work for negative discriminants The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly. Fixes rust-lang/rust#143218.
2025-07-02avoid suggesting traits from private dependenciesJeremy Smart-23/+14
2025-07-02Auto merge of #143338 - matthiaskrgr:rollup-ykaxh04, r=matthiaskrgrbors-208/+681
Rollup of 11 pull requests Successful merges: - rust-lang/rust#131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - rust-lang/rust#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - rust-lang/rust#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - rust-lang/rust#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - rust-lang/rust#142237 (Detect more cases of unused_parens around types) - rust-lang/rust#142964 (Attribute rework: a parser for single attributes without arguments) - rust-lang/rust#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - rust-lang/rust#143235 (Assemble const bounds via normal item bounds in old solver too) - rust-lang/rust#143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - rust-lang/rust#143276 (loop match: handle opaque patterns) - rust-lang/rust#143306 (Add `track_caller` attributes to trace origin of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-07-02Auto merge of #143337 - matthiaskrgr:rollup-lqwhe0i, r=matthiaskrgrbors-1/+19
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions) - rust-lang/rust#142138 (Add `Vec::into_chunks`) - rust-lang/rust#142321 (Expose elf abi on ppc64 targets) - rust-lang/rust#142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`) - rust-lang/rust#143194 (fix bitcast of single-element SIMD vectors) - rust-lang/rust#143231 (Suggest use another lifetime specifier instead of underscore lifetime) - rust-lang/rust#143232 ([COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest) - rust-lang/rust#143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition) - rust-lang/rust#143274 (ci: support optional jobs) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-02awhile -> a while where appropriateнаб-1/+1
2025-07-02Rollup merge of #143276 - folkertdev:loop-match-opaque-pattern, r=NadrierilMatthias Krüger-135/+220
loop match: handle opaque patterns tracking issue https://github.com/rust-lang/rust/issues/132306 fixes https://github.com/rust-lang/rust/issues/143203 I believe the `Opaque` comes up because the range pattern is invalid? Because we do handle float patterns already so those should be fine. r? `@Nadrieril`
2025-07-02Rollup merge of #143235 - compiler-errors:const-item-bound, r=oli-obkMatthias Krüger-0/+19
Assemble const bounds via normal item bounds in old solver too Fixes the first example in https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/elaboration.20of.20const.20bounds.3F/with/526378135 The code duplication here is not that nice, but it's at least very localized. cc `@davidtwco` r? oli-obk
2025-07-02Rollup merge of #143070 - joshtriplett:macro-rules-parse, r=petrochenkovMatthias Krüger-10/+12
Rewrite `macro_rules!` parser to not use the MBE engine itself The `macro_rules!` parser was written to match the series of rules using the macros-by-example (MBE) engine and a hand-written equivalent of the left-hand side of a MBE macro. This was complex to read, difficult to extend, and produced confusing error messages. Because it was using the MBE engine, any parse failure would be reported as if some macro was being applied to the `macro_rules!` invocation itself; for instance, errors would talk about "macro invocation", "macro arguments", and "macro call", when they were actually about the macro *definition*. And in practice, the `macro_rules!` parser only used the MBE engine to extract the left-hand side and right-hand side of each rule as a token tree, and then parsed the rest using a separate parser. Rewrite it to parse the series of rules using a simple loop, instead. This makes it more extensible in the future, and improves error messages. For instance, omitting a semicolon between rules will result in "expected `;`" and "unexpected token", rather than the confusing "no rules expected this token in macro call". This work was greatly aided by pair programming with Vincenzo Palazzo (`@vincenzopalazzo)` and Eric Holk (`@eholk).` For review, I recommend reading the two commits separately.
2025-07-02Rollup merge of #142964 - GrigorenkoPV:attributes/argless, r=oli-obkMatthias Krüger-8/+8
Attribute rework: a parser for single attributes without arguments Part of rust-lang/rust#131229 r? `@jdonszelmann` I think code (with comments) speaks for itself. The only subtlety: now `#[cold]`, `#[no_mangle]`, & `#[track_caller]` do not get thrown away when malformed (i.e. have arguments). This doesn't matter too much (I think), because an error gets emitted either way, so the compilation will not finish.
2025-07-02Rollup merge of #142237 - benschulz:unused-parens-fn, r=fee1-deadMatthias Krüger-55/+422
Detect more cases of unused_parens around types With this change, more unused parentheses around bounds and types nested within bounds are detected.
2025-07-02Rollup merge of #143231 - xizheyin:143152, r=fee1-deadMatthias Krüger-0/+18
Suggest use another lifetime specifier instead of underscore lifetime cc rust-lang/rust#143152 r? compiler
2025-07-02Rollup merge of #142321 - ostylk:fix/ppc64_abi, r=workingjubileeMatthias Krüger-1/+1
Expose elf abi on ppc64 targets Fixes https://github.com/rust-lang/rust/issues/60617 (after MCP https://github.com/rust-lang/compiler-team/issues/885 is accepted) by exposing the abi information on ppc64 targets. Conditional compilation can now use `cfg(target_abi = "elfv1")` or `cfg(target_abi = "elfv2")` to determine the abi in use. Technical details are included in the other PR https://github.com/rust-lang/rust/pull/142598
2025-07-02Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31bors-1186/+1033
Remove let_chains unstable feature Per https://github.com/rust-lang/rust/issues/53667#issuecomment-3016742982 (but then I also noticed rust-lang/rust#140722) This replaces the feature gate with a parser error that says let chains require 2024. A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.
2025-07-02Make the enum check work for negative discriminantsBastian Kersting-0/+67
The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly.
2025-07-02Move crashes tests.Camille GILLOT-0/+71
2025-07-02Auto merge of #142974 - cuviper:stage0-bump, r=Mark-Simulacrumbors-1/+1
Update stage0 to 1.89.0-beta.1 - Update version placeholders - Update stage0 to 1.89.0-beta.1 - Update `STAGE0_MISSING_TARGETS` - Update `cfg(bootstrap)` r? `@Mark-Simulacrum` try-job: dist-i586-gnu-i586-i686-musl
2025-07-02Consider polarity in sizedness fast pathMichael Goulet-0/+23