about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
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-07Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrumbors-14/+5
Move `x test --skip` to be part of `--exclude` `--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. Fixes https://github.com/rust-lang/rust/issues/96342. cc https://github.com/rust-lang/rust/pull/96493#issuecomment-1200521720 r? `@Mark-Simulacrum`
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-06Auto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgrbors-50/+128
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 #100193 - GuillaumeGomez:rm-clean-impls, r=notriddleMatthias Krüger-48/+42
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
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-06remove Clean trait implementation for hir::PolyTraitRefGuillaume Gomez-7/+1
2022-08-06remove Clean trait implementation for hir::GenericBoundGuillaume Gomez-41/+41
2022-08-06Auto merge of #100172 - Mark-Simulacrum:bump-165, r=Mark-Simulacrumbors-1/+1
Bump to 1.65.0 r? `@Mark-Simulacrum`
2022-08-06Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726bors-4/+2
Some `FulfillmentContext`-related cleanups Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others... r? types
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-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 #100166 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCDylan DPC-64/+65
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-05Rollup merge of #100157 - ↵Dylan DPC-17/+17
rust-lang:notriddle/use-map-instead-of-repeated-push, r=Dylan-DPC rustdoc: use `collect()` instead of repeatedly pushing
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-05Bump to 1.65.0Mark Rousskov-1/+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-05remove Clean trait implementation for hir::TraitItemGuillaume Gomez-51/+51
2022-08-05remove Clean trait implementation for hir::PolyTraitRefGuillaume Gomez-13/+14
2022-08-05Auto merge of #95977 - FabianWolff:issue-92790-dead-tuple, r=estebankbors-219/+309
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-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-04rustdoc: use `collect()` instead of repeatedly pushing to boundsMichael Howell-12/+12
2022-08-04rustdoc: use `collect()` instead of repeatedly pushing to bindingsMichael Howell-5/+5
2022-08-04Auto merge of #95026 - cuviper:bump-linux-min, r=Mark-Simulacrumbors-1482/+1620
Increase the minimum linux-gnu versions This is implementing the MCP from rust-lang/compiler-team#493. It is increasing the minimum requirements of a couple Tier 1 targets, and others at lower tiers, so this should go through FCP sign-offs for both `T-compiler` and `T-release`. The new `linux-gnu` baseline is kernel 3.2 and glibc 2.17. We will also take that kernel as the minimum floor for _all_ `*-linux-*` targets, so it may be broadly assumed in the implementation of the standard library. That does not preclude specific targets from having greater requirements where it makes sense, like a new arch needing something newer, or a platform like `linux-android` choosing a newer baseline.
2022-08-04Link /rustroot/lib stuff for clang -m32 to seeJosh Stone-0/+5
2022-08-04opt node typeMichael Goulet-2/+44
2022-08-04Rollup merge of #100138 - GuillaumeGomez:rm-clean-impls, r=notriddleMatthias Krüger-18/+11
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
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 #99772 - ehuss:reenable-submodule-archive, r=Mark-SimulacrumMatthias Krüger-10/+7
Re-enable submodule archive downloads. This is effectively a revert of #98423 (though it keeps the `--depth 1` flag since that is still helpful). GitHub has indicated that they have been working on the original issue, and my testing shows that the llvm-project archive download now succeeds 100% of the time. This should save about a minute on every job.
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-04Downgrade dist-powerpc-linux binutils to 2.30Josh Stone-20/+5
With binutils 2.32, we were getting errors like this: relocation truncated to fit: R_PPC_PLTREL24 against symbol `__cxa_atexit@@GLIBC_2.1.3' defined in .plt section in /x-tools/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu/sysroot/usr/lib/crt1.o but it builds okay with binutils 2.30.
2022-08-04Completely remove captures flagSantiago Pastorino-0/+7
2022-08-04Add `traits::fully_solve_obligation` that acts like `traits::fully_normalize`Michael Goulet-4/+2
It spawns up a trait engine, registers the single obligation, then fully solves it
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-04remove Clean trait implementation for hir::TraitRefGuillaume Gomez-8/+6