about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-04Address code review feedbackEric Holk-36/+53
2023-12-04Fix some broken testsEric Holk-2/+2
2023-12-04Option<CoroutineKind>Eric Holk-122/+117
2023-12-04Merge Async and Gen into CoroutineKindEric Holk-238/+442
2023-12-04Add a basic test for gen fnEric Holk-0/+18
2023-12-04Make async gen fn an errorEric Holk-0/+34
2023-12-04gate gen fn behind gen_blocksEric Holk-3/+9
2023-12-04Lower return types for gen fn to impl IteratorEric Holk-80/+167
2023-12-04Add genness to FnHeaderEric Holk-5/+26
2023-12-04Auto merge of #118602 - TaKO8Ki:rollup-njcouns, r=TaKO8Kibors-209/+854
Rollup of 5 pull requests Successful merges: - #118495 (Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` format strings) - #118540 (codegen, miri: fix computing the offset of an unsized field in a packed struct) - #118551 (more targeted errors when extern types end up in places they should not) - #118573 (rustc: Harmonize `DefKind` and `DefPathData`) - #118586 (Improve example in `slice::windows()` doc) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-04Auto merge of #118597 - lnicola:cargotest-no-branch, r=Mark-Simulacrumbors-1/+1
Don't ask for a specific branch in cargotest Tentative fix for https://github.com/rust-lang/rust/pull/118592#issuecomment-1838180918. `servo` [just renamed](https://github.com/servo/servo/pull/30788) their `master` branch to `main`, but `cargotest` does a `git fetch $URL master; git reset --hard $SHA`. Let's try to change that to `git fetch $URL $SHA; git reset --hard $SHA`, which appears to work, but I can't confirm for sure because I'm having some trouble with `x.py`: ``` --> library/rustc-std-workspace-core/lib.rs:4:9 | 4 | pub use core::*; | ^^^^ | = note: the following crate versions were found: crate `core` compiled by rustc 1.76.0-nightly (85a4bd8f5 2023-12-04): ./build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-70719e8645e6f000.rmeta = help: please recompile that crate using this compiler (rustc 1.76.0-nightly (5808b7248 2023-12-04)) (consider running `cargo clean` first) ```
2023-12-04Rollup merge of #118586 - gurry:118571-improve-slice-doc-example, r=thomccTakayuki Maeda-5/+5
Improve example in `slice::windows()` doc Fixes #118571 Now using a window of 3 instead 2 because it removes any confusion about exactly how consecutive windows overlap
2023-12-04Rollup merge of #118573 - petrochenkov:pathdatakind, r=TaKO8KiTakayuki Maeda-132/+133
rustc: Harmonize `DefKind` and `DefPathData` Follow up to https://github.com/rust-lang/rust/pull/118188. `DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`. `DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`. It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` instead could be a better solution, but that would be a much more invasive change. Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values. `DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
2023-12-04Rollup merge of #118551 - RalfJung:extern-types-bugs, r=compiler-errorsTakayuki Maeda-0/+22
more targeted errors when extern types end up in places they should not Cc https://github.com/rust-lang/rust/issues/115709 -- this does not fix that bug but it makes the panics less obscure and makes it more clear that this is a deeper issue than just a little codegen oversight. (In https://github.com/rust-lang/rust/pull/116115 we decided we'd stick to causing ICEs here for now, rather than nicer errors. We can't currently show any errors pre-mono and probably we don't want post-mono checks when this gets stabilized anyway.)
2023-12-04Rollup merge of #118540 - RalfJung:unsized-packed-offset, r=TaKO8KiTakayuki Maeda-11/+171
codegen, miri: fix computing the offset of an unsized field in a packed struct `#[repr(packed)]` strikes again. Fixes https://github.com/rust-lang/rust/issues/118537 Fixes https://github.com/rust-lang/miri/issues/3200 `@bjorn3` I assume cranelift needs the same fix.
2023-12-04Rollup merge of #118495 - weiznich:more_tests_for_on_unimplemented, ↵Takayuki Maeda-61/+523
r=compiler-errors Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` format strings This commit restricts what symbols can be used in a format string for any option of the `diagnostic::on_unimplemented` attribute. We previously allowed all the ad-hoc options supported by the internal `#[rustc_on_unimplemented]` attribute. For the stable attribute we only want to support generic parameter names and `{Self}` as parameters. For any other parameter an warning is emitted and the parameter is replaced by the literal parameter string, so for example `{integer}` turns into `{integer}`. This follows the general design of attributes in the `#[diagnostic]` attribute namespace, that any syntax "error" is treated as warning and subsequently ignored. r? `@compiler-errors`
2023-12-04Don't ask for a specific branch in cargotestLaurențiu Nicola-1/+1
2023-12-04Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` ↵Georg Semmler-61/+523
format strings This commit restricts what symbols can be used in a format string for any option of the `diagnostic::on_unimplemented` attribute. We previously allowed all the ad-hoc options supported by the internal `#[rustc_on_unimplemented]` attribute. For the stable attribute we only want to support generic parameter names and `{Self}` as parameters. For any other parameter an warning is emitted and the parameter is replaced by the literal parameter string, so for example `{integer}` turns into `{integer}`. This follows the general design of attributes in the `#[diagnostic]` attribute namespace, that any syntax "error" is treated as warning and subsequently ignored.
2023-12-04Auto merge of #118490 - Nadrieril:arena-alloc-matrix, r=nnethercotebors-31/+33
Exhaustiveness: allocate memory better Exhaustiveness is a recursive algorithm that allocates a bunch of slices at every step. Let's see if I can improve performance by improving allocations. Already just using `Vec::with_capacity` is showing impressive improvements on my local measurements. r? `@ghost`
2023-12-04Improve example in `slice::windows()` docGurinder Singh-5/+5
Now using a window of 3 instead 2 because it removes any confusion about exactly how consecutive windows overlap
2023-12-04Auto merge of #116915 - bend-n:unwet, r=saethlinbors-22/+33
Add an assume that the index is inbounds to slice::get_unchecked Fixes #116878
2023-12-04Document reentrancy in `*Arena::alloc_from_iter`Nadrieril-16/+25
2023-12-04use `assume(idx < self.len())` in `[T]::get_unchecked`bendn-22/+33
2023-12-03Auto merge of #117840 - RalfJung:miri-promise-align, r=cjgillotbors-118/+271
miri: support 'promising' alignment for symbolic alignment check Then use that ability in `slice::align_to`, so that even with `-Zmiri-symbolic-alignment-check`, it no longer has to return spuriously empty "middle" parts. Fixes https://github.com/rust-lang/miri/issues/3068
2023-12-03Auto merge of #118579 - matthiaskrgr:rollup-22kn8sa, r=matthiaskrgrbors-43/+174
Rollup of 3 pull requests Successful merges: - #117869 ([rustdoc] Add highlighting for comments in items declaration) - #118525 (coverage: Skip spans that can't be un-expanded back to the function body) - #118574 (rustc_session: Address all `rustc::potential_query_instability` lints) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-03move calling miri_promise_symbolic_alignment to a shared helperRalf Jung-65/+38
2023-12-03miri: support 'promising' alignment for symbolic alignment checkRalf Jung-118/+298
2023-12-03Rollup merge of #118574 - Enselic:query-instability, r=cjgillotMatthias Krüger-1/+7
rustc_session: Address all `rustc::potential_query_instability` lints Instead of allowing `rustc::potential_query_instability` on the whole crate we go over each lint and allow it individually if it is safe to do. Turns out all instances were safe to allow in this crate. Part of #84447 which is **E-help-wanted**.
2023-12-03Rollup merge of #118525 - Zalathar:skip-spans, r=cjgillotMatthias Krüger-28/+30
coverage: Skip spans that can't be un-expanded back to the function body When we extract coverage spans from MIR, we try to "un-expand" them back to spans that are inside the function's body span. In cases where that doesn't succeed, the current code just swaps in the entire body span instead. But that tends to result in coverage spans that are completely unrelated to the control flow of the affected code, so it's better to just discard those spans. --- Extracted from #118305, since this is a general improvement that isn't specific to branch coverage. --- `@rustbot` label +A-code-coverage
2023-12-03Rollup merge of #117869 - GuillaumeGomez:comment-highlighting-item-decl, ↵Matthias Krüger-14/+137
r=notriddle [rustdoc] Add highlighting for comments in items declaration Fixes #117555. So after the discussion in https://github.com/rust-lang/rust/pull/117643, the outcome was that having the comments in the item declaration at the same level (in term of color) as the rest of the code was actually a bit distracting and could be improved. The current highlighting color for comments is "lighter" than the rest and I think it fits perfectly to improve the current situation. With this, we now have different "levels" which makes it easier to read and filter out what we want when reading the items declaration. Here's a screenshot: ![image](https://github.com/rust-lang/rust/assets/3050060/dbd98029-e98b-4997-9a89-6b823eaac9a4) r? `@notriddle`
2023-12-03Auto merge of #118072 - estebank:issue-98982, r=cjgillotbors-30/+134
Provide structured suggestion for type mismatch in loop We currently provide only a `help` message, this PR introduces the last two structured suggestions instead: ``` error[E0308]: mismatched types --> $DIR/issue-98982.rs:2:5 | LL | fn foo() -> i32 { | --- expected `i32` because of return type LL | / for i in 0..0 { LL | | return i; LL | | } | |_____^ expected `i32`, found `()` | note: the function expects a value to always be returned, but loops might run zero times --> $DIR/issue-98982.rs:2:5 | LL | for i in 0..0 { | ^^^^^^^^^^^^^ this might have zero elements to iterate on LL | return i; | -------- if the loop doesn't execute, this value would never get returned help: return a value for the case when the loop has zero elements to iterate on | LL ~ } LL ~ /* `i32` value */ | help: otherwise consider changing the return type to account for that possibility | LL ~ fn foo() -> Option<i32> { LL | for i in 0..0 { LL ~ return Some(i); LL ~ } LL ~ None | ``` Fix #98982.
2023-12-03Auto merge of #113730 - belovdv:jobserver-init-check, r=petrochenkovbors-37/+114
Report errors in jobserver inherited through environment variables This pr attempts to catch situations, when jobserver exists, but is not being inherited. r? `@petrochenkov`
2023-12-03Auto merge of #118526 - sjwang05:issue-118510, r=petrochenkovbors-2/+45
Fix ICE: `fn_arg_names: unexpected item DefId(..)` Fixes #118510
2023-12-03rustc_session: Address all `rustc::potential_query_instability` lintsMartin Nordholts-1/+7
Instead of allowing `rustc::potential_query_instability` on the whole crate we go over each lint and allow it individually if it is safe to do. Turns out all instances were safe to allow in this crate.
2023-12-03rustc: Harmonize `DefKind` and `DefPathData`Vadim Petrochenkov-132/+133
`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`. `DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`. It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` could be a better solution, but that would be a much more invasive change. Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values. `DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
2023-12-03Auto merge of #118567 - RalfJung:miri, r=RalfJungbors-30/+105
Miri subtree update r? `@ghost`
2023-12-03Auto merge of #3204 - RalfJung:simd, r=RalfJungbors-5/+74
add new SIMD intrinsics
2023-12-03add simd_bswap and simd_bitreverseRalf Jung-0/+19
2023-12-03add simd_cttz and simd_ctlzRalf Jung-2/+27
2023-12-03simd_select_bitmask: support passing the mask as an arrayRalf Jung-3/+28
2023-12-03Auto merge of #3203 - RalfJung:trophy, r=RalfJungbors-0/+1
new trophy case entry Cc https://github.com/rust-lang/rust/pull/118460
2023-12-03new trophy case entryRalf Jung-0/+1
2023-12-03Auto merge of #118546 - RalfJung:hashbrown, r=Amanieubors-32/+56
update hashbrown I had to also pull in an updated syn to make that work, and then cargo pulled in some more package updates. r? `@Amanieu`
2023-12-03codegen, miri: fix computing the offset of an unsized field in a packed structRalf Jung-11/+171
2023-12-03more targeted errors when extern types end up in places they should notRalf Jung-0/+22
2023-12-03Auto merge of #118487 - RalfJung:exposed-provenance, r=thomccbors-63/+78
move exposed-provenance APIs into separate feature gate We have already stated explicitly for all the 'exposed' functions that > Using this method means that code is *not* following strict provenance rules. However, they were part of the same feature gate and still described as part of the strict provenance experiment. Unfortunately, their semantics are much less clear and certainly nowhere near stabilization, so in preparation for an attempt to stabilize the strict provenance APIs, I suggest we split the things related to "exposed" into their own feature gate. I also used this opportunity to better explain how Exposed Provenance fits into the larger plan here: this is *one possible candidate* for `as` semantics, but we don't know if it is actually viable, so we can't really promise that it is equivalent to `as`. If it works out we probably want to make `as` equivalent to the 'exposed' APIs; if it doesn't, we will remove them again and try to find some other semantics for `as`.
2023-12-03Auto merge of #3202 - rust-lang:rustup-2023-12-03, r=saethlinbors-2471/+6456
Automatic Rustup
2023-12-03Merge from rustcThe Miri Conjob Bot-2470/+6455
2023-12-03Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-12-03Auto merge of #118128 - RalfJung:bad-intrinsics, r=the8472bors-0/+10
warn against using intrinsics that leave the scope of our memory model