about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-10-21Auto merge of #117020 - matthiaskrgr:rollup-cg62m4h, r=matthiaskrgrbors-6/+50
Rollup of 3 pull requests Successful merges: - #106601 (Suggest `;` after bare `match` expression E0308) - #116975 (Move `invalid-llvm-passes` test to `invalid-compile-flags` folder) - #117019 (fix spans for removing `.await` on `for` expressions) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-21Rollup merge of #117019 - lukas-code:for-await, r=compiler-errorsMatthias Krüger-2/+20
fix spans for removing `.await` on `for` expressions We need to use a span with the outer syntax context of a desugared `for` expression to join it with the `.await` span. fixes https://github.com/rust-lang/rust/issues/117014
2023-10-21Rollup merge of #116975 - ojeda:move-invalid-test, r=NilstriebMatthias Krüger-0/+0
Move `invalid-llvm-passes` test to `invalid-compile-flags` folder Nowadays there is an `invalid-compile-flags` folder, thus move this one there.
2023-10-21Rollup merge of #106601 - estebank:match-semi, r=cjgillotMatthias Krüger-4/+30
Suggest `;` after bare `match` expression E0308 Fix #72634.
2023-10-21fix spans for removing `.await` on `for` expressionsLukas Markeffsky-2/+20
2023-10-21Auto merge of #116734 - Nadrieril:lint-per-column, r=cjgillotbors-366/+579
Lint `non_exhaustive_omitted_patterns` by columns This is a rework of the `non_exhaustive_omitted_patterns` lint to make it more consistent. The intent of the lint is to help consumers of `non_exhaustive` enums ensure they stay up-to-date with all upstream variants. This rewrite fixes two cases we didn't handle well before: First, because of details of exhaustiveness checking, the following wouldn't lint `Enum::C` as missing: ```rust match Some(x) { Some(Enum::A) => {} Some(Enum::B) => {} _ => {} } ``` Second, because of the fundamental workings of exhaustiveness checking, the following would treat the `true` and `false` cases separately and thus lint about missing variants: ```rust match (true, x) { (true, Enum::A) => {} (true, Enum::B) => {} (false, Enum::C) => {} _ => {} } ``` Moreover, it would correctly not lint in the case where the pair is flipped, because of asymmetry in how exhaustiveness checking proceeds. A drawback is that it no longer makes sense to set the lint level per-arm. This will silently break the lint for current users of it (but it's behind a feature gate so that's ok). The new approach is now independent of the exhaustiveness algorithm; it's a separate pass that looks at patterns column by column. This is another of the motivations for this: I'm glad to move it out of the algorithm, it was akward there. This PR is almost identical to https://github.com/rust-lang/rust/pull/111651. cc `@eholk` who reviewed it at the time. Compared to then, I'm more confident this is the right approach.
2023-10-21Auto merge of #117013 - matthiaskrgr:rollup-mvgp54x, r=matthiaskrgrbors-257/+682
Rollup of 8 pull requests Successful merges: - #114521 (std: freebsd build update.) - #116911 (Suggest relaxing implicit `type Assoc: Sized;` bound) - #116917 (coverage: Simplify the injection of coverage statements) - #116961 (Typo suggestion to change bindings with leading underscore) - #116964 (Add stable Instance::body() and RustcInternal trait) - #116974 (coverage: Fix inconsistent handling of function signature spans) - #116990 (Mention `into_iter` on borrow errors suggestions when appropriate) - #116995 (Point at assoc fn definition on type param divergence) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-21Rollup merge of #116995 - estebank:issue-69944, r=compiler-errorsMatthias Krüger-20/+11
Point at assoc fn definition on type param divergence When the number of type parameters in the associated function of an impl and its trait differ, we now *always* point at the trait one, even if it comes from a foreign crate. When it is local, we point at the specific params, when it is foreign, we point at the whole associated item. Fix #69944.
2023-10-21Rollup merge of #116990 - estebank:issue-68445, r=cjgillotMatthias Krüger-0/+26
Mention `into_iter` on borrow errors suggestions when appropriate If we encounter a borrow error on `vec![1, 2, 3].iter()`, suggest `into_iter`. Fix #68445.
2023-10-21Rollup merge of #116974 - Zalathar:signature-spans, r=oli-obk,cjgillotMatthias Krüger-67/+233
coverage: Fix inconsistent handling of function signature spans While doing some more cleanup of `spans`, I noticed a strange inconsistency in how function signatures are handled. Normally the function signature span is treated as though it were executable as part of the start of the function, but in some cases the signature span disappears entirely from coverage, for no obvious reason. This is caused by the fact that spans created by `CoverageSpan::for_fn_sig` don't add the span to their `merged_spans` field (unlike normal statement/terminator spans). In cases where the span-processing code looks at those merged spans, it thinks the signature span is no longer visible and deletes it. Adding the signature span to `merged_spans` resolves the inconsistency. (Prior to #116409 this wouldn't have been possible, because there was no case in the old `CoverageStatement` enum representing a signature. Now that `merged_spans` is just a list of spans, that's no longer an obstacle.)
2023-10-21Rollup merge of #116964 - celinval:smir-mono-body, r=oli-obkMatthias Krüger-7/+217
Add stable Instance::body() and RustcInternal trait The `Instance::body()` returns a monomorphized body. For that, we had to implement visitor that monomorphize types and constants. We are also introducing the RustcInternal trait that will allow us to convert back from Stable to Internal. Note that this trait is not yet visible for our users as it depends on Tables. We should probably add a new trait that can be exposed. The tests here are very simple, and I'm planning on creating more exhaustive tests in the project-mir repo. But I was hoping to get some feedback here first. r? ```@oli-obk```
2023-10-21Rollup merge of #116961 - estebank:issue-60164, r=oli-obkMatthias Krüger-2/+39
Typo suggestion to change bindings with leading underscore When encountering a binding that isn't found but has a typo suggestion for a binding with a leading underscore, suggest changing the binding definition instead of the use place. Fix #60164.
2023-10-21Rollup merge of #116917 - Zalathar:injection, r=cjgillotMatthias Krüger-143/+87
coverage: Simplify the injection of coverage statements This is a follow-up to #116046 that I left out of that PR because I didn't want to make it any larger. After the various changes we've made to how coverage data is stored and transferred, the old code structure for injecting coverage statements into MIR is built around a lot of constraints that don't exist any more. We can simplify it by replacing it with a handful of loops over the BCB node/edge counters and the BCB spans. --- `@rustbot` label +A-code-coverage
2023-10-21Rollup merge of #116911 - estebank:issue-85378, r=oli-obkMatthias Krüger-0/+67
Suggest relaxing implicit `type Assoc: Sized;` bound Fix #85378.
2023-10-21Rollup merge of #114521 - devnexen:std_fbsd_13_upd, r=cuviperMatthias Krüger-18/+2
std: freebsd build update. since freebsd 11 had been removed, minimum is now 12.
2023-10-21Auto merge of #117011 - RalfJung:miri, r=RalfJungbors-182/+1512
Miri subtree update r? `@ghost`
2023-10-21update lockfileRalf Jung-0/+31
2023-10-21Auto merge of #3132 - rust-lang:rustup-2023-10-21, r=RalfJungbors-5488/+5626
Automatic Rustup
2023-10-21Merge from rustcThe Miri Conjob Bot-5487/+5625
2023-10-21Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-10-21coverage: Simplify the injection of coverage statementsZalathar-143/+87
2023-10-21coverage: Simplify initial creation of coverage spansZalathar-45/+32
2023-10-21coverage: Don't create an intermediate vec for each BCB's initial spansZalathar-26/+23
2023-10-21coverage: Handle fn signature spans more consistently near `?`Zalathar-21/+23
2023-10-21coverage: Add a test showing the inconsistent handling of function signaturesZalathar-0/+180
2023-10-20changes from feedbackDavid Carlier-16/+2
2023-10-20Point at assoc fn definition on type param divergenceEsteban Küber-20/+11
When the number of type parameters in the associated function of an impl and its trait differ, we now *always* point at the trait one, even if it comes from a foreign crate. When it is local, we point at the specific params, when it is foreign, we point at the whole associated item. Fix #69944.
2023-10-20Auto merge of #116958 - oli-obk:coro, r=pnkfelixbors-3916/+3935
rename Generator to Coroutine implements https://github.com/rust-lang/compiler-team/issues/682 While I did an automated replacement, I went through all changes manually to avoid renaming things like "id generators", "code generator", ... I renamed files where that was necessary due to the contents referring to the crate name itself (mir opt, codegen or debuginfo tests), or required by tidy (feature gate docs) * [x] rename various remaining abbreviated references to generators. * [x] rename files * [x] rename folders * [x] add renamed feature: `generators`, ... r? `@ghost`
2023-10-20Replace all uses of `generator` in markdown documentation with `coroutine`Oli Scherer-52/+52
2023-10-20bless miriOli Scherer-8/+8
2023-10-20bless ui-fulldepsOli Scherer-2/+2
2023-10-20Bless coverage mapOli Scherer-3/+3
2023-10-20Fix stage0 core testsOli Scherer-3/+8
2023-10-20Rename `generator` folderOli Scherer-0/+0
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-81/+81
2023-10-20Re-add `generators` as a removed feature and point to the new feature nameOli Scherer-0/+6
2023-10-20Rename `Gen` to `Coro` in testsOli Scherer-12/+12
2023-10-20Rename `CoroutineKind::Gen` to `::Coroutine`Oli Scherer-25/+29
2023-10-20s/generator/coroutine/Oli Scherer-2197/+2201
2023-10-20s/Generator/Coroutine/Oli Scherer-1271/+1271
2023-10-20Auto merge of #116951 - compiler-errors:ir-file-structure, r=jackh726bors-1532/+1560
Restructure `rustc_type_ir` a bit 1. Split `sty` into new `ty_kind`/`region_kind`/`const_kind` modules, so that when we uplift more kinds (e.g. `PredicateKind`, `ClauseKind`, and `ExistentialPredicate`), they can live in their own simple-to-understand files. 2. Split up the `structural_impls` module, which is a kitchen sink of random impls -- move `TypeFoldable` and `TypeVisitable` impls into existing `fold` and `visit` modules, respectively. 3. Move the `DebugWithInfcx` trait and blanket impls into a new `debug` module, and `TypeFlags` definition into a new `flags` module. 5. Move `Interner` trait into a new `interner` module. I expect this file to get a lot larger as we make the interner more powerful for the trait solver refactor. r? `@ghost` for now, will assign once #116946 lands
2023-10-20Mention `into_iter` on borrow errors suggestions when appropriateEsteban Küber-0/+26
If we encounter a borrow error on `vec![1, 2, 3].iter()`, suggest `into_iter`. Fix #68445.
2023-10-20Typo suggestion to change bindings with leading underscoreEsteban Küber-2/+39
When encountering a binding that isn't found but has a typo suggestion for a binding with a leading underscore, suggest changing the binding definition instead of the use place. Fix #60164.
2023-10-20Move some files aroundMichael Goulet-1520/+1548
2023-10-20Adjust importsMichael Goulet-12/+12
2023-10-20Remove obsolete commentCelina G. Val-1/+0
2023-10-20Auto merge of #116966 - clarfonthey:atomic-docs-typo, r=workingjubileebors-1/+1
Fix typo in atomic docs Maybe rustdoc or tidy should lint hanging backticks like this.
2023-10-20std: freebsd build update.David CARLIER-4/+2
since freebsd 11 had been removed, minimum is now 12.
2023-10-20Auto merge of #116965 - estebank:issue-65329, r=cjgillotbors-37/+85
Move where doc comment meant as comment check The new place makes more sense and covers more cases beyond individual statements. ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found doc comment `//!foo --> $DIR/doc-comment-in-stmt.rs:25:22 | LL | let y = x.max(1) //!foo | ^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator | help: add a space before `!` to write a regular comment | LL | let y = x.max(1) // !foo | + ``` Fix #65329.
2023-10-20Move `invalid-llvm-passes` test to `invalid-compile-flags` folderMiguel Ojeda-0/+0
Nowadays there is an `invalid-compile-flags` folder, thus move this one there. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>