about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2023-01-08Rollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, ↵Yuki Okushi-0/+27
r=compiler-errors Suggest `mut self: &mut Self` for `?Sized` impls Closes #106325 Closes #93078 The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start. ``@rustbot`` label +A-diagnostics
2023-01-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-102/+102
2023-01-08Do not emit wrong E0308 suggestion for closure mismatchEsteban Küber-4/+0
2023-01-08Add testEsteban Küber-0/+33
2023-01-08doc/test: add UI test and reword docs for `E0013` and `E0015`Ezra Shaw-0/+34
2023-01-07Auto merge of #106573 - matthiaskrgr:rollup-zkgfsta, r=matthiaskrgrbors-60/+109
Rollup of 10 pull requests Successful merges: - #101936 (Migrating rustc_infer to session diagnostics (part 3)) - #104081 (PhantomData layout guarantees) - #104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3]) - #105128 (Add O(1) `Vec -> VecDeque` conversion guarantee) - #105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.) - #105859 (Point out span where we could introduce higher-ranked lifetime) - #106509 (Detect closures assigned to binding in block) - #106553 (docs: make `HashSet::retain` doctest more clear) - #106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`) - #106564 (Change to immutable borrow when cloning element of RepeatN) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-07Rollup merge of #106509 - estebank:closure-in-block, r=davidtwcoMatthias Krüger-24/+32
Detect closures assigned to binding in block Fix #58497.
2023-01-07Rollup merge of #105859 - compiler-errors:hr-lifetime-add, r=davidtwcoMatthias Krüger-0/+36
Point out span where we could introduce higher-ranked lifetime Somewhat addresses #105422, but not really. We don't have that much useful information here since we're still in resolution :^( Maybe this suggestion isn't worth it. If the reviewer has an idea how we can get a more succinct binder information for a structured suggestion, it would be appreciated.
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 #106036 - JohnTitor:issue-86106, r=nikicbors-0/+62
Add regression test for #86106 Closes #86106 r? `@nikic` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Auto merge of #105323 - cjgillot:simplify-const-prop, r=davidtwcobors-509/+362
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-07Apply `merge-functions=disabled`Yuki Okushi-2/+9
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Apply review suggestionsYuki Okushi-9/+8
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Add regression test for #86106Yuki Okushi-0/+56
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-07Auto merge of #106558 - compiler-errors:rollup-lkii3j3, r=compiler-errorsbors-66/+66
Rollup of 4 pull requests Successful merges: - #106525 (Report WF error for chalk *and* new solver) - #106533 (Use smaller spans for missing lifetime/generic args) - #106543 (rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`) - #106554 (Fix a typo in the explanation of E0588) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-06Rollup merge of #106543 - notriddle:notriddle/source-sidebar-width-zero, ↵Michael Goulet-6/+6
r=GuillaumeGomez rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }` This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06Rollup merge of #106533 - ↵Michael Goulet-56/+56
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-07Auto merge of #106538 - aDotInTheVoid:strip-use-doc-hidden, r=notriddlebors-1/+17
rustdoc: Strip imports of items which are `#[doc(hidden)]` Closes #106379
2023-01-07use type_implements_trait to check Param cloneyukang-2/+2
2023-01-07Auto merge of #106544 - matthiaskrgr:rollup-e9prjed, r=matthiaskrgrbors-591/+579
Rollup of 7 pull requests Successful merges: - #106287 (Add some docs to `bug`, `span_bug` and `delay_span_bug`) - #106341 (refactor: clean up `errors.rs` and `error_codes_check.rs`) - #106453 (Improve include macro documentation) - #106466 (Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links) - #106528 (Tiny formatting fix) - #106534 (rustdoc-gui: Use new block syntax for define-function in goml scripts) - #106542 (Add default and latest stable edition to --edition in rustc (attempt 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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-06Rollup merge of #106534 - GuillaumeGomez:block-syntax, r=notriddleMatthias Krüger-591/+573
rustdoc-gui: Use new block syntax for define-function in goml scripts r? `@notriddle`
2023-01-06Rollup merge of #106466 - clubby789:relative-module-fix, r=notriddleMatthias Krüger-0/+6
Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links Fixes #103517 While generating the location for modules source HTML to be saved at, a `..` path component appeared to be translated to `/up/`. Additionally, while generating the navigation sidebar, `..` path components were ignored. This means that (as in the issue above), a *real* directory structure of: ``` sys/ unix/ mod.rs <-- contains #![path = "../unix/mod.rs] cmath.rs ``` was rendered as: ``` sys/ unix/ mod.rs unix/ cmath.rs <-- links to sys/unix/unix/cmath.rs.html, 404 ``` While the *files* were stored as ``` sys/ unix/ mod.rs.html up/ unix/ cmath.rs.html ```
2023-01-06rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`Michael Howell-6/+6
This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06rustdoc: Strip imports of items which are `#[doc(hidden)]`Nixon Enraght-Moony-1/+17
Closes #106379
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 new block syntax for define-function in goml scriptsGuillaume Gomez-591/+573
2023-01-06Update testsclubby789-0/+6
2023-01-06Auto merge of #106474 - erikdesjardins:noalias, r=bjorn3bors-0/+23
cleanup: handle -Zmutable-noalias like -Zbox-noalias r? `@bjorn3` cc `@RalfJung` this will conflict with #106180
2023-01-06use smaller spans for missing lifetime/generic argsTakayuki Maeda-56/+56
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-06Auto merge of #106529 - Dylan-DPC:rollup-mvncmrk, r=Dylan-DPCbors-0/+256
Rollup of 5 pull requests Successful merges: - #106400 (Point at expressions where inference refines an unexpected type) - #106491 (Fix error-index redirect to work with the back button.) - #106494 (Add regression test for #58355) - #106499 (fix [type error] for error E0029 and E0277) - #106502 (rustdoc: remove legacy user-select CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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-06Rollup merge of #106400 - estebank:type-errs, r=compiler-errorsDylan DPC-0/+175
Point at expressions where inference refines an unexpected type Fix #106355. Fix #14007. (!) ``` error[E0308]: mismatched types --> src/test/ui/type/type-check/point-at-inference.rs:12:9 | 9 | foo.push(i); | - this is of type `&{integer}`, which makes `foo` to be inferred as `Vec<&{integer}>` ... 12 | bar(foo); | --- ^^^ expected `i32`, found `&{integer}` | | | arguments to this function are incorrect | = note: expected struct `Vec<i32>` found struct `Vec<&{integer}>` note: function defined here --> src/test/ui/type/type-check/point-at-inference.rs:2:4 | 2 | fn bar(_: Vec<i32>) {} | ^^^ ----------- help: consider dereferencing the borrow | 9 | foo.push(*i); | + ```
2023-01-06Auto merge of #106429 - djkoloski:add_vendor_to_fuchsia_target_triple, r=nagisabors-2/+2
Add vendor to Fuchsia's target triple Historically, Rust's Fuchsia targets have been labeled x86_64-fuchsia and aarch64-fuchsia. However, they should technically contain vendor information. This CL changes Fuchsia's target triples to include the "unknown" vendor since Clang now does normalization and handles all triple spellings. This was previously attempted in #90510, which was closed due to inactivity.
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