summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-06-26Auto merge of #98462 - cjgillot:no-apit-hrtb-beta, r=Mark-Simulacrumbors-0/+16
[beta] Fail gracefully when encountering an HRTB in APIT. Backport of https://github.com/rust-lang/rust/pull/97683 The diagnostic is a bit worse, but still better than an ICE. r? `@ehuss`
2022-06-24beta fallout.Camille GILLOT-6/+0
2022-06-24Fail gracefully when encountering an HRTB in APIT.Camille GILLOT-0/+22
2022-06-23Rollup merge of #98336 - fmease:remove-faulty-doc-hidden-lint, r=GuillaumeGomezYuki Okushi-151/+0
Remove the unused-`#[doc(hidden)]` logic from the `unused_attributes` lint Fixes #96890. It was found out that `#[doc(hidden)]` on trait impl items does indeed have an effect on the generated documentation (see the linked issue). In my opinion and the one of [others](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60/near/281846219), rustdoc's output is actually a bit flawed in that regard but that should be tracked in a new issue I suppose (I will open an issue for that in the near future). The check was introduced in #96008 which is marked to be part of version `1.62` (current `beta`). As far as I understand, this means that **this PR needs to be backported** to `beta` to fix #96890 on time. Correct me if I am wrong. CC `@dtolnay` (in case you would like to agree or disagree with my decision to fully remove this check) `@rustbot` label A-lint T-compiler T-rustdoc r? `@rust-lang/compiler`
2022-06-23Rollup merge of #97636 - nnethercote:revert-96682, r=dtolnayDylan DPC-86/+59
Revert #96682. The change was "Show invisible delimiters (within comments) when pretty printing". It's useful to show these delimiters, but is a breaking change for some proc macros. Fixes #97608. r? ``@petrochenkov``
2022-06-23Rollup merge of #97431 - compiler-errors:issue-97413, r=oli-obkMichael Goulet-0/+18
don't do `Sized` and other return type checks on RPIT's real type Fixes an ICE where we're doing `Sized` check against the RPIT's real type, instead of against the opaque type. This differs from what we're doing in MIR typeck, which causes ICE #97226. This regressed in #96516 -- this adjusts that fix to be a bit more conservative. That PR was backported and thus the ICE is also present in stable. Not sure if it's worth to beta and/or stable backport, probably not the latter but I could believe the former. r? `@oli-obk` cc: another attempt to fix this ICE #97413. I believe this PR addresses the root cause.
2022-06-13Revert "Check that closures satisfy their where bounds"Oli Scherer-79/+20
This reverts commit 253408b4090bc15b88bb5faecaf1e9765be80587.
2022-06-07Remove arg_matrix.rs, bless testsMichael Goulet-6396/+1496
2022-06-01Rollup merge of #97328 - petrochenkov:nativice, r=michaelwoeristerDylan DPC-0/+11
rustc: Fix ICE in native library error reporting Fixes https://github.com/rust-lang/rust/issues/97299
2022-06-01Rollup merge of #97303 - compiler-errors:arg-typos, r=jackh726Dylan DPC-1/+26
Fix some typos in arg checking algorithm Fixes #97197 Also fixes a typo where if we're missing args A, B, C, we actually say A, B, B
2022-05-14Auto merge of #97039 - cjgillot:no-rpit-hrtb, r=jackh726bors-98/+221
Forbid nested opaque types to reference HRTB from opaque types. Avoids https://github.com/rust-lang/rust/issues/96194 Alternative to https://github.com/rust-lang/rust/pull/96970 r? `@oli-obk`
2022-05-14Add a test with both passing and erroneous cases.Camille GILLOT-0/+146
2022-05-14Auto merge of #95826 - carbotaniuman:miri-permissive-provenance, r=RalfJungbors-2/+2
Initial work on Miri permissive-exposed-provenance Rustc portion of the changes for portions of a permissive ptr-to-int model for Miri. The main changes here are changing `ptr_get_alloc` and `get_alloc_id` to return an Option, and also making ptr-to-int casts have an expose side effect.
2022-05-14Forbid nested opaque types to reference HRTB from opaque types.Camille GILLOT-98/+75
2022-05-14Rollup merge of #97031 - eholk:drop-tracking-type-error, r=compiler-errorsYuki Okushi-0/+25
Drop tracking: handle invalid assignments better Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
2022-05-13Drop tracking: handle invalid assignments betterEric Holk-0/+25
Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
2022-05-13Rustc changes for permissive provenancecarbotaniuman-2/+2
2022-05-13Rollup merge of #97011 - JohnTitor:issue-28935, r=compiler-errorsMatthias Krüger-0/+9
Add regression test for #28935 Closes #28935, one of the ancient issues can be closed :) r? `@compiler-errors`
2022-05-13Rollup merge of #96615 - JohnTitor:test-54779, r=compiler-errorsMatthias Krüger-0/+62
Add a regression test for #54779 Closes #54779 r? `@jackh726`
2022-05-13Add regression test for #28935Yuki Okushi-0/+9
2022-05-13For non-defining opaque type usage errors, don't try to also prove all trait ↵Oli Scherer-184/+6
bounds
2022-05-13Check that closures satisfy their where boundsOli Scherer-14/+327
2022-05-13Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwcoMatthias Krüger-6/+6
Be more precise than DefPathData::Misc. This variant was used for two unrelated things. Let's make this cleaner.
2022-05-13Rollup merge of #96948 - ludfo774:macro-trailing-comma-test, r=joshtriplettMatthias Krüger-0/+6
Add test of matches macro for trailing commas Almost all macros are tested for trailing commas. The macro matches! was however not tested. This PR adds that test case. Related to #46238
2022-05-12Bless tests.Camille GILLOT-6/+6
2022-05-12Rollup merge of #96968 - cjgillot:codegen-fulfill-nice, r=oli-obkMatthias Krüger-0/+189
Add tests for #96806 I messed up the rebase in https://github.com/rust-lang/rust/pull/96806. I took the opportunity to add an extra mir-opt test from https://github.com/rust-lang/rust/pull/91743. r? `@oli-obk`
2022-05-12Add tests.Camille GILLOT-0/+189
2022-05-12Auto merge of #96940 - TaKO8Ki:stop-suggesting-wrong-fully-qualified-path, ↵bors-0/+59
r=estebank Stop suggesting non-existing fully qualified paths This patch fixes a part of #96295. r? `@estebank`
2022-05-12Auto merge of #95837 - scottmcm:ptr-offset-from-unsigned, r=oli-obkbors-3/+41
Add `sub_ptr` on pointers (the `usize` version of `offset_from`) We have `add`/`sub` which are the `usize` versions of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`. As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change. This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
2022-05-11Apply CR suggestions; add real tracking issueScott McMurray-1/+2
2022-05-11Rename `unsigned_offset_from` to `sub_ptr`Scott McMurray-1/+1
2022-05-11Add `unsigned_offset_from` on pointersScott McMurray-3/+40
Like we have `add`/`sub` which are the `usize` version of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`. As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change. This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
2022-05-12Auto merge of #96150 - est31:unused_macro_rules, r=petrochenkovbors-46/+209
Implement a lint to warn about unused macro rules This implements a new lint to warn about unused macro rules (arms/matchers), similar to the `unused_macros` lint added by #41907 that warns about entire macros. ```rust macro_rules! unused_empty { (hello) => { println!("Hello, world!") }; () => { println!("empty") }; //~ ERROR: 1st rule of macro `unused_empty` is never used } fn main() { unused_empty!(hello); } ``` Builds upon #96149 and #96156. Fixes #73576
2022-05-11Auto merge of #96806 - cjgillot:codegen-fulfill-nice, r=oli-obkbors-10/+47
Gracefully fail to resolve associated items instead of `delay_span_bug`. `codegen_fulfill_obligation` is used during instance resolution for trait items. In case of insufficient normalization issues during MIR inlining, it caused ICEs. It's better to gracefully refuse to resolve the associated item, and let the caller decide what to do with this. Split from https://github.com/rust-lang/rust/pull/91743 Closes #69121 Closes #73021 Closes #88599 Closes #93008 Closes #93248 Closes #94680 Closes #96170 r? `@oli-obk`
2022-05-11Add test of matches macro for trailing commasludfo774-0/+6
2022-05-11stop suggesting non-existing fully qualified pathsTakayuki Maeda-0/+59
2022-05-11Gracefully fail to resolve associated items instead of `delay_span_bug`.Camille GILLOT-10/+47
2022-05-11Rollup merge of #96925 - c410-f3r:z-errors, r=JohnTitorYuki Okushi-0/+10
Fix issue #95151 Fixes #95151 Nothing special here, just a test for a thing that used to ICE.
2022-05-11Rollup merge of #96903 - oli-obk:opaque_type_lifetime_constraints, ↵Yuki Okushi-0/+17
r=compiler-errors Use lifetimes on type-alias-impl-trait used in function signatures to infer output type lifetimes fixes https://github.com/rust-lang/rust/issues/96564 TLDR: ```rust fn execute(ty: Ty<'_>) -> &str { todo!() } ``` (`Ty` being a type alias impl trait) used to produce the following error before this PR ``` error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types --> src/lib.rs:4:27 | 4 | fn execute(ty: Ty<'_>) -> &str { todo!() } | ^^^^ | = note: lifetimes appearing in an associated type are not considered constrained ```
2022-05-11Rollup merge of #96896 - JohnTitor:issue-68408, r=compiler-errorsYuki Okushi-0/+22
Add regression test for #68408 Closes https://github.com/rust-lang/rust/issues/68408
2022-05-10Fix issue #95151Caio-0/+10
2022-05-10Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitorbors-15/+152
Rollup of 6 pull requests Successful merges: - #96717 (Handle mismatched generic param kinds in trait impls betterly) - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows) - #96849 (Move some tests to more reasonable places) - #96861 (Use Rust 2021 prelude in std itself.) - #96879 (rustdoc: search result ranking fix) - #96882 (Don't subst an AdtDef with its own substs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-11Rollup merge of #96849 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-0/+0
Move some tests to more reasonable places cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov`
2022-05-11Rollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnrYuki Okushi-15/+152
Handle mismatched generic param kinds in trait impls betterly - Check that generic params on a generic associated type are the same as in the trait definition - Check that const generics are not used in place of type generics (and the other way round too) r? `@lcnr`
2022-05-10Use lifetimes on type-alias-impl-trait used in function signatures to infer ↵Oli Scherer-0/+17
output type lifetimes
2022-05-10Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwcobors-137/+229
Check hidden types for well formedness at the definition site instead of only at the opaque type itself work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
2022-05-10Add regression test for #68408Yuki Okushi-0/+22
2022-05-10Check hidden types for well formedness at the definition site instead of ↵Oli Scherer-137/+229
only at the opaque type itself
2022-05-10Rollup merge of #96872 - RalfJung:layout-sanity, r=eddybDylan DPC-21/+109
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks `@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution! I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones. Cc `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/96221
2022-05-10Rollup merge of #96812 - cjgillot:no-lint-outllives-macro, r=petrochenkovDylan DPC-0/+48
Do not lint on explicit outlives requirements from external macros. The current implementation of the list rightfully skipped where predicates from external macros. However, if the where predicate came from the current macro but the bounds were from an external macro, the lint still fired. Closes https://github.com/rust-lang/rust/issues/96640