]> git.lizzy.rs Git - rust.git/log
rust.git
16 months agoRename `Cursor`/`CursorRef` as `TokenTreeCursor`/`RefTokenTreeCursor`.
Nicholas Nethercote [Wed, 1 Feb 2023 01:58:04 +0000 (12:58 +1100)]
Rename `Cursor`/`CursorRef` as `TokenTreeCursor`/`RefTokenTreeCursor`.

This makes it clear they return token trees, and makes for a nice
comparison against `TokenCursor` which returns tokens.

16 months agoRemove `TokenCursorFrame`.
Nicholas Nethercote [Wed, 1 Feb 2023 01:43:13 +0000 (12:43 +1100)]
Remove `TokenCursorFrame`.

The motivation here is to eliminate the `Option<(Delimiter,
DelimSpan)>`, which is `None` for the outermost token stream and `Some`
for all other token streams.

We are already treating the innermost frame specially -- this is the
`frame` vs `stack` distinction in `TokenCursor`. We can push that
further so that `frame` only contains the cursor, and `stack` elements
contain the delimiters for their children. When we are in the outermost
token stream `stack` is empty, so there are no stored delimiters, which
is what we want because the outermost token stream *has* no delimiters.

This change also shrinks `TokenCursor`, which shrinks `Parser` and
`LazyAttrTokenStreamImpl`, which is nice.

16 months agoMake clear that `TokenTree::Token` shouldn't contain a delimiter.
Nicholas Nethercote [Wed, 1 Feb 2023 00:21:28 +0000 (11:21 +1100)]
Make clear that `TokenTree::Token` shouldn't contain a delimiter.

16 months agoImprove doc comment desugaring.
Nicholas Nethercote [Tue, 31 Jan 2023 23:53:00 +0000 (10:53 +1100)]
Improve doc comment desugaring.

Sometimes the parser needs to desugar a doc comment into `#[doc =
r"foo"]`. Currently it does this in a hacky way: by pushing a "fake" new
frame (one without a delimiter) onto the `TokenCursor` stack.

This commit changes things so that the token stream itself is modified
in place. The nice thing about this is that it means
`TokenCursorFrame::delim_sp` is now only `None` for the outermost frame.

16 months agoAuto merge of #107478 - compiler-errors:anon-enum-tys-are-ambiguous, r=estebank
bors [Thu, 2 Feb 2023 12:01:17 +0000 (12:01 +0000)]
Auto merge of #107478 - compiler-errors:anon-enum-tys-are-ambiguous, r=estebank

Revert "Teach parser to understand fake anonymous enum syntax" and related commits

anonymous enum types are currently ambiguous in positions like:

* `|` operator: `a as fn() -> B | C`
* closure args: `|_: as fn() -> A | B`

I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.

Fixes #107461

cc: `@estebank` `@cjgillot` #106960

---
### Squashed revert commits:

Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36cb678e3ddc2ead41364be314d19e93.

Revert "Ensure macros are not affected"

This reverts commit 12d18e403139eeeeb339e8611b2bed4910864edb.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b1f620c4fdb98c75805033e768975d1.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d824206655bfb26cb5eed43490ee396542b153e.

16 months agoAuto merge of #107584 - matthiaskrgr:rollup-vav4ljz, r=matthiaskrgr
bors [Thu, 2 Feb 2023 09:05:18 +0000 (09:05 +0000)]
Auto merge of #107584 - matthiaskrgr:rollup-vav4ljz, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #107201 (Remove confusing 'while checking' note from opaque future type mismatches)
 - #107312 (Add Style Guide rules for let-else statements)
 - #107488 (Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.)
 - #107531 (Inline CSS background images directly into the CSS)
 - #107576 (Add proc-macro boilerplate to crt-static test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

16 months agoAdd a test
Michael Goulet [Mon, 30 Jan 2023 18:39:33 +0000 (18:39 +0000)]
Add a test

16 months agoRevert "Teach parser to understand fake anonymous enum syntax" and related commits
Michael Goulet [Mon, 30 Jan 2023 18:08:50 +0000 (18:08 +0000)]
Revert "Teach parser to understand fake anonymous enum syntax" and related commits

Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36cb678e3ddc2ead41364be314d19e93.

Revert "Ensure macros are not affected"

This reverts commit 12d18e403139eeeeb339e8611b2bed4910864edb.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b1f620c4fdb98c75805033e768975d1.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d824206655bfb26cb5eed43490ee396542b153e.

16 months agoRollup merge of #107576 - P1n3appl3:master, r=tmandry
Matthias Krüger [Thu, 2 Feb 2023 05:52:15 +0000 (06:52 +0100)]
Rollup merge of #107576 - P1n3appl3:master, r=tmandry

Add proc-macro boilerplate to crt-static test

I was seeing this failure when running ui tests with with a `-Cpanic=abort` stdlib targeting fuchsia:

```
---- [ui] tests/ui/proc-macro/crt-static.rs stdout ----
normalized stderr:
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic

warning: 1 warning emitted

The actual stderr differed from the expected stderr.
```

`force-host` was enough to stop it from running/failing, not sure if I should also add `needs-unwind`?

16 months agoRollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle
Matthias Krüger [Thu, 2 Feb 2023 05:52:15 +0000 (06:52 +0100)]
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle

Inline CSS background images directly into the CSS

A nice advantage of this is that it removes a few entries in the list of static files.

r? ``@notriddle``

