about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-15always check alignment during CTFERalf Jung-40/+74
2022-12-15fix tidy and add rpitit testDeadbeef-2/+23
2022-12-15Auto merge of #105746 - matthiaskrgr:rollup-sz3grbv, r=matthiaskrgrbors-153/+292
Rollup of 11 pull requests Successful merges: - #104592 (Ensure async trait impls are async (or otherwise return an opaque type)) - #105623 (Fix `-Z print-type-sizes` for generators with discriminant field ordered first) - #105627 (Auto traits in `dyn Trait + Auto` are suggestable) - #105633 (Make `report_projection_error` more `Term` agnostic) - #105683 (Various cleanups to dest prop) - #105692 (Add regression test for #104678) - #105707 (rustdoc: remove unnecessary CSS `kbd { cursor: default }`) - #105715 (Do not mention long types in E0599 label) - #105722 (more clippy::complexity fixes) - #105724 (rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`) - #105730 (rustdoc: remove no-op CSS `.item-info:before { color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-15Rollup merge of #105715 - estebank:unsatisfied-bounds-label, r=compiler-errorsMatthias Krüger-4/+4
Do not mention long types in E0599 label The type is already mentioned in the main message and the list of unmet bounds.
2022-12-15Rollup merge of #105692 - JohnTitor:issue-104678, r=compiler-errorsMatthias Krüger-0/+31
Add regression test for #104678 Closes #104678 r? `````@compiler-errors````` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-15Rollup merge of #105633 - compiler-errors:term-agnostic, r=oli-obkMatthias Krüger-2/+65
Make `report_projection_error` more `Term` agnostic Fixes #105632
2022-12-15Rollup merge of #105627 - compiler-errors:dyn-auto-suggestable, r=davidtwcoMatthias Krüger-0/+27
Auto traits in `dyn Trait + Auto` are suggestable Not sure why I had made the `IsSuggestableVisitor` have that rule to not consider `dyn Trait + Auto` to be suggestable. It's possible that this was done because of the fact that we don't print the right parentheses for `&(dyn Trait + Auto)`, but that's a problem with printing these types in general that we probably have tracked somewhere else...
2022-12-15Rollup merge of #105623 - compiler-errors:generator-type-size-fix, r=NilstriebMatthias Krüger-122/+66
Fix `-Z print-type-sizes` for generators with discriminant field ordered first Fixes #105589 Fixes #105591
2022-12-15Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errorsMatthias Krüger-25/+99
Ensure async trait impls are async (or otherwise return an opaque type) As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes https://github.com/rust-lang/rust/issues/102745
2022-12-15Allow `impl ~const Trait` opaque typesDeadbeef-51/+36
2022-12-15Auto merge of #105285 - compiler-errors:conflicting-param-env-2, r=estebankbors-13/+84
Highlight conflicting param-env candidates, again Un-reverts #98794 (i.e. reverts #99290). The previous time I attempted to land this PR, it was because of an incremental issue (#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly. The main motivation for trying to re-land this is that it fixes #105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates: ``` error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>` | note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found --> $DIR/conflicting-bounds.rs:3:1 | LL | pub trait Gen<'source> { | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | Self: for<'s> Gen<'s, Output = T>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0283`. ``` Fixes #105131. Fixes (again) #98786
2022-12-15Add regression test for #55976Yuki Okushi-0/+13
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-14Tweak output for bare `dyn Trait` in argumentsEsteban Küber-15/+65
Fix #35825.
2022-12-15Auto merge of #104765 - chenyukang:yukang-fix-104639-lifetime-check, r=oli-obkbors-0/+10
Find the right lower bound region in the scenario of partial order relations Fixes #104639
2022-12-14Ensure async trait impls are async (or otherwise return an opaque type)Dan Johnson-25/+99
As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes #102745
2022-12-14Do not mention long types in E0599 labelEsteban Küber-4/+4
The type is already mentioned in the main message and the list of unmet bounds.
2022-12-14Add testMichael Goulet-0/+25
2022-12-14Highlight conflicting param-env candidates, againMichael Goulet-13/+59
2022-12-14Auto traits in dyn are suggestableMichael Goulet-0/+27
2022-12-14Added PlayStation Vita supportAndrés Martínez-1/+1
2022-12-14Make report_projection_error more term agnosticMichael Goulet-2/+65
2022-12-14drive-by: Fix path spansMichael Goulet-6/+6
2022-12-14Use impl's def id when calculating type to specify UFCSMichael Goulet-0/+63
2022-12-14bail in collect_trait_impl_trait_tys if signatures reference errorsMichael Goulet-0/+42
2022-12-14Don't bug if we're trying to cast dyn* to a nother typeMichael Goulet-0/+20
2022-12-14Make print_type_sizes test not use feature(start)Michael Goulet-128/+36
2022-12-14Consider discriminant fields that are ordered before variant fieldsMichael Goulet-0/+36
2022-12-14Rollup merge of #105630 - albertlarsan68:test-92481, r=TaKO8KiMatthias Krüger-0/+74
Add a test for #92481 The test was copied ad-hoc from #92481, but I can't get the test to pass, because of needing to get twice the same error on the last line of the source. Closes #92481
2022-12-14Allow .. to be parsed as let initializerDeep Majumder-0/+8
.. and ..= are valid expressions, however when used in a let statement it is not parsed.
2022-12-14Bless testAlbert Larsan-4/+2
2022-12-14skip if val has ecaping bound varsouz-a-0/+14
2022-12-14Add a test for #92481Albert Larsan-0/+76
2022-12-14Add regression test for #104678Yuki Okushi-0/+31
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-14Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, ↵Matthias Krüger-0/+29
r=wesleywiser fold instead of obliterating args Fixes #105608 we call `const_eval_resolve` on the following constant: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), _, ] } _, ], ``` when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ PLACEHOLDER, PLACEHOLDER, ], ``` Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), PLACEHOLDER, ] } PLACEHOLDER, ], ``` which ctfe _can_ handle. I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:
2022-12-14Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, ↵Matthias Krüger-0/+43
r=compiler-errors Suggest dereferencing receiver arguments properly Fixes #105429
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-57/+77
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebankMatthias Krüger-0/+37
Suggest impl in the scenario of typo with fn Fixes #105366
2022-12-14Rollup merge of #105491 - sulami:master, r=compiler-errorsMatthias Krüger-0/+110
Illegal sized bounds: only suggest mutability change if needed In a scenario like ```rust struct Type; pub trait Trait { fn function(&mut self) where Self: Sized; } impl Trait for Type { fn function(&mut self) {} } fn main() { (&mut Type as &mut dyn Trait).function(); } ``` the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied. Fixes #103622.
2022-12-14Rollup merge of #105161 - cassaundra:numeric-literal-error, r=nnethercoteMatthias Krüger-0/+84
Refine when invalid prefix case error arises Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are actually invalid.
2022-12-13Add regression testinquisitivecrystal-0/+39
2022-12-14Auto merge of #104875 - chenyukang:yukang/fix-104867-inc, r=estebankbors-22/+360
Properly handle postfix inc/dec in standalone and subexpr scenarios Fixes #104867 r? `@estebank`
2022-12-13error parsing lifetime following by Sized and message + between themYiming Lei-0/+51
detect the pattern at the general site parse_impl_ty() this will fix #102598
2022-12-13Auto merge of #105667 - matthiaskrgr:rollup-fexlc0b, r=matthiaskrgrbors-2346/+2227
Rollup of 7 pull requests Successful merges: - #105147 (Allow unsafe through inline const) - #105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - #105464 (Support #[track_caller] on async closures) - #105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - #105500 (Make some diagnostics not depend on the source of what they reference being available) - #105628 (Small doc fixes) - #105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-13review commentsEsteban Küber-69/+69
2022-12-13Rollup merge of #105500 - oli-obk:unhide_unknown_spans, r=estebankMatthias Krüger-1566/+266
Make some diagnostics not depend on the source of what they reference being available r? `@estebank` follow up to https://github.com/rust-lang/rust/pull/104449
2022-12-13Rollup merge of #105476 - estebank:moves-n-borrows, r=compiler-errorsMatthias Krüger-779/+1777
Change pattern borrowing suggestions to be verbose and remove invalid suggestion Synthesize a more accurate span and use verbose suggestion output to make the message clearer. Do not suggest borrowing binding in pattern in let else. Fix #104838.
2022-12-13Rollup merge of #105464 - nbdd0121:hir, r=compiler-errorsMatthias Krüger-1/+65
Support #[track_caller] on async closures Follow up on #105180 r? ```@compiler-errors``` cc ```@cjgillot```
2022-12-13Rollup merge of #105147 - nbdd0121:inline_const_unsafe, r=oli-obkMatthias Krüger-0/+119
Allow unsafe through inline const Handle similar to closures. Address https://github.com/rust-lang/rust/pull/104087#issuecomment-1324173328 Note that this PR does not fix the issue for `unsafe { [0; function_requiring_unsafe()] }`. This is fundamentally unfixable for MIR unsafeck IMO. This PR also does not fix unsafety checking for inline const in pattern position. It actually breaks it, allowing unsafe functions to be used in inline const in pattern position without unsafe blocks. Inline const in pattern position is not visible in MIR so ignored by MIR unsafety checking (currently it is also not checked by borrow checker, which is the reason why it's considered an incomplete feature). `@rustbot` label: +T-lang +F-inline_const
2022-12-14suggest dereferencing receiver arguments properlyTakayuki Maeda-0/+43
fix a stderr
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-69/+69