Commit graph

144896 commits

Author SHA1 Message Date
Weihang Lo
2bf976d82b
Update cargo 2023-12-05 23:39:30 -05:00
bors
56278a6e28 Auto merge of #118457 - eholk:genfn, r=compiler-errors
Add support for `gen fn`

This builds on #116447 to add support for `gen fn` functions. For the most part we follow the same approach as desugaring `async fn`, but replacing `Future` with `Iterator` and `async {}` with `gen {}` for the body.

The version implemented here uses the return type of a `gen fn` as the yield type. For example:

```rust
gen fn count_to_three() -> i32 {
    yield 1;
    yield 2;
    yield 3;
}
```

In the future, I think we should experiment with a syntax like `gen fn count_to_three() yield i32 { ... }`, but that can go in another PR.

cc `@oli-obk` `@compiler-errors`
2023-12-05 18:37:15 +00:00
Matthias Krüger
4b40b1b0e1
Rollup merge of #118614 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/nomicon

1 commits in 1842257814919fa62e81bdecd5e8f95be2839dbb..83d015105e6d490fc30d6c95da1e56152a50e228
2023-11-22 15:35:31 UTC to 2023-11-22 15:35:31 UTC

- Reword the section on general race conditions (rust-lang/nomicon#431)

## rust-lang/reference

5 commits in cd8193e972f61b92117095fc73b67af767b4d6bc..692d216f5a1151e8852ddb308ba64040e634c876
2023-12-04 09:45:06 UTC to 2023-11-21 17:57:18 UTC

- Fix note on `self` coercion (rust-lang/reference#1431)
- Document C string literal tokens. (rust-lang/reference#1423)
- type-layout.md: Warn about repr(align)/repr(packed) and field order (rust-lang/reference#1430)
- Lone `self` in a method body resolves to the self parameter (rust-lang/reference#1427)
- Reference wildcard patterns from underscore expr (rust-lang/reference#1428)

## rust-lang/rust-by-example

4 commits in a6581246f96837113968c02187db24f742af3908..da0a06aada31a324ae84a9eaee344f6a944b9683
2023-11-27 12:50:49 UTC to 2023-11-21 11:58:19 UTC

- fix tiny typo in string conversion docs (rust-lang/rust-by-example#1776)
- fix(arg): Remove reference to Rust Cookbook in arg parsing (rust-lang/rust-by-example#1775)
- fix:typo error (rust-lang/rust-by-example#1774)
- Remove space between `&` and `self` (rust-lang/rust-by-example#1772)

## rust-lang/rustc-dev-guide

5 commits in ddb8b1309f9e905804cea1e248a4572fed6b464b..904bb5aa7b21adad58ffae610e2830c7b0f813b0
2023-11-28 13:13:36 UTC to 2023-11-22 06:13:00 UTC

- Update how-to-build-and-run.md (rust-lang/rustc-dev-guide#1828)
- notification groups: add information about how to ping them (rust-lang/rustc-dev-guide#1818)
- Add explanations on how to run rustc_codegen_gcc tests (rust-lang/rustc-dev-guide#1821)
- Add back the `canonicalization` chapter. (rust-lang/rustc-dev-guide#1532)
- Emphasize that the experts map is not up to date (rust-lang/rustc-dev-guide#1826)
2023-12-05 16:08:37 +01:00
Matthias Krüger
a260acc668
Rollup merge of #118606 - long-long-float:x-do-not-quit-when-x-prints-settings-json, r=onur-ozkan
Fix `x` not to quit after `x` prints `settings.json`

I fixed the `x` not to quit after the `x` prints `.vscode/settings.json`.

The command `x setup` ask as following:

```
x.py can automatically install the recommended `.vscode/settings.json` file for rustc development
Would you like to create/update `settings.json`, or only print suggested settings?: [y/p/N]
```

When user types `p`, the `x` prints the contents and quit the program.
It is a hassle to start the command again, so I fixed the `x` to ask what to do again.
2023-12-05 16:08:36 +01:00
Matthias Krüger
fddda14ac0
Rollup merge of #118594 - hdost:patch-1, r=fmease
Remove mention of rust to make the error message generic.

The deprecation notice is used when in crates as well. This applies to versions Rust or Crates.

Relates #118148
2023-12-05 16:08:35 +01:00
long-long-float
15a8e9d59b Fix x not to quit when x prints settings.json
Use `while` instead of `loop`

Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com>

Update prompt message
2023-12-05 19:39:06 +09:00
Harold Dost
1b503042b8 Remove mention of rust to make the error message generic.
The deprecation notice is used when in crates as well. This applies to versions Rust or Crates.

Fixes #118148

Signed-off-by: Harold Dost <h.dost@criteo.com>
2023-12-05 09:18:41 +01:00
Ralf Jung
1fa8fd800f simd numeric intrinsics: share code with scalar intrinsic 2023-12-05 07:42:13 +01:00
Ralf Jung
ff95f8b872 fix miri_promise_symbolic_alignment for huge alignments 2023-12-05 07:39:52 +01:00
Ralf Jung
6237f2381d fix typo in comment 2023-12-05 07:32:49 +01:00
The Miri Conjob Bot
0d5fdcca6c fmt 2023-12-05 05:17:10 +00:00
The Miri Conjob Bot
cf1ef1300e Merge from rustc 2023-12-05 05:15:52 +00:00
The Miri Conjob Bot
d651eb9e23 Preparing for merge from rustc 2023-12-05 05:09:34 +00:00
Eric Holk
2c8dbd959f
Fix build 2023-12-04 16:46:45 -08:00
Eric Holk
ac4d0f240f
Update doctest 2023-12-04 16:37:45 -08:00
Eric Holk
09f0741449
Remove bad merge 2023-12-04 14:38:10 -08:00
Eric Holk
50ef8006eb
Address code review feedback 2023-12-04 14:33:46 -08:00
Eric Holk
f9d1f922dc
Option<CoroutineKind> 2023-12-04 13:03:37 -08:00
Eric Holk
48d5f1f0f2
Merge Async and Gen into CoroutineKind 2023-12-04 12:48:01 -08:00
Guillaume Gomez
baa3f96b42
Rollup merge of #118600 - GuillaumeGomez:fields-heading, r=notriddle
[rustdoc] Don't generate the "Fields" heading if there is no field displayed

Fixes https://github.com/rust-lang/rust/issues/118195.

If no field is displayed, we should not generate the `Fields` heading in enum struct variants.

r? ``@notriddle``
2023-12-04 20:46:10 +01:00
Guillaume Gomez
963e8e8bd8
Rollup merge of #118508 - notriddle:notriddle/fmt-newline, r=GuillaumeGomez
rustdoc: do not escape quotes in body text

Escaping quote marks is only needed in attributes, not text.

```console
$ du -hs doc-old/ doc-new/
670M    doc-old/
669M    doc-new/
```
2023-12-04 20:46:09 +01:00
bors
0e2dac8375 Auto merge of #118592 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2023-12-04 17:18:56 +00:00
rustbot
8fb7117385 Update books 2023-12-04 12:00:34 -05:00
bors
e281163dc8 Auto merge of #118602 - TaKO8Ki:rollup-njcouns, r=TaKO8Ki
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-04 14:46:49 +00:00
Takayuki Maeda
87625dbf2b
Rollup merge of #118540 - RalfJung:unsized-packed-offset, r=TaKO8Ki
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-04 21:19:44 +09:00
Guillaume Gomez
1c556bbed4 Don't generate the "Fields" heading if there is no field displayed 2023-12-04 12:12:13 +01:00
Laurențiu Nicola
5808b72484 Don't ask for a specific branch in cargotest 2023-12-04 12:11:44 +02:00
Laurențiu Nicola
638ba5ae28 Merge commit 'e402c494b7' into sync-from-ra 2023-12-04 09:19:15 +02:00
Ralf Jung
81740452a8 fix clippy 2023-12-04 08:10:34 +01:00
The Miri Conjob Bot
2c545ed69e fmt 2023-12-04 05:03:55 +00:00
The Miri Conjob Bot
bcc059500c Merge from rustc 2023-12-04 05:02:38 +00:00
The Miri Conjob Bot
da4fd2220f Preparing for merge from rustc 2023-12-04 04:56:13 +00:00
bors
85a4bd8f58 Auto merge of #116915 - bend-n:unwet, r=saethlin
Add an assume that the index is inbounds to slice::get_unchecked

Fixes #116878
2023-12-04 03:09:45 +00:00
bendn
73afc00cf9
use assume(idx < self.len()) in [T]::get_unchecked 2023-12-04 06:00:12 +07:00
bors
c9808f8702 Auto merge of #117840 - RalfJung:miri-promise-align, r=cjgillot
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-03 22:53:44 +00:00
Ralf Jung
bebba4f6e0 miri: support 'promising' alignment for symbolic alignment check 2023-12-03 21:51:14 +01:00
Matthias Krüger
591b84583c
Rollup merge of #117869 - GuillaumeGomez:comment-highlighting-item-decl, 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-03 21:28:32 +01:00
Ralf Jung
7c6ed0cc19 SIMD bitmasks: use 'round up to multiple of 8' rather than 'clamp to at least 8' 2023-12-03 19:24:03 +01:00
bors
db07cccb1e Auto merge of #113730 - belovdv:jobserver-init-check, r=petrochenkov
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-03 16:28:22 +00:00
Ralf Jung
6e74d2ad50 disable a test that currently fails on big-endian 2023-12-03 16:19:53 +01:00
Ralf Jung
c9463698db also test directly calling simd_select_bitmask 2023-12-03 16:17:12 +01:00
Ralf Jung
92b4ffc688 handle the array case consistently for simd_select_bitmask and simd_bitmask
also move the two next to each other
2023-12-03 15:45:38 +01:00
Ralf Jung
56f50d53d1 also test simd_select_bitmask on arrays for less than 8 elements 2023-12-03 14:42:41 +01:00
bors
8b6a4a93ed Auto merge of #118567 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2023-12-03 11:59:32 +00:00
bors
28f9fe3262 Auto merge of #3204 - RalfJung:simd, r=RalfJung
add new SIMD intrinsics
2023-12-03 11:11:20 +00:00
Ralf Jung
2903f1c322 add simd_bswap and simd_bitreverse 2023-12-03 12:08:02 +01:00
Ralf Jung
31ea5181b6 add simd_cttz and simd_ctlz 2023-12-03 12:07:51 +01:00
Ralf Jung
11db9de728 simd_select_bitmask: support passing the mask as an array 2023-12-03 11:28:40 +01:00
Ralf Jung
323ca94d92 new trophy case entry 2023-12-03 10:47:59 +01:00
bors
7ceaf19868 Auto merge of #118546 - RalfJung:hashbrown, r=Amanieu
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-03 09:03:14 +00:00