16 months agoRollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung
Matthias Krüger [Thu, 2 Feb 2023 05:52:14 +0000 (06:52 +0100)]
Rollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung

Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by `-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST nodes are constructed within the compiler. But it does mean anyone using `-Zunpretty=expanded` output as a guide for hand-written impls could get a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

r? ``@RalfJung``

16 months agoRollup merge of #107312 - calebcartwright:style-let-else, r=joshtriplett
Matthias Krüger [Thu, 2 Feb 2023 05:52:13 +0000 (06:52 +0100)]
Rollup merge of #107312 - calebcartwright:style-let-else, r=joshtriplett

Add Style Guide rules for let-else statements

cc `@rust-lang/style` `@rust-lang/rustfmt`

[rendered](https://github.com/calebcartwright/rust/blob/c694d07c6413ba55caa10b9f8b853df7a7792e7c/src/doc/style-guide/src/statements.md#else-blocks-let-else-statements)

16 months agoRollup merge of #107201 - compiler-errors:confusing-async-fn-note, r=estebank
Matthias Krüger [Thu, 2 Feb 2023 05:52:13 +0000 (06:52 +0100)]
Rollup merge of #107201 - compiler-errors:confusing-async-fn-note, r=estebank

Remove confusing 'while checking' note from opaque future type mismatches

Maybe I'm just misinterpreting the wording of the note. The only value I can see in this note is that it points out where the async's opaque future is coming from, but the way it's doing it is misleading IMO.

For example:

```rust
note: while checking the return type of the `async fn`
  --> $DIR/dont-suggest-missing-await.rs:7:24
   |
