Commit Graph

216310 Commits

Author SHA1 Message Date
Matthias Krüger
6390d25eab
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```
2023-02-01 05:54:39 +01:00
Matthias Krüger
b853b22270
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.
2023-02-01 05:54:38 +01:00
Matthias Krüger
1dbb5efff3
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
2023-02-01 05:54:38 +01:00
Matthias Krüger
0d2ab67742
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.
2023-02-01 05:54:37 +01:00
bors
ad8e1dc286 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
2023-02-01 01:15:02 +00:00
Lukas Markeffsky
2fbe9274aa improve panic message for slice windows and chunks 2023-01-31 23:49:42 +01:00
Guillaume Gomez
adc3f8a44b
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 `?`.
2023-01-31 23:38:55 +01:00
Guillaume Gomez
9e0bfe0fb0
Rollup merge of #107527 - notriddle:notriddle/wcagcontrast, r=GuillaumeGomez
rustdoc: stop making unstable items transparent

Fixes #93393
2023-01-31 23:38:54 +01:00
Guillaume Gomez
7e6fc82951
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``
2023-01-31 23:38:54 +01:00
Guillaume Gomez
fe44f3bdd0
Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obk
`Edition` micro refactor

r? ``@oli-obk``
2023-01-31 23:38:53 +01:00
Guillaume Gomez
f0e4a1c9cb
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 0f3ae6218e
2023-01-31 23:38:53 +01:00
Guillaume Gomez
d36bdf2d30
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
2023-01-31 23:38:52 +01:00
Guillaume Gomez
53bb6322db
Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk
Improve enum checks

Some light refactoring.
2023-01-31 23:38:52 +01:00
Guillaume Gomez
c6a104f3e4
Rollup merge of #107412 - tshepang:needless-check, r=wesleywiser
avoid needless checks
2023-01-31 23:38:51 +01:00
Guillaume Gomez
233b319a37
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.
2023-01-31 23:38:50 +01:00
Guillaume Gomez
d65f60d276
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`.
2023-01-31 23:38:50 +01:00
Guillaume Gomez
4755c7c60e
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``
2023-01-31 23:38:49 +01:00
Guillaume Gomez
b9b56762f3
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.
2023-01-31 23:38:49 +01:00
bors
5b6ed253c4 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.
2023-01-31 22:34:26 +00:00
Daniel Chmielewski
943f833314
Replace unwrap with ? in TcpListener doc 2023-01-31 21:04:49 +00:00
Ralf Jung
dfc4a7b2d0 make unaligned_reference a hard error 2023-01-31 20:28:11 +01:00
bors
dc1d9d50fb 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`
2023-01-31 19:24:29 +00:00
Michael Howell
f75b350467 rustdoc: stop making unstable items transparent
Fixes #93393
2023-01-31 11:27:09 -07:00
Ralf Jung
c8e8d6e7f6 PointeeInfo is advisory only 2023-01-31 18:49:03 +01:00
KaDiWa
043c634a9c
assert that should_fix_bins_and_dylibs has been run 2023-01-31 18:22:01 +01:00
Mark Rousskov
652f79e835 Download rustc component for rustfmt toolchain as well 2023-01-31 10:29:33 -05:00
bors
f361413cbf 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.
2023-01-31 13:53:40 +00:00
Guillaume Gomez
0a1f14a0e6 Clean up eslint annotations and remove unused JS function 2023-01-31 11:21:29 +01:00
bors
a64ef7d07d 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
2023-01-31 10:20:58 +00:00
Maybe Waffle
ef6b583a80 Don't accept Edition by ref 2023-01-31 10:09:23 +00:00
Maybe Waffle
03158f40d2 Don't do .edition().rust_*() 2023-01-31 10:09:23 +00:00
Maybe Waffle
5d90413d75 Document rust_2015 methods 2023-01-31 10:09:22 +00:00
Maybe Waffle
fd5774a4d7 Use Edition methods a bit more 2023-01-31 10:09:22 +00:00
Maybe Waffle
340414ed7b Review changes 2023-01-31 07:54:01 +00:00
bors
7c4a9a971c 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
2023-01-31 06:25:30 +00:00
Yuki Okushi
150340bafd
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`.
2023-01-31 11:46:26 +09:00
Yuki Okushi
e776a63956
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>
2023-01-31 11:46:26 +09:00
Yuki Okushi
f95f835470
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.
2023-01-31 11:46:25 +09:00
Yuki Okushi
fbcaf046cc
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`
2023-01-31 11:46:25 +09:00
Yuki Okushi
b10e60170c
Rollup merge of #107476 - notriddle:notriddle/item-decl-3, r=GuillaumeGomez
rustdoc: remove unnecessary wrapper `div.item-decl` from HTML
2023-01-31 11:46:24 +09:00
Yuki Okushi
401564d96d
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)
2023-01-31 11:46:24 +09:00
Yuki Okushi
39d2639f81
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`.
2023-01-31 11:46:23 +09:00
Yuki Okushi
6eeb981a58
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...)
2023-01-31 11:46:22 +09:00
bors
dc3e59cb3f Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
Test drop_tracking_mir before querying generator.

r? `@ghost`
2023-01-31 02:46:11 +00:00
Lucius Hu
3c408d82a3
fix link in std::path::Path::display()
The link `Debug` points to should be the trait `Debug`, not the macro `Debug`.
2023-01-31 00:20:27 +00:00
bors
487e83b711 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
2023-01-31 00:03:08 +00:00
Michael Howell
31c14f6c5d rustdoc: remove unused CSS from .setting-check
These rules were needed for the mobile-style switches, but those
were removed in 0f3ae6218e
2023-01-30 16:36:57 -07:00
Michael Goulet
0e98a162c8 Track bound types like bound regions 2023-01-30 22:18:20 +00:00
Edward Shen
e905b93706
Make the "extra if in let...else block" hint a suggestion 2023-01-30 14:09:40 -08:00
Esteban Küber
449dfc64f0 Fix unquoted projection types in label 2023-01-30 22:02:30 +00:00