about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-11-15Auto merge of #117878 - gavinleroy:proper-depth-check, r=lcnrbors-0/+2
Fix depth check in ProofTreeVisitor. The hack to cutoff overflows and cycles in the new trait solver was incorrect. We want to inspect everything with depth [0..10]. This fix exposed a previously unseen bug, which caused the compiler to ICE when invoking `trait_ref` on a non-assoc type projection. I simply added the guard in the `AmbiguityCausesVisitor`, and updated the expected output for the `auto-trait-coherence` test which now includes the extra note: ```text | = note: upstream crates may add a new impl of trait `std::marker::Send` for type `OpaqueType` in future versions ``` r? `@lcnr`
2023-11-15Auto merge of #116555 - paulmenage:llvm-module-flag, r=wesleywiserbors-0/+7
Add -Z llvm_module_flag Allow adding values to the `!llvm.module.flags` metadata for a generated module. The syntax is `-Z llvm_module_flag=<name>:<type>:<value>:<behavior>` Currently only u32 values are supported but the type is required to be specified for forward compatibility. The `behavior` element must match one of the named LLVM metadata behaviors.viors. This flag is expected to be perma-unstable.
2023-11-15Auto merge of #117908 - lcnr:region-kind-rename, r=BoxyUwUbors-7/+7
finish `RegionKind` renaming second step of https://github.com/rust-lang/types-team/issues/95 continues the work from #117876. While working on this and I encountered a bunch of further cleanup which I'll either open a tracking issue for or will do in a separate PR: - rewrite the `RegionKind` docs, they still talk about `ReEmpty` and are generally out of date - rename `DescriptionCtx` to `DescriptionCtxt` - what is `CheckRegions::Bound`? - `collect_late_bound_regions` et al - `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`? - `EraseEarlyRegions` visitor should be removed, feels duplicate r? `@BoxyUwU`
2023-11-15Auto merge of #117848 - compiler-errors:method-ambiguity-no-rcvr, r=TaKO8Kibors-0/+46
Don't expect a rcvr in `print_disambiguation_help` We don't necessarily have a receiver when we are both accidentally using the `.` operator *AND* we have more than one ambiguous method candidate. Fixes #117728
2023-11-15Auto merge of #117517 - klinvill:smir-projections, r=ouz-abors-0/+173
Add richer structure for Stable MIR Projections Resolves https://github.com/rust-lang/project-stable-mir/issues/49. Projections in Stable MIR are currently just strings. This PR replaces that representation with a richer structure, namely projections become vectors of `ProjectionElem`s, just as in MIR. The `ProjectionElem` enum is heavily based off of the MIR `ProjectionElem`. This PR is a draft since there are several outstanding issues to resolve, including: - How should `UserTypeProjection`s be represented in Stable MIR? In MIR, the projections are just a vector of `ProjectionElem<(),()>`, meaning `ProjectionElem`s that don't have Local or Type arguments (for `Index`, `Field`, etc. objects). Should `UserTypeProjection`s be represented this way in Stable MIR as well? Or is there a more user-friendly representation that wouldn't drag along all the `ProjectionElem` variants that presumably can't appear? - What is the expected behavior of a `Place`'s `ty` function? Should it resolve down the chain of projections so that something like `*_1.f` would return the type referenced by field `f`? - Tests should be added for `UserTypeProjection`
2023-11-15Auto merge of #117359 - tmiasko:call-def, r=cjgillotbors-0/+30
Fix def-use check for call terminators Fixes #117331.
2023-11-14Rollup merge of #117893 - sjwang05:issue-52544-take-1, r=wesleywiserMatthias Krüger-0/+30
Suggest dereferencing the LHS for binops such as `&T == T` Fixes #52544
2023-11-14Rollup merge of #117686 - compiler-errors:gen-body, r=wesleywiserMatthias Krüger-0/+25
Build pre-coroutine-transform coroutine body on error I was accidentally building the post-transform coroutine body, rather than the pre-transform coroutine body. There's no pinning expected here yet, and the return type isn't yet transformed into `CoroutineState`. Fixes #117670
2023-11-14Rollup merge of #116244 - estebank:issue-73497, r=b-naberMatthias Krüger-1/+13
Apply structured suggestion that allows test to work since 1.64 Close #73497.
2023-11-14Fix def-use check for call terminatorsTomasz Miąsko-0/+30
2023-11-14review + fix CIlcnr-1/+1
2023-11-14finish `RegionKind` renamelcnr-6/+6
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-14Add guard checking for associated types before computing intercrate ↵Gavin Gray-0/+2
ambiguity of projections. Bless test with more specific notes on the ambiguity cause.
2023-11-14Auto merge of #117330 - tmiasko:custom-mir-cleanup-blocks, r=cjgillotbors-25/+182
Custom MIR: Support cleanup blocks Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-14Custom MIR: Support cleanup blocksTomasz Miąsko-25/+182
Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-14Auto merge of #117856 - estebank:issue-66023, r=compiler-errorsbors-0/+24
Always point at index span on index obligation failure Use more targetted span for index obligation failures by rewriting the obligation cause span. CC #66023
2023-11-13Suggest lhs deref for binopssjwang05-0/+30
2023-11-13Rollup merge of #117879 - durin42:nneg-zext, r=nikicMatthias Krüger-2/+2
tests: update check for inferred nneg on zext This was broken by upstream llvm/llvm-project@dc6d0773960c664eee12a1ed871fad5c81a20a12. It's easy enough to use a regex match to support both, so we do that. r? `@nikic` `@rustbot` label: +llvm-main
2023-11-13Rollup merge of #117695 - ↵Matthias Krüger-0/+22
3tilley:prioritise-unwrap-expect-over-last-method-call, r=compiler-errors Reorder checks to make sure potential missing expect on Option/Result… … runs before removing last method call Fixes #117669
2023-11-13review comments: more targeted span setting approachEsteban Küber-0/+4
2023-11-13Auto merge of #117881 - TaKO8Ki:rollup-n7jtmgj, r=TaKO8Kibors-12/+20
Rollup of 5 pull requests Successful merges: - #117737 (Remove `-Zkeep-hygiene-data`.) - #117830 (Small improvements in object lifetime default code) - #117858 (Compute layout with spans for better cycle errors in coroutines) - #117863 (Remove some unused stuff from `rustc_index`) - #117872 (Cranelift isn't available on non-nightly channels) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-14Rollup merge of #117858 - compiler-errors:span, r=lcnrTakayuki Maeda-12/+20
Compute layout with spans for better cycle errors in coroutines Split out from #117703, this PR at least gives us a nicer span to point at when we hit a cycle error in coroutine layout cycles.
2023-11-13tests: update check for inferred nneg on zextAugie Fackler-2/+2
This was broken by upstream llvm/llvm-project@dc6d0773960c664eee12a1ed871fad5c81a20a12. It's easy enough to use a regex match to support both, so we do that. r? @nikic @rustbot label: +llvm-main
2023-11-13Auto merge of #117876 - lcnr:region-kind-rename, r=BoxyUwUbors-18/+18
`ReLateBound` -> `ReBound` first step of https://github.com/rust-lang/types-team/issues/95 already fairly large xx there's some future work here I intentionally did not contribute as part of this PR, from my notes: - `DescriptionCtx` to `DescriptionCtxt` - what is `CheckRegions::Bound`? - `collect_late_bound_regions` et al - `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`? - `EraseEarlyRegions` should be removed, feels duplicate r? `@BoxyUwU`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-18/+18
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-13Auto merge of #117811 - MU001999:master, r=lcnrbors-0/+28
Turn assert_eq into a delay_span_bug Fixes #117789
2023-11-13Auto merge of #117827 - Zalathar:bogus-macro-name-span, r=davidtwcobors-0/+90
coverage: Avoid creating malformed macro name spans This is a workaround for #117788. It detects a particular scenario where we would create malformed coverage spans that might cause `llvm-cov` to immediately exit with an error, preventing the user from processing coverage reports. The patch has been kept as simple as possible so that it's trivial to backport to beta (or stable) if desired. --- The `maybe_push_macro_name_span` method is trying to detect macro invocations, so that it can split a span into two parts just after the `!` of the invocation. Under some circumstances (probably involving nested macros), it gets confused and produces a span that is larger than the original span, and possibly extends outside its enclosing function and even into an adjacent file. In extreme cases, that can result in malformed coverage mappings that cause `llvm-cov` to fail. For now, we at least want to detect these egregious cases and avoid them, so that coverage reports can still be produced.
2023-11-13Compute layout with spans for better cycle errors in coroutinesMichael Goulet-12/+20
2023-11-13Auto merge of #117770 - sjwang05:issue-117766, r=estebank,TaKO8Kibors-0/+123
Catch stray `{` in let-chains Fixes #117766
2023-11-13coverage: Regression test for #117788Zalathar-0/+90
Without the workaround applied, this test will produce malformed mappings that cause `llvm-cov` to fail. (And if it does emit well-formed mappings, they should be obviously incorrect.)
2023-11-13Always point at index span on index obligation failureEsteban Küber-0/+20
Use more targetted span for index obligation failures by rewriting the obligation cause span. CC #66023
2023-11-13Turn assert_eq into a delay_span_bugMu001999-0/+28
2023-11-12Don't expect a rcvr in print_disambiguation_helpMichael Goulet-0/+46
2023-11-12Auto merge of #117817 - fmease:deny-more-tilde-const, r=fee1-deadbors-86/+396
Deny more `~const` trait bounds thereby fixing a family of ICEs (delayed bugs) for `feature(const_trait_impl, effects)` code. As discussed r? `@fee1-dead`
2023-11-11Add -Z llvm_module_flagPaul Menage-0/+7
Allow adding values to the `!llvm.module.flags` metadata for a generated module. The syntax is `-Z llvm_module_flag=<name>:<type>:<value>:<behavior>` Currently only u32 values are supported but the type is required to be specified for forward compatibility. The `behavior` element must match one of the named LLVM metadata behaviors.viors. This flag is expected to be perma-unstable.
2023-11-12Deny more `~const` trait boundsLeón Orell Valerian Liehr-86/+396
2023-11-11Move unclosed delim errors to separate functionsjwang05-10/+4
2023-11-11Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnaybors-1/+1
Add `std::hash::{DefaultHasher, RandomState}` exports (needs FCP) This implements rust-lang/libs-team#267 to move the libstd hasher types to `std::hash` where they belong, instead of `std::collections::hash_map`. <details><summary>The below no longer applies, but is kept for clarity.</summary> This is a small refactor for #27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API. I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of `std::hash`, but for now, they're at least separated out from the collections code in a way that will make moving that around easier. I decided to simply copy the rustdoc for `std::hash` from `core::hash` since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred. </details>
2023-11-10Recurse over the method chain and maintain a stack to peek at previous ↵Swapna Iyer-1/+50
receiver to align spans
2023-11-10Correctly handle while-let-chainssjwang05-2/+49
2023-11-09Catch an edge casesjwang05-1/+13
2023-11-09Remove rich UserTypeProjection projections in SMIRKirby Linvill-1/+1
It's not clear to me (klinvill) that UserTypeProjections are produced anymore with the removal of type ascriptions as per https://github.com/rust-lang/rfcs/pull/3307. Furthermore, it's not clear to me which variants of ProjectionElem could appear in such projections. For these reasons, I'm reverting projections in UserTypeProjections to simple strings until I can get more clarity on UserTypeProjections.
2023-11-09Replace match assertions against empty slices with is_empty assertionsKirby Linvill-8/+6
Asserting is_empty is slightly more concise.
2023-11-09Move SMIR projections tests to new fileKirby Linvill-103/+175
2023-11-09Add stable MIR Projections support based on MIR structureKirby Linvill-0/+103
This commit includes richer projections for both Places and UserTypeProjections. However, the tests only touch on Places. There are also outstanding TODOs regarding how projections should be resolved to produce Place types, and regarding if UserTypeProjections should just contain ProjectionElem<(),()> objects as in MIR.
2023-11-09Catch stray { in let-chainssjwang05-0/+70
2023-11-10Rollup merge of #117751 - aDotInTheVoid:unkind, r=GuillaumeGomezMatthias Krüger-2/+3
rustdoc-json: Fix test so it actually checks things After #111427, no item has a `kind` field, so these assertions could never fail. Instead, assert that those two items arn't present. r? `@GuillaumeGomez`
2023-11-10Rollup merge of #117743 - sjwang05:issue-117720, r=estebankMatthias Krüger-0/+77
Suggest removing `;` for `;` within let-chains Fixes #117720
2023-11-09Auto merge of #117727 - saethlin:inline-derived-fmt, r=nnethercotebors-2/+22
Emit #[inline] on derive(Debug) While working on https://github.com/rust-lang/rust/pull/116583 I noticed that the `cross_crate_inlinable` query identifies a lot of derived `Debug` impls as a MIR body that's little more than a call, which suggests they may be a good candidate for `#[inline]`. So here I've implemented that change specifically. It seems to provide a nice improvement to build times.
2023-11-09Emit #[inline] on derive(Debug)Ben Kimock-2/+22