LL | async fn make_u32() -> u32 {
   |                        ^^^ checked the `Output` of this `async fn`, found opaque type
```

We point at the type `u32` in the HIR, but then say "found opaque type". We also say "while checking"... but we're typechecking a totally different function when we get this type mismatch!

r? ``@estebank`` but feel free to reassign and/or take your time reviewing this. I'd be inclined to also discuss reworking the presentation of this type mismatch to restore some of these labels in a way that makes it more clear what it's trying to point out.

16 months agoAuto merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-macbi-target-version...
bors [Thu, 2 Feb 2023 05:26:09 +0000 (05:26 +0000)]
Auto merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-macbi-target-version, r=wesleywiser

Remove hardcoded iOS version of clang target for Mac Catalyst

## Background

From `clang` 13.x, `-target x86_64-apple-ios13.0-macabi` fails while linking:

```
  = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
```

<details>
<summary>Verbose output</summary>

```
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="[removed]" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-exported_symbols_list,/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/list" "-target" "x86_64-apple-ios13.0-macabi" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/symbols.o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/[user].[user].a2ccc648-cgu.0.rcgu.o" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps" "-L" "/path/to/my/[project]/[user]/target/release/deps" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/libblake3-343c1616c8f62c66.rlib" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/libcompiler_builtins-15d4f20b641cf9ef.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-framework" "Security" "-liconv" "-lSystem" "-lobjc" "-framework" "Security" "-framework" "Foundation" "-lc" "-lm" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-Wl,-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "-o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/lib[user].dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'

warning: `[user]` (lib) generated 6 warnings
error: could not compile `[user]` due to previous error; 6 warnings emitted
```
</details>

### Minimal example

C code:

```c
#include <stdio.h>
void main() {
    int a = 1;
    int b = 2;
    int c = a + b;
    printf("%d", c);
}
```

`clang` command sample:

```
➜  202301 clang -target x86_64-apple-ios13.0-macabi main.c
clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
➜  202301 clang -target x86_64-apple-ios14.0-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.
➜  202301 clang -target x86_64-apple-ios15.0-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.
➜  202301 clang -target x86_64-apple-ios-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.

➜  202301 clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

This PR is a simplified version of #96392, inspired by https://github.com/rust-lang/cc-rs/pull/727

16 months agodocs(style-guide): add rules for let-else statements
Caleb Cartwright [Thu, 26 Jan 2023 01:43:06 +0000 (19:43 -0600)]
docs(style-guide): add rules for let-else statements

16 months agoAuto merge of #105670 - Xiretza:rustc_parse-diagnostics-4, r=davidtwco
bors [Thu, 2 Feb 2023 02:23:31 +0000 (02:23 +0000)]
Auto merge of #105670 - Xiretza:rustc_parse-diagnostics-4, r=davidtwco

rustc_parse: diagnostics migration, v4

This is all the `rustc_parse` migrations I have in store right now; unfortunately life is pretty busy right now, so I won't be able to do much more in the near future.

cc #100717

r? `@davidtwco`

16 months agoAuto merge of #107574 - compiler-errors:back-to-old-mac-builders-pls, r=pietroalbini
bors [Wed, 1 Feb 2023 22:45:27 +0000 (22:45 +0000)]
Auto merge of #107574 - compiler-errors:back-to-old-mac-builders-pls, r=pietroalbini

Revert "switch to the macos-12-xl builder"

This reverts commit fcbae989ae790d5b9a0a23ceba242d0b0d4e6c5b.

This should fix the bors failures in https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Every.20rust-lang.2Frust.20PR.20is.20failing.20bors

16 months agoAdd proc-macro boilerplate to crt-static test
Joseph Ryan [Wed, 1 Feb 2023 21:35:36 +0000 (13:35 -0800)]
Add proc-macro boilerplate to crt-static test

16 months agoRevert "switch to the macos-12-xl builder"
Michael Goulet [Wed, 1 Feb 2023 21:31:05 +0000 (21:31 +0000)]
Revert "switch to the macos-12-xl builder"

This reverts commit fcbae989ae790d5b9a0a23ceba242d0b0d4e6c5b.

16 months agoMake "use latest edition" subdiagnostic translatable
Xiretza [Wed, 28 Dec 2022 22:21:04 +0000 (23:21 +0100)]
Make "use latest edition" subdiagnostic translatable

16 months agorustc_parse: revert conversion of "non-item in item list" diagnostic
Xiretza [Tue, 13 Dec 2022 17:57:41 +0000 (18:57 +0100)]
rustc_parse: revert conversion of "non-item in item list" diagnostic

#[derive(Subdiagnostic)] does not allow multiple subdiagnostics on one
variant, as in NonItemInItemListSub::Other.

16 months agomigrate parser::ty to diagnostic structs
Xiretza [Tue, 18 Oct 2022 16:03:12 +0000 (18:03 +0200)]
migrate parser::ty to diagnostic structs

16 months agoConvert rustc_parse::parser::pat::Expected to enum
Xiretza [Tue, 8 Nov 2022 21:03:17 +0000 (22:03 +0100)]
Convert rustc_parse::parser::pat::Expected to enum

This is required in order to support translatable diagnostics.

16 months agorustc_parse: migrate more to diagnostic structs
Xiretza [Fri, 14 Oct 2022 21:16:25 +0000 (23:16 +0200)]
rustc_parse: migrate more to diagnostic structs

16 months agotests: rename test cases to match new behaviour
Xiretza [Tue, 27 Dec 2022 19:34:09 +0000 (20:34 +0100)]
tests: rename test cases to match new behaviour

16 months agoFix condition for "missing `struct`" diagnostic on tuple structs
Xiretza [Thu, 6 Oct 2022 16:35:53 +0000 (18:35 +0200)]
Fix condition for "missing `struct`" diagnostic on tuple structs

The check previously matched this, and suggested adding a missing
`struct`:

pub Foo(...):

It was probably intended to match this instead (semicolon instead of
colon):

pub Foo(...);

16 months agoImplement IntoDiagnosticArg for ast::Visibility
Xiretza [Wed, 5 Oct 2022 20:05:45 +0000 (22:05 +0200)]
Implement IntoDiagnosticArg for ast::Visibility

16 months agoUse AddToDiagnostic for "use latest edition" help
Xiretza [Wed, 5 Oct 2022 19:40:56 +0000 (21:40 +0200)]
Use AddToDiagnostic for "use latest edition" help

16 months agorustc_parse: avoid creating unnecessary intermediate strings
Xiretza [Tue, 27 Dec 2022 19:46:39 +0000 (20:46 +0100)]
rustc_parse: avoid creating unnecessary intermediate strings

16 months agoForbid #[suggestion_*(...)] on Vecs
Xiretza [Sun, 16 Oct 2022 14:15:39 +0000 (16:15 +0200)]
Forbid #[suggestion_*(...)] on Vecs

It is ambiguous whether this should produce several `.span_suggestions()`
calls or one `.multipart_suggestions()` call.

16 months agoAuto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwco
bors [Wed, 1 Feb 2023 11:37:24 +0000 (11:37 +0000)]
Auto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwco

Strengthen validation of FFI attributes

Previously, `codegen_attrs` validated the attributes `#[ffi_pure]`, `#[ffi_const]`, and `#[ffi_returns_twice]` to make sure that they were only used on foreign functions. However, this validation was insufficient in two ways:

1. `codegen_attrs` only sees items for which code must be generated, so it was unable to raise errors when the attribute was incorrectly applied to macros and the like.
2. the validation code only checked that the item with the attr was foreign, but not that it was a foreign function, allowing these attributes to be applied to foreign statics as well.

This PR moves the validation to `check_attr`, which sees all items. It additionally changes the validation to ensure that the attribute's target is `Target::ForeignFunction`, only allowing the attributes on foreign functions and not foreign statics. Because these attributes are unstable, there is no risk for backwards compatibility. The changes also ending up making the code much easier to read.

This PR is best reviewed commit by commit. Additionally, I was considering moving the tests to the `attribute` subdirectory, to get them out of the general UI directory. I could do that as part of this PR or a follow-up, as the reviewer prefers.

CC: #58328, #58329
16 months agoInline CSS background images directly into the CSS
Guillaume Gomez [Tue, 31 Jan 2023 20:23:23 +0000 (21:23 +0100)]
Inline CSS background images directly into the CSS

16 months agoAuto merge of #107546 - matthiaskrgr:rollup-9rgf2gx, r=matthiaskrgr
bors [Wed, 1 Feb 2023 07:47:29 +0000 (07:47 +0000)]
Auto merge of #107546 - matthiaskrgr:rollup-9rgf2gx, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #107389 (Fixing confusion between mod and remainder)
 - #107442 (improve panic message for slice windows and chunks)
 - #107470 (Small bootstrap improvements)
 - #107487 (Make the "extra if in let...else block" hint a suggestion)
 - #107499 (Do not depend on Generator trait when deducing closure signature)
 - #107533 (Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

16 months agoRollup merge of #107533 - pnkfelix:distinguish-generator-state-in-print-type-sizes...
Matthias Krüger [Wed, 1 Feb 2023 04:54:40 +0000 (05:54 +0100)]
Rollup merge of #107533 - pnkfelix:distinguish-generator-state-in-print-type-sizes, r=compiler-errors

Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields.

For example, for this code:

```rust
async fn wait() {}

async fn test(arg: [u8; 8192]) {
    wait().await;
    drop(arg);
}

async fn test_ideal(_rg: [u8; 8192]) {
    wait().await;
    // drop(arg);
}

fn main() {
    let gen_t = test([0; 8192]);
    let gen_i = test_ideal([0; 8192]);
    println!("expect {}, got: {}",
             std::mem::size_of_val(&gen_i),
             std::mem::size_of_val(&gen_t));
}
```

the `-Z print-type-sizes` output used to start with:

```
print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
print-type-size     discriminant: 1 bytes
print-type-size     variant `Suspend0`: 16385 bytes
print-type-size         field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
print-type-size         field `.arg`: 8192 bytes
print-type-size         field `.__awaitee`: 1 bytes
...
print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
print-type-size     field `.value`: 8192 bytes
...
```

but with this change, it now instead prints:

```
print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
print-type-size     discriminant: 1 bytes
print-type-size     variant `Suspend0`: 16385 bytes
print-type-size         upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
print-type-size         local `.arg`: 8192 bytes
print-type-size         local `.__awaitee`: 1 bytes
...
print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
print-type-size     field `.value`: 8192 bytes
```

(spawned off of investigation of https://github.com/rust-lang/rust/issues/62958 )

16 months agoRollup merge of #107499 - compiler-errors:deduce_sig_from_projection-generator-tweak...
Matthias Krüger [Wed, 1 Feb 2023 04:54:39 +0000 (05:54 +0100)]
Rollup merge of #107499 - compiler-errors:deduce_sig_from_projection-generator-tweak, r=michaelwoerister

Do not depend on Generator trait when deducing closure signature

1. Do not depend on `Generator` trait when deducing closure signature.
2. Compare the name of the `Generator::Return` associated item, rather than its order in the trait. Seems more stable this way.

16 months agoRollup merge of #107487 - edward-shen:edward-shen/107213-round-2, r=estebank
Matthias Krüger [Wed, 1 Feb 2023 04:54:39 +0000 (05:54 +0100)]
Rollup merge of #107487 - edward-shen:edward-shen/107213-round-2, r=estebank

Make the "extra if in let...else block" hint a suggestion

Changes the hint to a suggestion, suggested in #107213.

r? ```@estebank```

16 months agoRollup merge of #107470 - kadiwa4:bootstrap_cleanup, r=albertlarsan68
Matthias Krüger [Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)]
Rollup merge of #107470 - kadiwa4:bootstrap_cleanup, r=albertlarsan68

Small bootstrap improvements

- i/o-less check for `xz` availability
- cache result of NixOS detection
- load correct `bootstrap` module even when a package of that name is installed
- no `-W semicolon_in_expressions_from_macros` – it is warn-by-default
- one type per variable (making dynamic typing less confusing)
- integrate python-side `--help` flag into the argument parser (makes `-hv` work as a short form of `--help --verbose`)

I even checked that it works with Python 2.

16 months agoRollup merge of #107442 - lukas-code:slice-panics, r=cuviper
Matthias Krüger [Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)]
Rollup merge of #107442 - lukas-code:slice-panics, r=cuviper

