Commit Graph

206302 Commits

Author SHA1 Message Date
Ralf Jung
5ca1f85a2d make some names more consistent 2022-09-20 08:37:20 +02:00
Ralf Jung
cc149c7691 put a tcx into the Machine so that we have to pass around fewer things 2022-09-20 08:37:20 +02:00
Ralf Jung
3cb27f584b avoid thread-local var indirection for non-halting diagnostics 2022-09-20 08:37:20 +02:00
Scott McMurray
6dbd9a29c2 Optimize array::IntoIter
`.into_iter()` on arrays was slower than it needed to be (especially compared to slice iterator) since it uses `Range<usize>`, which needs to handle degenerate ranges like `10..4`.

This PR adds an internal `IndexRange` type that's like `Range<usize>` but with a safety invariant that means it doesn't need to worry about those cases -- it only handles `start <= end` -- and thus can give LLVM more information to optimize better.

I added one simple demonstration of the improvement as a codegen test.
2022-09-19 23:24:34 -07:00
Joshua Nelson
690c467799 Make the normalize-overflow rustdoc test actually do something
Since https://github.com/rust-lang/rust/pull/88679, rustdoc doesn't load crates eagerly.
Add an explicit `extern crate` item to make sure the crate is loaded and the bug reproduces.
You can verify this fix by adding `// compile-flags: -Znormalizing-docs` and running the test.
2022-09-19 22:49:37 -05:00
Tuna
790d9d4dd0
Update src/bootstrap/config.rs
Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-09-20 06:39:05 +03:00
Tuna
e248523d2a
Update src/bootstrap/config.rs
Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
2022-09-20 06:29:34 +03:00
Joshua Nelson
1512ce5925 Make cycle errors recoverable
In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation.

In the past, `@jackh726` has said we need to be careful about overflow errors:

> Off the top of my head, we definitely should be careful about treating overflow errors the same as
"not implemented for some reason" errors. Otherwise, you could end up with behavior that is
different depending on recursion depth. But, that might be context-dependent.

But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.
2022-09-19 22:14:40 -05:00
Joshua Nelson
749dec6451 Make OUT an associated type instead of a generic parameter
This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter.
2022-09-19 22:14:39 -05:00
Joshua Nelson
5922d6cf60 slightly cleanup building SelectionContext 2022-09-19 22:14:39 -05:00
Michael Howell
17259c3995 Remove useless color assertions on 0px borders 2022-09-19 20:14:09 -07:00
Michael Howell
78d8ce3faa rustdoc: remove no-op CSS h1-6 { border-bottom-color }
For this rule to have an actual effect, the border-bottom width needs
specified, elsewhere, without also specifying the color. This doesn't
happen. Ever since 88b137d5fe, every spot
where headers get a border assigned to them also assigns the color.
2022-09-19 20:14:09 -07:00
bors
acb8934fd5 Auto merge of #102022 - matthiaskrgr:rollup-emwfjd1, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #101389 (Tone down explanation on RefCell::get_mut)
 - #101798 (Make `from_waker`, `waker` and `from_raw` unstably `const`)
 - #101881 (Remove an unused struct field `late_bound`)
 - #101904 (Add help for invalid inline argument)
 - #101966 (Add unit test for identifier Unicode emoji diagnostics)
 - #101979 (Update release notes for 1.64)
 - #101985 (interpret: expose generate_stacktrace without full InterpCx)
 - #102004 (Try to clarify what's new in 1.64.0 ffi types)
 - #102005 (rustdoc: remove unused CSS `td.summary-column`)
 - #102017 (Add all submodules to the list of directories tidy skips)
 - #102019 (Remove backed off PRs from relnotes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-20 02:20:15 +00:00
Patiga
04c108711e Remove use of io::ErrorKind::Other in std
The documentation states that this `ErrorKind` is not used by the
standard library. Instead, `io::ErrorKind::Uncategorized` should be
used.
2022-09-20 02:56:23 +02:00
bors
a57a6ac2eb Auto merge of #101909 - weihanglo:update-cargo, r=ehuss
Update cargo (CVE fixes included)

8 commits in 082503982ea0fb7a8fd72210427d43a2e2128a63..73ba3f35e0205844418260722c11602113179c4a
2022-09-13 17:49:38 +0000 to 2022-09-18 06:38:16 +0000

