about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2023-01-07Rollup merge of #105517 - pcc:process-panic-after-fork, r=davidtwcoMatthias Krüger-36/+41
Fix process-panic-after-fork.rs to pass on newer versions of Android. The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.
2023-01-07Auto merge of #105323 - cjgillot:simplify-const-prop, r=davidtwcobors-12/+0
Perform SimplifyLocals before ConstProp. MIR before `ConstProp` may have a lot of dead writes, this makes `ConstProp` do unnecessary work. r? `@ghost`
2023-01-07Auto merge of #106519 - estebank:tail-unit, r=cjgillotbors-0/+131
Detect bindings assigned blocks without tail expressions Fix #44173.
2023-01-07don't eagerly normalize SelfCtor typeAli MJ Al-Nasrawy-0/+120
Delay until user annotations are registered. See the added test.
2023-01-07more testsAli MJ Al-Nasrawy-37/+208
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-17/+173
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2023-01-07fix method substsAli MJ Al-Nasrawy-2/+10
2023-01-07fix struct pathAli MJ Al-Nasrawy-38/+107
2023-01-07don't normalize in astconvAli MJ Al-Nasrawy-172/+273
We delay projection normalization to further stages in order to register user type annotations before normalization in HIR typeck. There are two consumers of astconv: ItemCtxt and FnCtxt. The former already expects unnormalized types from astconv, see its AstConv trait impl. The latter needs `RawTy` for a cleaner interface. Unfortunately astconv still needs the normalization machinery in order to resolve enum variants that have projections in the self type, e.g. `<<T as Trait>::Assoc>::StructVariant {}`. This is why `AstConv::normalize_ty_2` is necessary.
2023-01-07Auto merge of #106283 - JulianKnodt:enum_err, r=cjgillotbors-0/+51
Add help diag. for `const = Enum` missing braces around `Enum` Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces. Fixes #105927
2023-01-06Rollup merge of #106533 - ↵Michael Goulet-34/+34
TaKO8Ki:use-smaller-span-for-missing-lifetime/generic-args, r=compiler-errors Use smaller spans for missing lifetime/generic args We can remove ident from suggestions.
2023-01-06Rollup merge of #106525 - compiler-errors:new-solver-wf, r=jackh726Michael Goulet-4/+4
Report WF error for chalk *and* new solver addressing this nit https://github.com/rust-lang/rust/pull/106385#discussion_r1062571070 No test yet because new solver is currently unusable, lol r? `@lcnr`
2023-01-07use type_implements_trait to check Param cloneyukang-2/+2
2023-01-06Change wording to avoid being misleadingEsteban Küber-25/+11
2023-01-06Structured suggestion for `&mut dyn Iterator` when possibleEsteban Küber-5/+42
Fix #37914.
2023-01-07Suggest possible clone when we have &Tyukang-0/+107
2023-01-06Auto merge of #106501 - cjgillot:resolved-elided-apit, r=compiler-errorsbors-0/+5
Correct detection of elided lifetimes in impl-trait. Fixes https://github.com/rust-lang/rust/issues/106338 r? `@compiler-errors` cc `@pnkfelix`
2023-01-06use smaller spans for missing lifetime/generic argsTakayuki Maeda-34/+34
fix rustdoc ui test
2023-01-06Auto merge of #105805 - yanchen4791:issue-105227-fix, r=estebankbors-31/+102
Suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs fix for #105227. The problem: The suggestion of adding an explicit `'_` lifetime bound is **incorrect** when the function's return type contains a value which could be borrowed from more than one lifetimes of the function's inputs. Instead, a named lifetime parameter can be introduced in such a case. The solution: Checking the number of elided lifetimes in the function signature. If more than one lifetimes found in the function inputs when the suggestion of adding explicit `'_` lifetime, change it to using named lifetime parameter `'a` instead.
2023-01-06Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebankDylan DPC-0/+61
fix [type error] for error E0029 and E0277 check explicitly for the type references error if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix #105946
2023-01-06Rollup merge of #106494 - JohnTitor:issue-58355, r=compiler-errorsDylan DPC-0/+20
Add regression test for #58355 Closes #58355 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-05fix [type error] for error E0029 and E0277Yiming Lei-0/+61
check explicitly for the type references error if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix #105946
2023-01-05Suggests adding named lifetime when the return contains value borrowed from ↵yanchen4791-31/+102
more than one lifetimes of the function's inputs
2023-01-06Tweak outputEsteban Küber-55/+35
2023-01-06Report WF error for new solver tooMichael Goulet-4/+4
2023-01-06Detect bindings assigned blocks without tail expressions in trait errorsEsteban Küber-9/+65
Address #44173 for trait errors.
2023-01-06Detect bindings assigned blocks without tail expressionsEsteban Küber-0/+95
Address #44173 for type check errors.
2023-01-05Detect closures assigned to binding in blockEsteban Küber-24/+32
Fix #58497.
2023-01-05Correct detection of elided lifetimes in impl-trait.Camille GILLOT-0/+5
2023-01-05fix rebaseEsteban Küber-3/+3
2023-01-05Explain error with `&mut self` for unsized trait implsclubby789-0/+27
2023-01-05review comments: rewordEsteban Küber-4/+4
2023-01-05Suggest changing argument on type errorEsteban Küber-10/+28
2023-01-05Account for type error on method arg caused by earlier inferenceEsteban Küber-0/+27
```rust fn main() { let v = Vec::new(); v.push(0); v.push(0); v.push(""); } ``` now produces ``` error[E0308]: mismatched types --> $DIR/point-at-inference-3.rs:6:12 | LL | v.push(0); | - this is of type `{integer}`, which makes `v` to be inferred as `Vec<{integer}>` ... LL | v.push(""); | ---- ^^ expected integer, found `&str` | | | arguments to this function are incorrect | note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ```
2023-01-05Tweak outputEsteban Küber-12/+124
- Only point at a the single expression where the found type was first inferred. - Find method call argument that might have caused the found type to be inferred. - Provide structured suggestion. - Apply some review comments. - Tweak wording.
2023-01-05review comments: do not always point at init exprEsteban Küber-98/+11
2023-01-05More eagerly resolve expr `ty`s before writing themEsteban Küber-23/+11
This allows the expressions to have more accurate types when showing inference steps.
2023-01-05Skip macros to avoid talking about bindings the user can't seeEsteban Küber-12/+3
2023-01-05Point at expressions where inference refines an unexpected typeEsteban Küber-14/+140
Address #106355.
2023-01-06Add regression test for #58355Yuki Okushi-0/+20
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-05Auto merge of #106482 - compiler-errors:rollup-g7n1p39, r=compiler-errorsbors-163/+223
Rollup of 6 pull requests Successful merges: - #105846 (Account for return-position `impl Trait` in trait in `opt_suggest_box_span`) - #106385 (Split `-Zchalk` flag into `-Ztrait-solver=(classic|chalk|next)` flag) - #106403 (Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent`) - #106462 (rustdoc: remove unnecessary wrapper around sidebar and mobile logos) - #106464 (Update Fuchsia walkthrough with new configs) - #106478 (Tweak wording of fn call with wrong number of args) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-04Rollup merge of #106478 - estebank:tweak-fn-mismatch, r=compiler-errorsMichael Goulet-133/+133
Tweak wording of fn call with wrong number of args
2023-01-04Rollup merge of #106385 - compiler-errors:new-solver-flag, r=jackh726Michael Goulet-30/+30
Split `-Zchalk` flag into `-Ztrait-solver=(classic|chalk|next)` flag We'll eventually need a way to select more than chalk + not-chalk. Does this need an MCP since it's touching a `-Z` flag? Or perhaps I should preserve `-Zchalk` for the time being... maybe I could make it a warning to use that flag? cc ``@rust-lang/types`` r? types
2023-01-04Rollup merge of #105846 - compiler-errors:issue-105838, r=jackh726Michael Goulet-0/+60
Account for return-position `impl Trait` in trait in `opt_suggest_box_span` RPITITs are the only types where their opaque bounds might normalize to some other self type than the opaque type itself. To avoid needing to do normalization, let's just match on either alias kind. Ideally, we'd just get rid of `opt_suggest_box_span`. It's kind of a wart on type-checking `if`/`match`. I've recently refactored this expression for being confusing/wrong, but moving it into the error path is pretty hard. Fixes #105838
2023-01-05Auto merge of #105409 - compiler-errors:closure-infer-cycle, r=jackh726bors-2/+111
Don't deduce a signature that makes a closure cyclic Sometimes when elaborating supertrait bounds for closure signature inference, we end up deducing a closure signature that is cyclical because either a parameter or the return type references a projection mentioning `Self` that also has escaping bound vars, which means that it's not eagerly replaced with an inference variable. Interestingly, this is not *just* related to my PR that elaborates supertrait bounds for closure signature deduction. The committed test `supertrait-hint-cycle-3.rs` shows **stable** code that is fixed by this PR: ```rust trait Foo<'a> { type Input; } impl<F: Fn(u32)> Foo<'_> for F { type Input = u32; } fn needs_super<F: for<'a> Fn(<F as Foo<'a>>::Input) + for<'a> Foo<'a>>(_: F) {} fn main() { needs_super(|_: u32| {}); } ``` Fixes #105401 Fixes #105396 r? types
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-133/+133
2023-01-04Move testsCaio-0/+0
2023-01-04Update tests, etcMichael Goulet-30/+30
2023-01-04Auto merge of #106442 - matthiaskrgr:rollup-wivf7gh, r=matthiaskrgrbors-29/+191
Rollup of 7 pull requests Successful merges: - #106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions) - #106274 (Add JSON output to -Zdump-mono-stats) - #106292 (Add codegen test for `Box::new(uninit)` of big arrays) - #106327 (Add tidy check for dbg) - #106361 (Note maximum integer literal for `IntLiteralTooLarge`) - #106396 (Allow passing a specific date to `bump-stage0`) - #106436 (Enable doctests for rustc_query_impl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-04Rollup merge of #106361 - clubby789:int-literal-too-large, r=estebankMatthias Krüger-24/+70
Note maximum integer literal for `IntLiteralTooLarge` Closes #105908 `@rustbot` label +A-diagnostics