improve panic message for slice windows and chunks

before:
```text
thread 'main' panicked at 'size is zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:809:44
```
```text
thread 'main' panicked at 'assertion failed: `(left != right)`
  left: `0`,
 right: `0`: chunks cannot have a size of zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:843:9
```

after:
```text
thread 'main' panicked at 'chunk size must be non-zero', src/main.rs:4:22
```

fixes https://github.com/rust-lang/rust/issues/107437

16 months agoRollup merge of #107389 - zvavybir:master, r=estebank
Matthias Krüger [Wed, 1 Feb 2023 04:54:37 +0000 (05:54 +0100)]
Rollup merge of #107389 - zvavybir:master, r=estebank

Fixing confusion between mod and remainder

Like many programming languages, rust too confuses remainder and modulus.  The `%` operator and the associated `Rem` trait is (as the trait name suggests) the remainder, but since most people are linguistically more familiar with the modulus the documentation sometimes claims otherwise.  This PR tries to fix this problem in rustc.

16 months agoAuto merge of #107541 - weihanglo:update-cargo, r=weihanglo
bors [Wed, 1 Feb 2023 04:53:29 +0000 (04:53 +0000)]
Auto merge of #107541 - weihanglo:update-cargo, r=weihanglo

Update cargo

18 commits in 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c..e84a7928d93a31f284b497c214a2ece69b4d7719 2023-01-24 15:48:15 +0000 to 2023-01-31 22:18:09 +0000

