about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-07fix wrong suggestions for boxed trait objects instead of impl traitTakayuki Maeda-4/+88
2022-08-07revive suggestions for boxed trait objects instead of impl TraitTakayuki Maeda-0/+97
2022-08-07Auto merge of #100091 - chenyukang:add-check-for-link-ordinal, ↵bors-0/+54
r=michaelwoerister Check link ordinal to make sure it is targetted for foreign function Fix #100009, when link ordinal is not target for foreign functions, emit an error. cc `@dpaoliello`
2022-08-07Remove even more box syntax uses from src/testest31-212/+154
Prior work, notably 6550021124451628b1efc60c59284465b109e3aa from #88316 has removed box syntax from most of the testsuite. However, some tests were left out. This commit removes box_syntax uses from more locations in src/test. Some tests that are very box syntax specific are not being migrated.
2022-08-07Rollup merge of #100130 - compiler-errors:erroneous-return-span, r=lcnrMatthias Krüger-15/+136
Avoid pointing out `return` span if it has nothing to do with type error This code: ```rust fn f(_: String) {} fn main() { let x = || { if true { return (); } f(""); }; } ``` Emits this: ``` Compiling playground v0.0.1 (/playground) error[E0308]: mismatched types --> src/main.rs:8:11 | 8 | f(""); | ^^- help: try using a conversion method: `.to_string()` | | | expected struct `String`, found `&str` | note: return type inferred to be `String` here --> src/main.rs:6:20 | 6 | return (); | ^^ ``` Specifically, that note has nothing to do with the type error in question. This is because the change implemented in #84244 tries to point out the `return` span on _any_ type coercion error within a closure that happens after a `return` statement, regardless of if the error has anything to do with it. This is really easy to trigger -- just needs a closure (or an `async`) and an early return (or any other form, e.g. `?` operator suffices) -- and super distracting in production codebases. I'm letting #84128 regress because that issue is much harder to fix correctly, and I can re-open that issue after this lands. As a drive-by, I added a `resolve_vars_if_possible` to the coercion error logic, which leads to some error improvements. Unrelated to the issue above, though.
2022-08-06make NOP dyn casts not require anything about the vtableRalf Jung-20/+38
2022-08-06Bless ui tests.Camille GILLOT-5/+5
2022-08-06rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-0/+27
2022-08-06Avoid ICE in rustdoc.Camille GILLOT-0/+17
2022-08-06Auto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgrbors-2/+86
Rollup of 4 pull requests Successful merges: - #100094 (Detect type mismatch due to loop that might never iterate) - #100132 (Use (actually) dummy place for let-else divergence) - #100167 (Recover `require`, `include` instead of `use` in item) - #100193 (Remove more Clean trait implementations) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-06Rollup merge of #100167 - chenyukang:require-suggestion, r=estebankMatthias Krüger-2/+30
Recover `require`, `include` instead of `use` in item Fix #100140
2022-08-06Rollup merge of #100132 - compiler-errors:issue-100103, r=tmiaskoMatthias Krüger-0/+15
Use (actually) dummy place for let-else divergence Fixes #100103
2022-08-06Rollup merge of #100094 - lyming2007:issue-98982, r=estebankMatthias Krüger-0/+41
Detect type mismatch due to loop that might never iterate When loop as tail expression causes a miss match type E0308 error, recursively get the return statement and add diagnostic information on it.
2022-08-06Auto merge of #99893 - compiler-errors:issue-99387, r=davidtwcobors-0/+24
Delay formatting trimmed path until lint/error is emitted Fixes #99387 r? `@davidtwco`
2022-08-06./x.py test --blessTomasz Miąsko-26/+22
2022-08-05Fix ReErased leaking into typeck due to typeof recoveryMichael Goulet-0/+20
2022-08-05Auto merge of #100035 - workingjubilee:merge-functions, r=nikicbors-2/+4
Enable function merging when opt is for size It is, of course, natural to want to merge aliasing functions when optimizing for code size, since that can eliminate several bytes. And an exhaustive match helps make the code less brittle. Closes #98215.
2022-08-05Enable function merging when opt is for sizeJubilee Young-2/+4
It is, of course, natural to want to merge aliasing functions when optimizing for code size, since that can eliminate several bytes. And an exhaustive match helps make the code less brittle.
2022-08-05implement #98982Yiming Lei-0/+41
when loop as tail expression for miss match type E0308 error, recursively get the return statement and add diagnostic information on it use rustc_hir::intravisit to collect the return expression modified: compiler/rustc_typeck/src/check/coercion.rs new file: src/test/ui/typeck/issue-98982.rs new file: src/test/ui/typeck/issue-98982.stderr
2022-08-05Use `#![warn(let_underscore_drop)]` in tests.Aaron Kofsky-2/+6
2022-08-05Delay formatting trimmed path until lint/error is emittedMichael Goulet-0/+24
2022-08-05Rollup merge of #100168 - ↵Dylan DPC-54/+86
WaffleLapkin:improve_diagnostics_for_missing_type_in_a_const_item, r=compiler-errors Improve diagnostics for `const a: = expr;` Adds a suggestion to write a type when there is a colon, but the type is not present. I've also shrunk spans a little, so the suggestions are a little nicer. Resolves #100146 r? `@compiler-errors`
2022-08-05Rollup merge of #100155 - compiler-errors:issue-100154, r=jackh726Dylan DPC-2/+44
Use `node_type_opt` to skip over generics that were not expected Fixes #100154
2022-08-05Rollup merge of #99835 - ↵Dylan DPC-2/+111
TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern, r=estebank Suggest adding/removing `ref` for binding patterns This fixes what a fixme comment says. r? `@estebank`
2022-08-05Ignore test on wasmWesley Wiser-0/+1
2022-08-05Auto merge of #100073 - dpaoliello:externvar, r=michaelwoeristerbors-8/+125
Add test for raw-dylib with an external variable All existing tests of link kind `raw-dylib` only validate the ability to link against functions, but it is also possible to link against variables. This adds tests for linking against a variable using `raw-dylib` both by-name and by-ordinal.
2022-08-05Improve diagnostics for `const a: = expr;`Maybe Waffle-54/+86
2022-08-05recover require,include instead of use in itemyukang-2/+30
2022-08-05Auto merge of #95977 - FabianWolff:issue-92790-dead-tuple, r=estebankbors-168/+249
Warn about dead tuple struct fields Continuation of #92972. Fixes #92790. The language team has already commented on this in https://github.com/rust-lang/rust/pull/92972#issuecomment-1021511970; I have incorporated their requests here. Specifically, there is now a new allow-by-default `unused_tuple_struct_fields` lint (name bikesheddable), and fields of unit type are ignored (https://github.com/rust-lang/rust/pull/92972#issuecomment-1021815408), so error messages look like this: ``` error: field is never read: `1` --> $DIR/tuple-struct-field.rs:6:21 | LL | struct Wrapper(i32, [u8; LEN], String); | ^^^^^^^^^ | help: change the field to unit type to suppress this warning while preserving the field numbering | LL | struct Wrapper(i32, (), String); | ~~ ``` r? `@joshtriplett`
2022-08-05remove an unnecessary `str::rfind`Takayuki Maeda-3/+6
2022-08-05Auto merge of #99867 - spastorino:refactor-remap-lifetimes, r=nikomatsakisbors-0/+7
Split create_def and lowering of lifetimes for opaque types and bare async fns r? `@cjgillot` This work is kind of half-way, but I think it could be merged anyway. I think we should be able to remove all the vacant arms in `new_named_lifetime_with_res`, if I'm not wrong that requires visiting more nodes. We can do that as a follow up. In follow-up PRs, besides the thing mentioned previously, I'll be trying to remove `LifetimeCaptureContext`, `captured_lifetimes` as a global data structure, global `binders_to_ignore` and all their friends :). Also try to remap in a more general way based on def-ids.
2022-08-05Auto merge of #97085 - rylev:test-issue-33172, r=wesleywiserbors-0/+40
Add a test for issue #33172 Adds a test confirming that #33172 has been fixed. CDB has some surprising results as it looks like the supposedly unmangled static's symbol name is prefixed when it shouldn't be. r? `@wesleywiser` Closes #33172
2022-08-04opt node typeMichael Goulet-2/+44
2022-08-04Explain why let-underscoring a lock guard is incorrect.Aaron Kofsky-2/+4
Currently, the let_underscore_lock lint simply tells what is wrong, but not why it is wrong. We fix this by using a `MultiSpan` to explain specifically that doing `let _ = ` immediately drops the lock guard because it does not assign the lock guard to a binding.
2022-08-04Rollup merge of #100093 - wcampbell0x2a:unused-parens-for-match-arms, ↵Matthias Krüger-0/+41
r=petrochenkov Enable unused_parens for match arms Fixes: https://github.com/rust-lang/rust/issues/92751 Currently I can't get the `stderr` to work with `./x.py test`, but this should fix the issue. Help would be appreciated!
2022-08-04Rollup merge of #100058 - ↵Matthias Krüger-0/+115
TaKO8Ki:suggest-positional-formatting-argument-instead-of-format-args-capture, r=estebank Suggest a positional formatting argument instead of a captured argument This patch fixes a part of #96999. fixes #98241 fixes #97311 r? `@estebank`
2022-08-04Rollup merge of #98796 - compiler-errors:no-semi-if-comma, r=estebankMatthias Krüger-12/+21
Do not exclusively suggest `;` when `,` is also a choice Fixes #96791
2022-08-04Add test for raw-dylib with an external variableDaniel Paoliello-8/+125
2022-08-04fix typo, thanks wesleyFelix S Klock II-1/+1
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
2022-08-04Completely remove captures flagSantiago Pastorino-0/+7
2022-08-04Auto merge of #100087 - JakobDegen:mir-patch, r=tmiaskobors-172/+0
Avoid invalidating the CFG in `MirPatch` As a part of this change, we adjust `MirPatch` to not needlessly create unnecessary resume blocks. r? `@tmiasko`
2022-08-04Enable unused_parens for match armswcampbell-0/+41
2022-08-04Auto merge of #99953 - cjgillot:in-path-always, r=petrochenkovbors-0/+17
Always create elided lifetimes, even if inferred. `PathSource` gives the context in which a path is encountered. The same `PathSource` is used for the full path and the `QSelf` part. Therefore, we can only rely on `PathSource` to know whether typechecking will be able to infer the lifetimes, not whether we need to insert them at all. Fixes https://github.com/rust-lang/rust/issues/99949
2022-08-04Add min-gdb-versionRyan Levick-0/+1
2022-08-04Update FIXME commentRyan Levick-1/+1
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
2022-08-04Add comment about issue caused with multiple staticsRyan Levick-0/+2
2022-08-04Fix linux testsRyan Levick-7/+7
2022-08-04Turn CDB test back on and all clarifying testRyan Levick-6/+18
2022-08-04Turn off cdb test for now, link to issueRyan Levick-6/+5
2022-08-04Add a test for issue #33172Ryan Levick-0/+26