about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-08-30Test variances of TAITsOli Scherer-0/+136
2023-08-30Revert "Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726"Oli Scherer-79/+62
This reverts commit cb9467515b5a9b15aaa905683c6b4dd9e851056c, reversing changes made to 57781b24c54f9548722927ba88c343ff28da94ce.
2023-08-30Rollup merge of #115363 - kpreid:suggest-private, r=compiler-errorsMatthias Krüger-0/+25
Don't suggest adding parentheses to call an inaccessible method. Previously, code of this form would emit E0615 (attempt to use a method as a field), thus emphasizing the existence of private methods that the programmer probably does not care about. Now it ignores their existence instead, producing error E0609 (no field). The motivating example is: ```rust let x = std::rc::Rc::new(()); x.inner; ``` which would previously mention the private method `Rc::inner()`, even though `Rc<T>` intentionally has no public methods so that it can be a transparent smart pointer for any `T`. ```rust error[E0615]: attempted to take value of method `inner` on type `Rc<()>` --> src/main.rs:3:3 | 3 | x.inner; | ^^^^^ method, not a field | help: use parentheses to call the method | 3 | x.inner(); | ++ ``` With this change, it emits E0609 and no suggestion.
2023-08-30Rollup merge of #115355 - lqd:issue-115351, r=compiler-errorsMatthias Krüger-0/+39
new solver: handle edge case of a recursion limit of 0 Apparently a recursion limit of 0 is possible/valid/useful/used/cute, the more you know 🌟 . (It's somewhat interesting to me that the old solver seemingly handles this, and that the new solver currently requires a recursion limit of 2 here) r? `@compiler-errors.` Fixes #115351.
2023-08-30Rollup merge of #115347 - y21:generic-bound-impl-trait-ty, r=compiler-errorsMatthias Krüger-0/+40
suggest removing `impl` in generic trait bound position rustc already does this recovery in type param position (`<T: impl Trait>` -> `<T: Trait>`). This PR also adds that suggestion in trait bound position (e.g. `where T: impl Trait` or `trait Trait { type Assoc: impl Trait; }`)
2023-08-30Rollup merge of #115313 - gurry:issue-114918-cycle-detected, r=compiler-errorsMatthias Krüger-0/+91
Make `get_return_block()` return `Some` only for HIR nodes in body Fixes #114918 The issue occurred while compiling the following input: ```rust fn uwu() -> [(); { () }] { loop {} } ``` It was caused by the code below trying to suggest a missing return type which resulted in a const eval cycle: https://github.com/rust-lang/rust/blob/1bd043098e05839afb557bd7a2858cb09a4054ca/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs#L68-L75 The root cause was `get_return_block()` returning an `Fn` node for a node in the return type (i.e. the second `()` in the return type `[(); { () }]` of the input) although it is supposed to do so only for nodes that lie in the body of the function and return `None` otherwise (at least as per my understanding). The PR fixes the issue by fixing this behaviour of `get_return_block()`.
2023-08-30Rollup merge of #114704 - bvanjoi:fix-114636, r=compiler-errorsMatthias Krüger-38/+44
parser: not insert dummy field in struct Fixes #114636 This PR eliminates the dummy field, initially introduced in #113999, thereby enabling unrestricted use of `ident.unwrap()`. A side effect of this action is that we can only report the error of the first macro invocation field within the struct node. An alternative solution might be giving a virtual name to the macro, but it appears more complex.(https://github.com/rust-lang/rust/issues/114636#issuecomment-1670228715). Furthermore, if you think https://github.com/rust-lang/rust/issues/114636#issuecomment-1670228715 is a better solution, feel free to close this PR.
2023-08-30Make get_return_block() return Some only for HIR nodes in bodyGurinder Singh-0/+91
Fixes # 114918
2023-08-29Don't suggest adding parentheses to call an inaccessible method.Kevin Reid-0/+25
Previously, the test code would emit E0615, thus revealing the existence of private methods that the programmer probably does not care about. Now it ignores their existence instead, producing error E0609 (no field). The motivating example is: ```rust let x = std::rc::Rc::new(()); x.inner; ``` which would previously mention the private method `Rc::inner()`, even though `Rc<T>` intentionally has no public methods so that it can be a transparent smart pointer for any `T`.
2023-08-29add non-regression test for issue 115351Rémy Rakic-0/+39
2023-08-29Rollup merge of #115187 - ouz-a:smir_wrap, r=oli-obkMatthias Krüger-31/+3
Add new interface to smir Removes the boiler plate from `crate-info.rs`, and creates new interface for the smir. Addressing https://github.com/rust-lang/project-stable-mir/issues/23 r? `@spastorino`
2023-08-29Rollup merge of #115174 - davidtwco:needs-test-bad-location-list-67992, ↵Matthias Krüger-0/+31
r=wesleywiser tests: add test for #67992 Fixes #67992. Just adding a regression test for this issue.
2023-08-29Rollup merge of #111580 - atsuzaki:layout-ice, r=oli-obkMatthias Krüger-0/+42
Don't ICE on layout computation failure Fixes #111176 regression. r? `@oli-obk`
2023-08-29suggest removing `impl` in generic trait bound positiony21-0/+40
2023-08-29Auto merge of #112775 - c410-f3r:t3st3ss, r=petrochenkovbors-0/+0
Move tests r? `@petrochenkov`
2023-08-29Create StableMir replacer for SMirCallsouz-a-31/+3
2023-08-29there seems to be no reason to treat ZST specially in these casesRalf Jung-7/+7
2023-08-29rustc_abi: audit uses of is_zst; fix a case of giving an enum insufficient ↵Ralf Jung-0/+58
alignment
2023-08-29Auto merge of #115260 - scottmcm:not-quite-so-cold, r=WaffleLapkinbors-2/+11
Use `preserve_mostcc` for `extern "rust-cold"` As experimentation in #115242 has shown looks better than `coldcc`. Notably, clang exposes `preserve_most` (https://clang.llvm.org/docs/AttributeReference.html#preserve-most) but not `cold`, so this change should put us on a better-supported path. And *don't* use a different convention for cold on Windows, because that actually ends up making things worse. (See comment in the code.) cc tracking issue #97544
2023-08-28Move testsCaio-0/+0
2023-08-28Auto merge of #115326 - matthiaskrgr:rollup-qsoa8ar, r=matthiaskrgrbors-429/+131
Rollup of 8 pull requests Successful merges: - #115164 (MIR validation: reject in-place argument/return for packed fields) - #115240 (codegen_llvm/llvm_type: avoid matching on the Rust type) - #115294 (More precisely detect cycle errors from type_of on opaque) - #115310 (Document panic behavior across editions, and improve xrefs) - #115311 (Revert "Suggest using `Arc` on `!Send`/`!Sync` types") - #115317 (Devacationize oli-obk) - #115319 (don't use SnapshotVec in Graph implementation, as it looks unused; use Vec instead) - #115322 (Tweak output of `to_pretty_impl_header` involving only anon lifetimes) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-28Don't ICE on layout computation failureKatherine Philip-0/+42
2023-08-28Auto merge of #114489 - compiler-errors:rpitit-capture-all, r=oli-obkbors-70/+149
Make RPITITs capture all in-scope lifetimes Much like #114616, this implements the lang team decision from this T-lang meeting on [opaque captures strategy moving forward](https://hackmd.io/sFaSIMJOQcuwCdnUvCxtuQ?view). This will be RFC'd soon, but given that RPITITs are a nightly feature, this shouldn't necessarily be blocked on that. We unconditionally capture all lifetimes in RPITITs -- impl is not as simple as #114616, since we still need to duplicate RPIT lifetimes to make sure we reify any late-bound lifetimes in scope. Closes #112194
2023-08-28Rollup merge of #115322 - estebank:list-tweak, r=compiler-errorsMatthias Krüger-15/+15
Tweak output of `to_pretty_impl_header` involving only anon lifetimes Do not print `impl<> Foo for &Bar`.
2023-08-28Rollup merge of #115311 - dtolnay:usearcself, r=compiler-errorsMatthias Krüger-209/+11
Revert "Suggest using `Arc` on `!Send`/`!Sync` types" Closes https://github.com/rust-lang/rust/issues/114687. This is a clean revert of https://github.com/rust-lang/rust/pull/88936 + https://github.com/rust-lang/rust/pull/115210. The suggestion to Arc\<{Self}\> when Self does not implement Send is *always* wrong. https://github.com/rust-lang/rust/pull/114842 is considering a way to make a more refined suggestion.
2023-08-28Rollup merge of #115294 - compiler-errors:cycle-err, r=oli-obkMatthias Krüger-205/+105
More precisely detect cycle errors from type_of on opaque Not sure if this still needs work. Just putting it up for initial impressions, since it seems that a few people are frustrated with the increased error verbosity due to #113320. Essentially we introduce a new sub-query for `type_of` specifically for opaques which returns a value that is able to distinguish "has errors" from "due to cycle recovery". Fixes #115188 r? `@oli-obk`
2023-08-28Tweak output of `to_pretty_impl_header` involving only anon lifetimesEsteban Küber-15/+15
Do not print `impl<> Foo for &Bar`.
2023-08-28Auto merge of #115050 - khei4:khei4/codegen-move-before-nocapture, r=nikicbors-0/+22
add codegen test for the move before passing to nocapture, by shared-ref arg This PR adds codegen test for https://github.com/rust-lang/rust/issues/107436#issuecomment-1685792517 (It seems like this works from llvm-16?) Fixes #107436
2023-08-28Auto merge of #114774 - Enselic:less-move-size-noise, r=oli-obkbors-21/+4
Avoid duplicate `large_assignments` lints By checking for overlapping spans. This PR does the "reduce noisiness" task in #83518. r? `@oli-obk` who added E-mentor and E-help-wanted and wrote the initial code. (The fix itself is in https://github.com/rust-lang/rust/pull/114774/commits/dc82736677a134a1b52def496db111681c053e82. The two commits before that are just small refactorings.)
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-209/+11
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-28Rollup merge of #115280 - RalfJung:panic-cleanup-triple-backtrace, r=AmanieuMatthias Krüger-11/+12
avoid triple-backtrace due to panic-during-cleanup Supersedes https://github.com/rust-lang/rust/pull/115020 Cc https://github.com/rust-lang/rust/issues/114954 r? ``@Amanieu``
2023-08-28Better error message for object type with GATMichael Goulet-6/+12
2023-08-28Test variances of opaque capturesMichael Goulet-0/+88
2023-08-28Bless testsMichael Goulet-9/+32
2023-08-28RPITITs capture all their lifetimesMichael Goulet-58/+20
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-205/+105
2023-08-27avoid triple-backtrace due to panic-during-cleanupRalf Jung-11/+12
2023-08-27Auto merge of #115231 - saethlin:dont-ignore-wasm, r=Mark-Simulacrumbors-22/+18
Remove some wasm/emscripten ignores I'm planning on landing a few PRs like this that remove ignores that aren't required. This just covers mir-opt and codegen tests.
2023-08-27Auto merge of #115226 - RalfJung:debug-abi, r=compiler-errorsbors-19/+302
add rustc_abi debugging attribute This is the call ABI equivalent of `rustc_layout(debug)`. Fixes https://github.com/rust-lang/rust/issues/115168 r? `@bjorn3`
2023-08-27Auto merge of #115139 - cjgillot:llvm-fragment, r=nikicbors-0/+77
Do not forget to pass DWARF fragment information to LLVM. Fixes https://github.com/rust-lang/rust/issues/115113 for the rustc part
2023-08-27add rustc_abi debugging attributeRalf Jung-19/+302
2023-08-27Rollup merge of #114957 - loongarch-rs:fix-tests, r=Mark-SimulacrumMatthias Krüger-2/+2
tests: Fix tests for LoongArch64 This PR fixes `lp64d abi` tests for LoongArch64.
2023-08-27Rollup merge of #114924 - Zalathar:tidy-tests, r=Mark-SimulacrumMatthias Krüger-122/+100
coverage: Tidy up `run-coverage` tests in several small ways Prior to #114875 (anonymized line numbers), these tests were very sensitive to lines being added/removed, since doing so would change the line numbers in every subsequent line of output. Therefore they ended up with a few small style issues that weren't worth the hassle of fixing. Now that we can freely rearrange lines without needing to re-bless the entire output, we can tidy up the tests in various trivial ways.
2023-08-26Use `preserve_mostcc` for `extern "rust-cold"`Scott McMurray-2/+11
As experimentation in 115242 has shown looks better than `coldcc`. And *don't* use a different convention for cold on Windows, because that actually ends up making things worse. cc tracking issue 97544
2023-08-26Restrict test to x86_64.Camille GILLOT-0/+3
2023-08-26Auto merge of #115219 - estebank:issue-105306, r=compiler-errorsbors-155/+163
Point at type parameter that introduced unmet bound instead of full HIR node ``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> $DIR/issue-87199.rs:18:15 | LL | ref_arg::<[i32]>(&[5]); | ^^^^^ doesn't have a size known at compile-time ``` instead of ``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> $DIR/issue-87199.rs:18:22 | LL | ref_arg::<[i32]>(&[5]); | ---------------- ^^^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call ``` ------ ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/own-bound-span.rs:14:24 | LL | let _: <S as D>::P<String>; | ^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `D::P` --> $DIR/own-bound-span.rs:4:15 | LL | type P<T: Copy>; | ^^^^ required by this bound in `D::P` ``` instead of ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/own-bound-span.rs:14:12 | LL | let _: <S as D>::P<String>; | ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `D::P` --> $DIR/own-bound-span.rs:4:15 | LL | type P<T: Copy>; | ^^^^ required by this bound in `D::P` ``` Fix #105306.
2023-08-26Account for `Weak` alias kinds when adding more targetted obligationEsteban Küber-12/+15
2023-08-26Remove unnecessary `select_obligations_where_possible` and redundant errorsEsteban Küber-92/+10
2023-08-26More accurately point at argumentsEsteban Küber-93/+91
2023-08-26Do not produce fragment for ZST.Camille GILLOT-8/+37