- chore: Add autolabel for `Command-*` labels (rust-lang/cargo#11664)
- Update cross test instructions for aarch64-apple-darwin (rust-lang/cargo#11663)
- Make cargo install report needed features (rust-lang/cargo#11647)
- docs(contrib): Remove out-of-date process step (rust-lang/cargo#11662)
- Do not error for `auth-required: true` without `-Z sparse-registry` (rust-lang/cargo#11661)
- Warn on commits to non-default branches. (rust-lang/cargo#11655)
- Avoid saving the same future_incompat warning multiple times (rust-lang/cargo#11648)
- Mention current default value in `publish.timeout` docs (rust-lang/cargo#11652)
- Make cargo aware of dwp files. (rust-lang/cargo#11572)
- Reduce target info rustc query calls (rust-lang/cargo#11633)
- Bump to 0.70.0; update changelog (rust-lang/cargo#11640)
- Enable sparse protocol in CI (rust-lang/cargo#11632)
- Fix split-debuginfo support detection (rust-lang/cargo#11347)
- refactor(toml): Move `TomlWorkspaceDependency` out of `TomlDependency` (rust-lang/cargo#11565)
- book: describe how the current resolver sometimes duplicates deps (rust-lang/cargo#11604)
- `cargo add` check `[dependencies]` order without considering the dotted item (rust-lang/cargo#11612)
- Link CoC to  www.rust-lang.org/conduct.html (rust-lang/cargo#11622)
- Add more labels to triagebot (rust-lang/cargo#11621)

r? `@ghost`

16 months agoFix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
Nicholas Nethercote [Mon, 30 Jan 2023 05:29:52 +0000 (16:29 +1100)]
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by
`-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST
nodes are constructed within the compiler. But it does mean anyone using
`-Zunpretty=expanded` output as a guide for hand-written impls could get
a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

16 months agoAuto merge of #107536 - GuillaumeGomez:rollup-xv7dx2h, r=GuillaumeGomez
bors [Wed, 1 Feb 2023 01:15:02 +0000 (01:15 +0000)]
Auto merge of #107536 - GuillaumeGomez:rollup-xv7dx2h, r=GuillaumeGomez

Rollup of 12 pull requests

Successful merges:

 - #106898 (Include both md and yaml ICE ticket templates)
 - #107331 (Clean up eslint annotations and remove unused JS function)
 - #107348 (small refactor to new projection code)
 - #107354 (rustdoc: update Source Serif 4 from 4.004 to 4.005)
 - #107412 (avoid needless checks)
 - #107467 (Improve enum checks)
 - #107486 (Track bound types like bound regions)
 - #107491 (rustdoc: remove unused CSS from `.setting-check`)
 - #107508 (`Edition` micro refactor)
 - #107525 (PointeeInfo is advisory only)
 - #107527 (rustdoc: stop making unstable items transparent)
 - #107535 (Replace unwrap with ? in TcpListener doc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

16 months agoBless updated output from print-type-sizes tests.
Felix S. Klock II [Wed, 1 Feb 2023 01:00:54 +0000 (20:00 -0500)]
Bless updated output from print-type-sizes tests.

16 months agoUpdate cargo
Weihang Lo [Wed, 1 Feb 2023 00:20:38 +0000 (00:20 +0000)]
Update cargo

18 commits in 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c..e84a7928d93a31f284b497c214a2ece69b4d7719
2023-01-24 15:48:15 +0000 to 2023-01-31 22:18:09 +0000

- chore: Add autolabel for `Command-*` labels (rust-lang/cargo#11664)
- Update cross test instructions for aarch64-apple-darwin (rust-lang/cargo#11663)
- Make cargo install report needed features (rust-lang/cargo#11647)
- docs(contrib): Remove out-of-date process step (rust-lang/cargo#11662)
- Do not error for `auth-required: true` without `-Z sparse-registry` (rust-lang/cargo#11661)
- Warn on commits to non-default branches. (rust-lang/cargo#11655)
- Avoid saving the same future_incompat warning multiple times (rust-lang/cargo#11648)
- Mention current default value in `publish.timeout` docs (rust-lang/cargo#11652)
- Make cargo aware of dwp files. (rust-lang/cargo#11572)
- Reduce target info rustc query calls (rust-lang/cargo#11633)
- Bump to 0.70.0; update changelog (rust-lang/cargo#11640)
- Enable sparse protocol in CI (rust-lang/cargo#11632)
- Fix split-debuginfo support detection (rust-lang/cargo#11347)
- refactor(toml): Move `TomlWorkspaceDependency` out of `TomlDependency` (rust-lang/cargo#11565)
- book: describe how the current resolver sometimes duplicates deps (rust-lang/cargo#11604)
- `cargo add` check `[dependencies]` order without considering the dotted item (rust-lang/cargo#11612)
- Link CoC to  www.rust-lang.org/conduct.html (rust-lang/cargo#11622)
- Add more labels to triagebot (rust-lang/cargo#11621)

16 months agoimprove panic message for slice windows and chunks
Lukas Markeffsky [Sun, 29 Jan 2023 13:33:57 +0000 (14:33 +0100)]
improve panic message for slice windows and chunks

16 months agoRollup merge of #107535 - dcompoze:tcp-doc-unwrap, r=cuviper
Guillaume Gomez [Tue, 31 Jan 2023 22:38:55 +0000 (23:38 +0100)]
Rollup merge of #107535 - dcompoze:tcp-doc-unwrap, r=cuviper

Replace unwrap with ? in TcpListener doc

The example in TcpListener doc returns `std::io::Result<()>` but the code inside the function uses `unwrap()` instead of `?`.

16 months agoRollup merge of #107527 - notriddle:notriddle/wcagcontrast, r=GuillaumeGomez
Guillaume Gomez [Tue, 31 Jan 2023 22:38:54 +0000 (23:38 +0100)]
Rollup merge of #107527 - notriddle:notriddle/wcagcontrast, r=GuillaumeGomez

rustdoc: stop making unstable items transparent

Fixes #93393

16 months agoRollup merge of #107525 - RalfJung:pointee-info, r=eddyb
Guillaume Gomez [Tue, 31 Jan 2023 22:38:54 +0000 (23:38 +0100)]
Rollup merge of #107525 - RalfJung:pointee-info, r=eddyb

PointeeInfo is advisory only

https://github.com/rust-lang/rust/pull/107248 fixed PointeeInfo being used in ways that don't actually work. Hopefully this comments helps avoid such issues in the future.

Cc ``@eddyb``

16 months agoRollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obk
Guillaume Gomez [Tue, 31 Jan 2023 22:38:53 +0000 (23:38 +0100)]
Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obk

`Edition` micro refactor

r? ``@oli-obk``

16 months agoRollup merge of #107491 - notriddle:notriddle/setting-check, r=GuillaumeGomez
Guillaume Gomez [Tue, 31 Jan 2023 22:38:53 +0000 (23:38 +0100)]
Rollup merge of #107491 - notriddle:notriddle/setting-check, r=GuillaumeGomez

rustdoc: remove unused CSS from `.setting-check`

These rules were needed for the mobile-style switches, but those were removed in 0f3ae6218ef1d9e9b14bf983b463785b14abc205

16 months agoRollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk
Guillaume Gomez [Tue, 31 Jan 2023 22:38:52 +0000 (23:38 +0100)]
Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk

Track bound types like bound regions

When we instantiate bound types into placeholder types, we throw away the names for some reason. These names are particularly useful for error reporting once we have `for<T>` binders.

r? types

16 months agoRollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk
Guillaume Gomez [Tue, 31 Jan 2023 22:38:52 +0000 (23:38 +0100)]
Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk

Improve enum checks

Some light refactoring.

16 months agoRollup merge of #107412 - tshepang:needless-check, r=wesleywiser
Guillaume Gomez [Tue, 31 Jan 2023 22:38:51 +0000 (23:38 +0100)]
Rollup merge of #107412 - tshepang:needless-check, r=wesleywiser

avoid needless checks

16 months agoRollup merge of #107354 - tspiteri:source-serif-4.005, r=GuillaumeGomez
Guillaume Gomez [Tue, 31 Jan 2023 22:38:50 +0000 (23:38 +0100)]
Rollup merge of #107354 - tspiteri:source-serif-4.005, r=GuillaumeGomez

rustdoc: update Source Serif 4 from 4.004 to 4.005

[Version 4.005](https://github.com/adobe-fonts/source-serif/releases/tag/4.005R) was released on 2023-01-20.

16 months agoRollup merge of #107348 - lcnr:project-solve-new, r=compiler-errors
Guillaume Gomez [Tue, 31 Jan 2023 22:38:50 +0000 (23:38 +0100)]
Rollup merge of #107348 - lcnr:project-solve-new, r=compiler-errors

small refactor to new projection code

extract `eq_term_and_make_canonical_response` into a helper function which also is another guarantee that the expected term does not influence candidate selection for projections.

also change `evaluate_all(vec![single_goal])` to use `evaluate_goal`.

the second commit now also adds a `debug_assert!` to `evaluate_goal`.

16 months agoRollup merge of #107331 - GuillaumeGomez:cleanup-js, r=notriddle
Guillaume Gomez [Tue, 31 Jan 2023 22:38:49 +0000 (23:38 +0100)]
Rollup merge of #107331 - GuillaumeGomez:cleanup-js, r=notriddle

Clean up eslint annotations and remove unused JS function

Thanks to https://github.com/rust-lang/rust/pull/107177 I realized that some eslint annotations might be unneeded so I cleaned them up. I also removed the unused function while we wait for https://github.com/rust-lang/rust/pull/107177 to be updated.

r? ``@notriddle``

16 months agoRollup merge of #106898 - estebank:ice-forms-are-a-headache, r=Mark-Simulacrum
Guillaume Gomez [Tue, 31 Jan 2023 22:38:49 +0000 (23:38 +0100)]
Rollup merge of #106898 - estebank:ice-forms-are-a-headache, r=Mark-Simulacrum

Include both md and yaml ICE ticket templates

* Existing compilers link to the md version
* The YAML version field for the backtrace *doesn't let us paste a full backtrace*
* We will need the YAML version in order to be able to submit reports once we start storing the backtrace to disk

Follow up to #106831. Reaction to #106874, which made me realize that *really* long backtraces are rejected by GitHub Forms. A single backtrace won't hit this, but ICEs sometimes compound.

16 months agoAuto merge of #102513 - RalfJung:no-more-unaligned-reference, r=cjgillot,scottmcm
bors [Tue, 31 Jan 2023 22:34:26 +0000 (22:34 +0000)]
Auto merge of #102513 - RalfJung:no-more-unaligned-reference, r=cjgillot,scottmcm

make unaligned_reference a hard error

The `unaligned_references` lint has been warn-by-default since Rust 1.53 (https://github.com/rust-lang/rust/pull/82525) and deny-by-default with mention in cargo future-incompat reports since Rust 1.62 (https://github.com/rust-lang/rust/pull/95372). Current nightly will become Rust 1.66, so (unless major surprises show up with crater) I think it is time we make this a hard error, and close this old soundness gap in the language.

EDIT: Turns out this will only land for Rust 1.67, so there is another 6 weeks of time here for crates to adjust.

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

16 months agoplacate tidy.
Felix S. Klock II [Tue, 31 Jan 2023 22:08:17 +0000 (17:08 -0500)]
placate tidy.

16 months agoReplace unwrap with ? in TcpListener doc
Daniel Chmielewski [Tue, 31 Jan 2023 21:04:49 +0000 (21:04 +0000)]
Replace unwrap with ? in TcpListener doc

16 months agoExtend `-Z print-type-sizes` to distinguish generator upvars and locals from "normal...
Felix S. Klock II [Tue, 31 Jan 2023 20:59:29 +0000 (15:59 -0500)]
Extend `-Z print-type-sizes` to distinguish generator upvars and locals from "normal" ADT fields.

16 months agomake unaligned_reference a hard error
Ralf Jung [Fri, 30 Sep 2022 12:54:30 +0000 (14:54 +0200)]
make unaligned_reference a hard error

16 months agoAuto merge of #107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
bors [Tue, 31 Jan 2023 19:24:29 +0000 (19:24 +0000)]
Auto merge of #107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini

Bump bootstrap compiler to 1.68

This also changes our stage0.json to include the rustc component for the rustfmt pinned nightly toolchain, which is currently necessary due to rustfmt dynamically linking to that toolchain's librustc_driver and libstd.

r? `@pietroalbini`

16 months agorustdoc: stop making unstable items transparent
Michael Howell [Tue, 31 Jan 2023 18:27:09 +0000 (11:27 -0700)]
rustdoc: stop making unstable items transparent

Fixes #93393

16 months agoPointeeInfo is advisory only
Ralf Jung [Tue, 31 Jan 2023 17:49:03 +0000 (18:49 +0100)]
PointeeInfo is advisory only

16 months agoassert that `should_fix_bins_and_dylibs` has been run
KaDiWa [Mon, 30 Jan 2023 16:30:39 +0000 (17:30 +0100)]
assert that `should_fix_bins_and_dylibs` has been run

16 months agoDownload rustc component for rustfmt toolchain as well
Mark Rousskov [Wed, 25 Jan 2023 23:48:07 +0000 (18:48 -0500)]
Download rustc component for rustfmt toolchain as well

16 months agoAuto merge of #106399 - estebank:type-err-span-label, r=nagisa
bors [Tue, 31 Jan 2023 13:53:40 +0000 (13:53 +0000)]
Auto merge of #106399 - estebank:type-err-span-label, r=nagisa

Modify primary span label for E0308

Looking at the reactions to https://hachyderm.io/`@ekuber/109622160673605438,` a lot of people seem to have trouble understanding the current output, where the primary span label on type errors talks about the specific types that diverged, but these can be deeply nested type parameters. Because of that we could see "expected i32, found u32" in the label while the note said "expected Vec<i32>, found Vec<u32>". This understandably confuses people. I believe that once people learn to read these errors it starts to make more sense, but this PR changes the output to be more in line with what people might expect, without sacrificing terseness.

Fix #68220.

16 months agoClean up eslint annotations and remove unused JS function
Guillaume Gomez [Thu, 26 Jan 2023 17:03:37 +0000 (18:03 +0100)]
Clean up eslint annotations and remove unused JS function

16 months agoAuto merge of #100754 - davidtwco:translation-incremental, r=compiler-errors
bors [Tue, 31 Jan 2023 10:20:58 +0000 (10:20 +0000)]
Auto merge of #100754 - davidtwco:translation-incremental, r=compiler-errors

incremental: migrate diagnostics

- Apply the diagnostic migration lints to more functions on `Session`, namely: `span_warn`, `span_warn_with_code`, `warn` `note_without_error`, `span_note_without_error`, `struct_note_without_error`.
- Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path` and `std::path::PathBuf`.
- Migrate the `rustc_incremental` crate's diagnostics to translatable diagnostic structs.

r? `@compiler-errors`
cc #100717

16 months agoDon't accept `Edition` by ref
Maybe Waffle [Tue, 31 Jan 2023 10:07:29 +0000 (10:07 +0000)]
Don't accept `Edition` by ref

16 months agoDon't do `.edition().rust_*()`
Maybe Waffle [Tue, 31 Jan 2023 09:56:50 +0000 (09:56 +0000)]
Don't do `.edition().rust_*()`

16 months agoDocument `rust_2015` methods
Maybe Waffle [Tue, 31 Jan 2023 09:52:54 +0000 (09:52 +0000)]
Document `rust_2015` methods

16 months agoUse `Edition` methods a bit more
Maybe Waffle [Tue, 31 Jan 2023 09:50:56 +0000 (09:50 +0000)]
Use `Edition` methods a bit more

16 months agoReview changes
Maybe Waffle [Tue, 31 Jan 2023 07:44:34 +0000 (07:44 +0000)]
Review changes

16 months agoAuto merge of #107498 - JohnTitor:rollup-2i6g4uk, r=JohnTitor
bors [Tue, 31 Jan 2023 06:25:30 +0000 (06:25 +0000)]
Auto merge of #107498 - JohnTitor:rollup-2i6g4uk, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #107245 (Implement unsizing in the new trait solver)
 - #107445 (Remove `GenFuture` from core)
 - #107473 (Update books)
 - #107476 (rustdoc: remove unnecessary wrapper `div.item-decl` from HTML)
 - #107477 (Migrate last part of CSS themes to CSS variables)
 - #107479 (Use `ObligationCtxt::new_in_snapshot` in `satisfied_from_param_env`)
 - #107482 (rustdoc: remove meta keywords from HTML)
 - #107494 (fix link in std::path::Path::display())

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

16 months agoDo not depend on Generator trait when deducing closure signature
Michael Goulet [Tue, 31 Jan 2023 02:59:36 +0000 (02:59 +0000)]
Do not depend on Generator trait when deducing closure signature

16 months agoRollup merge of #107494 - lebensterben:patch-1, r=JohnTitor
Yuki Okushi [Tue, 31 Jan 2023 02:46:26 +0000 (11:46 +0900)]
Rollup merge of #107494 - lebensterben:patch-1, r=JohnTitor

fix link in std::path::Path::display()

The link `Debug` points to should be the trait `Debug`, not the macro `Debug`.

16 months agoRollup merge of #107482 - notriddle:notriddle/keywords, r=jsha
Yuki Okushi [Tue, 31 Jan 2023 02:46:26 +0000 (11:46 +0900)]
Rollup merge of #107482 - notriddle:notriddle/keywords, r=jsha

rustdoc: remove meta keywords from HTML

Discussed in <https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60.3Cmeta.20name.3D.22keywords.22.3E.60>

16 months agoRollup merge of #107479 - compiler-errors:probe-can-call-ocx, r=BoxyUwU
Yuki Okushi [Tue, 31 Jan 2023 02:46:25 +0000 (11:46 +0900)]
Rollup merge of #107479 - compiler-errors:probe-can-call-ocx, r=BoxyUwU

Use `ObligationCtxt::new_in_snapshot` in `satisfied_from_param_env`

We can evaluate nested `ConstEvaluatable` obligations in an evaluation probe, which will ICE if we use `ObligationCtxt::new`.

Fixes #107474
Fixes #106666

r? `@BoxyUwU` but feel free to reassign
cc `@JulianKnodt` who i think added this assertion code

Not sure if the rustdoc test is needed, but can't hurt. They're the same root cause, though.

16 months agoRollup merge of #107477 - GuillaumeGomez:css-var, r=notriddle
Yuki Okushi [Tue, 31 Jan 2023 02:46:25 +0000 (11:46 +0900)]
Rollup merge of #107477 - GuillaumeGomez:css-var, r=notriddle

Migrate last part of CSS themes to CSS variables

No changes in the output. This is already tested in `tests/rustdoc-gui/search-tab.goml` so no need to add a GUI test.

r? `@notriddle`

16 months agoRollup merge of #107476 - notriddle:notriddle/item-decl-3, r=GuillaumeGomez
Yuki Okushi [Tue, 31 Jan 2023 02:46:24 +0000 (11:46 +0900)]
Rollup merge of #107476 - notriddle:notriddle/item-decl-3, r=GuillaumeGomez

rustdoc: remove unnecessary wrapper `div.item-decl` from HTML

16 months agoRollup merge of #107473 - rustbot:docs-update, r=ehuss
Yuki Okushi [Tue, 31 Jan 2023 02:46:24 +0000 (11:46 +0900)]
Rollup merge of #107473 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/book

2 commits in 2cd1b5593d26dc6a03c20f8619187ad4b2485552..f2a78f64b668f63f581203c6bac509903f7c00ee
2023-01-23 18:19:32 UTC to 2023-01-23 15:15:22 UTC

- Change CamelCase to UpperCamelCase
- Fix broken link to the No Starch Press version (rust-lang/book#3513)

## rust-embedded/book

3 commits in 19f798d448835a4888e3b3eae7fe69f1d61d8681..f1a4614aa41cc544b91b79760a709e113f3451d7
2023-01-26 15:21:58 UTC to 2023-01-18 07:51:06 UTC

- Fix typo in the registers.md (rust-embedded/book#343)
- Macports install instructions (rust-embedded/book#342)
- remove extern crate statements (rust-embedded/book#340)

## rust-lang/nomicon

2 commits in 960d610e7f33889a2577f5f17c26f0d5c82b30df..bd1829d235296952bf72ca55635e360584b8805e
2023-01-18 03:14:58 UTC to 2023-01-17 20:05:07 UTC

- Copyedits to FFI and unwinding section (rust-lang/nomicon#396)
- Fix typo in dropck documentation (rust-lang/nomicon#397)

## rust-lang/reference

2 commits in 2cb0ed9ba56360949f492f9866afe8c293f9f9da..22882fb3f7b4d69fdc0d1731e8b9cfcb6910537d
2023-01-23 13:21:28 UTC to 2023-01-20 18:38:44 UTC

- Fix typo “assigment” (…and more) (rust-lang/reference#1322)
- Syntax correction for trait-bounds.md (rust-lang/reference#1319)

## rust-lang/rust-by-example

1 commits in a9fb7d13eadfcc5f457962731f105b97f9a7474a..134376872e8c387ef369507e0ee9b5a0e3272718
2023-01-25 11:56:37 UTC to 2023-01-25 11:56:37 UTC

- update std_misc/file/create.md: fixed grammar (rust-lang/rust-by-example#1668)

## rust-lang/rustc-dev-guide

12 commits in 7352353ae91c48b136d2ca7d03822e1448165e1e..e359ee27fc3da3356d71a732128c0a1abe02e53a
2023-01-30 15:08:16 UTC to 2023-01-17 12:44:19 UTC

- New infcx usage (rust-lang/rustc-dev-guide#1571)
- Create a chapter for AST validation (rust-lang/rustc-dev-guide#1524)
- Use ephemeral PAT for linkcheck (rust-lang/rustc-dev-guide#1569)
- add section for the new trait solver (rust-lang/rustc-dev-guide#1551)
- version 5 is now not supported (rust-lang/rustc-dev-guide#1568)
- there are still no locale bundles (rust-lang/rustc-dev-guide#1567)
- bumpt date-check examples to current month (rust-lang/rustc-dev-guide#1566)
- Update hir.md (rust-lang/rustc-dev-guide#1565)
- rustc_typeck exists no more (rust-lang/rustc-dev-guide#1559)
- Correct tests misplacement (rust-lang/rustc-dev-guide#1564)
- Update resolution.md (rust-lang/rustc-dev-guide#1561)
- Update asm.md  (rust-lang/rustc-dev-guide#1560)

16 months agoRollup merge of #107445 - Swatinem:rm-genfuture, r=cuviper
Yuki Okushi [Tue, 31 Jan 2023 02:46:23 +0000 (11:46 +0900)]
Rollup merge of #107445 - Swatinem:rm-genfuture, r=cuviper

Remove `GenFuture` from core

The handling of async constructs in the compiler does not rely on `GenFuture` anymore since `1.67`, so this code can now be removed from `core`.

16 months agoRollup merge of #107245 - compiler-errors:new-solver-unsizing, r=lcnr
Yuki Okushi [Tue, 31 Jan 2023 02:46:22 +0000 (11:46 +0900)]
Rollup merge of #107245 - compiler-errors:new-solver-unsizing, r=lcnr

Implement unsizing in the new trait solver

This makes hello world compile! Ignore the first commit, that's just #107146 which is waiting on merge.

I'll leave some comments inline about design choices that might be debatable.

r? `@lcnr` (until we have a new trait solver reviewer group...)

16 months agoAuto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
bors [Tue, 31 Jan 2023 02:46:11 +0000 (02:46 +0000)]
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors

Test drop_tracking_mir before querying generator.

r? `@ghost`

16 months agofix link in std::path::Path::display()
Lucius Hu [Tue, 31 Jan 2023 00:20:27 +0000 (00:20 +0000)]
fix link in std::path::Path::display()

The link `Debug` points to should be the trait `Debug`, not the macro `Debug`.

16 months agoAuto merge of #105650 - cassaundra:float-literal-suggestion, r=pnkfelix
bors [Tue, 31 Jan 2023 00:03:08 +0000 (00:03 +0000)]
Auto merge of #105650 - cassaundra:float-literal-suggestion, r=pnkfelix

Fix invalid float literal suggestions when recovering an integer

Only suggest adding a zero to integers with a preceding dot when the change will result in a valid floating point literal.

For example, `.0x0` should not be turned into `0.0x0`.

r? nnethercote

16 months agorustdoc: remove unused CSS from `.setting-check`
Michael Howell [Mon, 30 Jan 2023 23:36:57 +0000 (16:36 -0700)]
rustdoc: remove unused CSS from `.setting-check`

These rules were needed for the mobile-style switches, but those
were removed in 0f3ae6218ef1d9e9b14bf983b463785b14abc205

16 months agoTrack bound types like bound regions
Michael Goulet [Tue, 17 Jan 2023 03:27:48 +0000 (03:27 +0000)]
Track bound types like bound regions

16 months agoMake the "extra if in let...else block" hint a suggestion
Edward Shen [Mon, 30 Jan 2023 22:09:40 +0000 (14:09 -0800)]
Make the "extra if in let...else block" hint a suggestion

16 months agoFix unquoted projection types in label
Esteban Küber [Mon, 30 Jan 2023 22:02:30 +0000 (22:02 +0000)]
Fix unquoted projection types in label

16 months agoMake structured suggestion for fn casting verbose
Esteban Küber [Mon, 30 Jan 2023 21:55:25 +0000 (21:55 +0000)]
Make structured suggestion for fn casting verbose

16 months agoTweak E0271 wording
Esteban Küber [Fri, 6 Jan 2023 20:28:46 +0000 (20:28 +0000)]
Tweak E0271 wording

16 months agoMention fn coercion rules (needs to be expanded)
Esteban Küber [Fri, 6 Jan 2023 20:15:10 +0000 (20:15 +0000)]
Mention fn coercion rules (needs to be expanded)

16 months agoFix invalid float literal suggestions when recovering an integer
Cassaundra Smith [Mon, 30 Jan 2023 21:39:25 +0000 (13:39 -0800)]
Fix invalid float literal suggestions when recovering an integer

Only suggest adding a zero to integers with a preceding dot when the change will
result in a valid floating point literal.

For example, `.0x0` should not be turned into `0.0x0`.

16 months agoTweak use of trimmed paths
Esteban Küber [Fri, 6 Jan 2023 19:21:47 +0000 (19:21 +0000)]
Tweak use of trimmed paths

16 months agoHide lifetimes of `impl Trait` in force trimmed paths
Esteban Küber [Fri, 6 Jan 2023 01:22:24 +0000 (01:22 +0000)]
Hide lifetimes of `impl Trait` in force trimmed paths

16 months agoDo not mention lifetime names in force trimmed paths
Esteban Küber [Fri, 6 Jan 2023 01:11:50 +0000 (01:11 +0000)]
Do not mention lifetime names in force trimmed paths

16 months agoDon't show `for<'lt>` in force trimmed paths
Esteban Küber [Fri, 6 Jan 2023 01:03:52 +0000 (01:03 +0000)]
Don't show `for<'lt>` in force trimmed paths