- Revert "Clarify when cargo detects changes" (https://github.com/rust-lang/cargo/pull/11107)
- Fix links to workspace inheritance headings in workspace docs (https://github.com/rust-lang/cargo/pull/11103)
- docs(ref): Clarify workspace settings (https://github.com/rust-lang/cargo/pull/11082)
- Update comment about ResolveVersion default version (https://github.com/rust-lang/cargo/pull/11095)
- [master] Run `reach_max_unpack_size` test only on debug build (https://github.com/rust-lang/cargo/pull/11091)
- Clarify when cargo detects changes (https://github.com/rust-lang/cargo/pull/11092)
- [master] Fix for https://github.com/advisories/GHSA-rfj2-q3h3-hm5j and https://github.com/advisories/GHSA-2hvr-h6gw-qrxp (https://github.com/rust-lang/cargo/pull/11089)
- Expose cargo add internals as edit API (https://github.com/rust-lang/cargo/pull/11059)
2022-09-19 23:18:12 +00:00
bors
4b9463c5b7 Auto merge of #2551 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/101867
2022-09-19 21:54:47 +00:00
Andrew Pollack
3a4dc61303 Adding ignore fuchsia tests for Backtrace, ErrorKind cases 2022-09-19 21:54:13 +00:00
Andrew Pollack
74e3d99036 Adding needs-unwind to nicer-assert-messages compiler ui tests 2022-09-19 21:43:21 +00:00
joboet
be09a4a8b2
std: use sync::RwLock for internal statics 2022-09-19 23:27:26 +02:00
Ralf Jung
855a2ad285 give macOS more time 2022-09-19 22:57:26 +02:00
Michael Howell
8e6cf7d840 rustdoc: update test cases for changed item-decl HTML 2022-09-19 13:39:31 -07:00
est31
b8d2f5cde5 Don't crate-locally reexport walk functions in tidy 2022-09-19 22:33:09 +02:00
Ralf Jung
f0c6f0d1bf rustup 2022-09-19 22:32:36 +02:00
Josh Stone
00bb9fc2be Rename LLVM optimize functions 2022-09-19 11:10:12 -07:00
Michael Howell
9457380ac9 rustdoc: remove docblock class from item-decl
This class was originally added in 73b97c7e7c
to support hiding and showing the item, because `main.js` went through all
`docblock` elements in the DOM and added toggles to them.

73b97c7e7c/src/librustdoc/html/static/main.js (L1856-L1867)

The `item-decl` is no longer auto-hidden since
c96f86de30 removed it.

`item-decl` used to be called `type-decl`: that name was changed in
8b7a2dd462.

The `docblock` class is no longer used for implementing toggles, since
rustdoc switched to using `<details>` elements.
2022-09-19 10:52:51 -07:00
bors
2019147c56 Auto merge of #101894 - dingxiangfei2009:let-else-avoid-duplicate-storage-live, r=oli-obk
Avoid duplicating StorageLive in let-else

cc `@est31`

Fix #101867
Fix #101932

#101410 introduced directives to activate storages of bindings in let-else earlier. However, since it is using the machinery of `match` and friends for pattern matching and binding, those storages are activated for the second time. This PR adjusts this behavior and avoid the duplicated activation for let-else statements.
2022-09-19 17:27:30 +00:00
Matthias Krüger
683cf99f1d
Rollup merge of #102019 - pietroalbini:pa-relnotes-revert, r=pietroalbini
Remove backed off PRs from relnotes

Backport of 7358a9b03e to master.
2022-09-19 17:55:24 +02:00
Matthias Krüger
ade6505976
Rollup merge of #102017 - est31:rustc_dev_guide_tidy_skip, r=Mark-Simulacrum
Add all submodules to the list of directories tidy skips

Tidy contains a blacklist of directories that it is not visiting. This list is also used by the `replace-version-placeholder` tool added by #100591 , to determine the directories to do its replacement from. Generally, tidy does not check submodules, but this is not done consistently for all submodules. This PR adds the submodules that were previously missing, so that the `replace-version-placeholder` tool does not attempt to change content of the books. This was needed because `rustc-dev-guide` contains the placeholder, leading to #102014.

Fixes #102014
2022-09-19 17:55:24 +02:00
Matthias Krüger
548c3eaa24
Rollup merge of #102005 - notriddle:notriddle/td-summary-column, r=Dylan-DPC
rustdoc: remove unused CSS `td.summary-column`

It was added in 2a1bad70dd to go with this module summary function:

2a1bad70dd/src/librustdoc/html/format.rs (L767-L780)

The corresponding HTML was removed in 0a46933c4d.
2022-09-19 17:55:23 +02:00
Matthias Krüger
1e1baabe77
Rollup merge of #102004 - cuviper:relnotes-1.64.0-ffi, r=pietroalbini
Try to clarify what's new in 1.64.0 ffi types
2022-09-19 17:55:22 +02:00
Matthias Krüger
8c0f8a285f
Rollup merge of #101985 - RalfJung:generate_stacktrace, r=oli-obk
interpret: expose generate_stacktrace without full InterpCx

In Miri we sometimes want to emit diagnostics without having a full `&InterpCx` available. To avoid duplicating code, this adds a way to get a stacktrace from an arbitrary slice of interpreter frames, that Miri can use with access to just a thread manager.
2022-09-19 17:55:21 +02:00
Matthias Krüger
33a224297d
Rollup merge of #101979 - rust-lang:pa-update-relnotes, r=Mark-Simulacrum
Update release notes for 1.64

This PR makes a few updates to the release notes to bring them on-par with the release notes of other releases:

* The wording on some items has been changed to be more consistent and better describe what each change means, rather than using the PR title.
* Items that were also in the compatibility notes have been removed from the other sections, only keeping them in the compat notes.
* Diagnostics and ICE fixes have been removed from the notes.
* The cargo section has been made more consistent.

r? ``@Mark-Simulacrum``
cc ``@rust-lang/release`` ``@joshtriplett``
2022-09-19 17:55:21 +02:00
Matthias Krüger
fdf3c0fc44
Rollup merge of #101966 - crlf0710:emoji_unittest, r=Mark-Simulacrum
Add unit test for identifier Unicode emoji diagnostics

Seems current diagnostics has some support for emoji usages, however it seems outdated and incomplete. This adds a simple unit test to showcase the status quo.
2022-09-19 17:55:20 +02:00
Matthias Krüger
9f073b0de0
Rollup merge of #101904 - Rageking8:fix-101712, r=oli-obk
Add help for invalid inline argument

Fixes #101712

Removed 1 part of the test as its identical with another one. Do let me know if this is undesirable, so I can revert those changes.
2022-09-19 17:55:20 +02:00
Matthias Krüger
7697a244cc
Rollup merge of #101881 - TaKO8Ki:remove-unused-struct-field, r=sanxiyn
Remove an unused struct field `late_bound`
2022-09-19 17:55:19 +02:00
Matthias Krüger
ea076a4f9f
Rollup merge of #101798 - y86-dev:const_waker, r=lcnr
Make `from_waker`, `waker` and `from_raw` unstably `const`

Make
- `Context::from_waker`
- `Context::waker`
- `Waker::from_raw`

`const`.

Also added a small test.
2022-09-19 17:55:19 +02:00
Matthias Krüger
27b1b04065
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
Tone down explanation on RefCell::get_mut

The language around `RefCell::get_mut` is remarkably sketchy and especially to the novice seems to quite strongly discourage using the method ("be cautious", "Also, please be aware", "special circumstances", "usually not what you want"). It was added six years ago in #40634 due to confusion about when to use `get_mut` and `borrow_mut`.

While its signature limits the use-cases for `get_mut`, there is no chance for a safety footgun, and readers can be made aware of `borrow_mut` more softly. I've also just sent a [PR](https://github.com/rust-lang/rust-clippy/issues/9044) to lint situations where `get_mut` could be used to improve ergonomics and performance.

So this PR tones down the language around `get_mut` and also brings it more in line with [`std::sync::Mutex::get_mut()`](https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.get_mut).
2022-09-19 17:55:18 +02:00
Oli Scherer
1905f8c441 Document projection condition 2022-09-19 15:33:36 +00:00
mejrs
c65866000e Incorporate feedback 2022-09-19 17:19:45 +02:00
lcnr
c54c5a3c77 DestructuredConst split mir and ty 2022-09-19 17:00:38 +02:00
bors
0def954aab Auto merge of #2547 - RalfJung:fake-apis, r=saethlin
note on deterministic 'fake' API implementations

Now that we also have fake clocks, it seems prudent to warn about this at the top of the readme.

r? `@rust-lang/miri`
2022-09-19 14:51:43 +00:00
bors
5c3c6a2de6 Auto merge of #9483 - c410-f3r:arith, r=Jarcho
[arithmetic-side-effects] Finish non-overflowing ops

Extends https://github.com/rust-lang/rust-clippy/pull/9474 to also take into consideration "raw" binary operations. For example, `let a = b / 2` and `let a = 1 * b` won't trigger the lint.

changelog: [arithmetic-side-effects] Finish non-overflowing ops
2022-09-19 14:35:14 +00:00
lcnr
526856768d ctfe, const_to_op only for mir constants 2022-09-19 16:17:33 +02:00
lcnr
638b612154 remove ty::Const::from_inline_const 2022-09-19 16:10:18 +02:00
lcnr
7207b4dc66 remove FnCtxt::to_const 2022-09-19 16:08:40 +02:00
Pietro Albini
d19079b067
remove backed off PR from relnotes 2022-09-19 15:29:13 +02:00
est31
cd3979dba1 Add all submodules to the list of directories tidy skips
I ran git config --file .gitmodules --name-only --get-regexp path
and added all submodules that were not already in the list to it.
2022-09-19 15:17:33 +02:00
lcnr
72a21027f5 add test 2022-09-19 15:13:34 +02:00
lcnr
71f8fd5c58 improve infer var handling for implied bounds 2022-09-19 15:13:34 +02:00
y86-dev
8e848dc23f Added tracking issue 2022-09-19 15:07:12 +02:00