Commit Graph

206044 Commits

Author SHA1 Message Date
Michael Howell 25f5483f58
Rollup merge of #102053 - lnicola:rust-analyzer-2022-09-20, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2022-09-20 10:13:03 -07:00
Michael Howell 3fac4bbdda
Rollup merge of #102038 - jyn514:rustdoc-normalize-test, r=compiler-errors
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: -Znormalize-docs` and running the test to make sure it gives an error.
2022-09-20 10:13:02 -07:00
Michael Howell 128733d742
Rollup merge of #102034 - notriddle:notriddle/border-bottom, r=GuillaumeGomez
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.

Preview: https://notriddle.com/notriddle-rustdoc-test/border-bottom/rustc_monomorphize/collector/index.html
2022-09-20 10:13:02 -07:00
Michael Howell 1b54ee38a3
Rollup merge of #102027 - notriddle:notriddle/docblock-item-decl, r=GuillaumeGomez
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.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
2022-09-20 10:13:01 -07:00
Michael Howell b149c48186
Rollup merge of #102021 - lcnr:tyConst-fun, r=b-naber,BoxyUwU
some post-valtree cleanup

r? project-const-generics cc ```@b-naber```
2022-09-20 10:13:01 -07:00
Michael Howell 08b369a501
Rollup merge of #102013 - spastorino:rpitit-lower-fn-decl, r=compiler-errors
Simplify rpitit handling on lower_fn_decl

r? `````@compiler-errors`````
2022-09-20 10:13:00 -07:00
Michael Howell 09221722af
Rollup merge of #102008 - GuillaumeGomez:notable-trait-gui-test, r=notriddle
Add GUI test for notable traits element position

Fixes #101891.

r? ````@notriddle````
2022-09-20 10:12:59 -07:00
Michael Howell 2c57a5b166
Rollup merge of #102001 - cuviper:build-atomic-capi, r=nikic
Use LLVM C-API to build atomic cmpxchg and fence

We don't need C++ wrappers because the LLVM C API can build these.
2022-09-20 10:12:59 -07:00
Michael Howell 0d2e57cb04
Rollup merge of #101976 - RalfJung:mir-semantic-phases, r=oli-obk
MirPhase: clarify that linting is not a semantic change

r? ```@JakobDegen```
2022-09-20 10:12:58 -07:00
Michael Howell 2c893737a6
Rollup merge of #101958 - hanar3:101666/enhance-error-message, r=oli-obk
Improve error for when query is unsupported by crate

This is an improvement to the error message mentioned on #101666.  It seems like a good idea to also add [this link to the rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/query.html), if explaining the query system in detail is a concern here, but I'm unsure if there is any restrictions on adding links to error messages.
2022-09-20 10:12:58 -07:00
Michael Howell 3f377d3f96
Rollup merge of #101014 - isikkema:fix-zmeta-stats-file-encoder-no-read-perms, r=isikkema
Fix -Zmeta-stats ICE by giving `FileEncoder` file read permissions

Fixes #101001

As far as I can tell, #101001 is caused because the file is being created with write-only permissions here: https://github.com/rust-lang/rust/blob/master/compiler/rustc_serialize/src/opaque.rs#L196

but it is trying to be read here: https://github.com/rust-lang/rust/blob/master/compiler/rustc_metadata/src/rmeta/encoder.rs#L780

This PR attempts to fix this by creating/opening the file with the same permissions as `File::create()` with the addition of read.
2022-09-20 10:12:57 -07:00
Michael Howell 14b27cfd11
Rollup merge of #100250 - cjgillot:recover-token-stream, r=Aaron1011
Manually cleanup token stream when macro expansion aborts.

In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE.

In this case, this PR manually cleans up the token stream by closing all currently open delimiters.

Fixes https://github.com/rust-lang/rust/issues/96818.
Fixes https://github.com/rust-lang/rust/issues/80447.
Fixes https://github.com/rust-lang/rust/issues/81920.
Fixes https://github.com/rust-lang/rust/issues/91023.
2022-09-20 10:12:56 -07:00
Michael Goulet 83e6128b57 Better binder treatment 2022-09-20 16:39:39 +00:00
bors cd8cc91045 Auto merge of #101989 - fee1-dead-contrib:const_trait_impl-assoc-caller-bounds, r=oli-obk
make projection bounds with const bounds satisfy const

Fixes #101982.
2022-09-20 16:24:36 +00:00
bors 1f66a3e8d0 Auto merge of #9502 - c410-f3r:arith, r=Alexendoo
[arithmetic-side-effects] Add more tests

Taken from the `integer-arithmetic` lint.

changelog: [arithmetic-side-effects] Add more tests
2022-09-20 16:14:54 +00:00
Mahmoud Al-Qudsi c291d2adec Clarify Path::extension() semantics in docs abstract
State up-front and center what shape the returned extension will have, without
making the user read through the description and examples.

Rationale: Various frameworks and libraries for different platforms have their
different conventions as to whether an "extension" is ".ext" or just "ext" and
anyone that's had to deal with this ambiguity in the past is always double- or
triple-checking to make sure the function call returns an extension that matches
the expected semantics. Offer the answer to this important question right off
the bat instead of making them dig to find it.
2022-09-20 11:12:03 -05:00
Guillaume Gomez 4a3109e8b7 Add test for sidebar elements in the "All types" page 2022-09-20 17:10:38 +02:00
Guillaume Gomez 5343dc7c99 Generate sidebar elements for the "All items" page 2022-09-20 17:10:21 +02:00
Caio 736d88b549 [arithmetic_side_effects] Add more tests 2022-09-20 12:06:49 -03:00
Laurențiu Nicola 9dcd19bd2e ⬆️ rust-analyzer 2022-09-20 17:39:17 +03:00
Sikkema, Isaac a2cb8a4949 add comment explaining read permissions 2022-09-20 10:06:50 -04:00
bors 4136b59b7d Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebank
Allow patterns to constrain the hidden type of opaque types

fixes #96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864)

TODO:

* check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-20 12:09:52 +00:00
Ralf Jung 7373788c37 fix ConstProp handling of written_only_inside_own_block_locals 2022-09-20 12:49:32 +02:00
bors eb84c8b621 Auto merge of #2553 - RalfJung:macos-is-a-pain, r=RalfJung
make a sync test more reliable

CI still failed in https://github.com/rust-lang/miri/actions/runs/3088146532/jobs/4994285794, with a 2 second timeout?!??
2022-09-20 08:19:56 +00:00
Ralf Jung 42523d9231 make a sync test more reliable 2022-09-20 10:14:30 +02:00
bors dfa6f8894e Auto merge of #2552 - RalfJung:env-term, r=oli-obk
remove Windows TERM env var hack and -Zmiri-env-exclude

The hack should not be needed any more since https://github.com/rust-lang/rust/pull/100206. And that also mostly removes the need for `-Zmiri-env-exclude` -- if needed, users can still achieve the same by running `(unset VAR; cargo miri test)`.

I am keeping `-Zmiri-env-forward` since it is still useful, e.g. to have RUST_BACKTRACE=full set in an otherwise deterministic execution.

`@rust-lang/miri` any objections to removing `-Zmiri-env-exclude`?
2022-09-20 07:16:58 +00:00
Ralf Jung dd80b1aaba work harder around notorious macos unrealiability 2022-09-20 09:14:14 +02:00
bors 8fd6d03e22 Auto merge of #101806 - BelovDV:issue-fix-fn-find_library, r=petrochenkov
fix verbatim with upstream dependencies

https://github.com/rust-lang/rust/issues/99425#issuecomment-1207224161

r? `@petrochenkov`
2022-09-20 07:10:18 +00:00
bors a38a082afb fix verbatim with upstream dependencies
https://github.com/rust-lang/rust/issues/99425#issuecomment-1207224161

r? `@petrochenkov`
2022-09-20 07:10:17 +00:00
Ralf Jung bacf131acc remove Windows TERM env var hack and -Zmiri-env-exclude 2022-09-20 08:51:13 +02:00
bors d9ad25ee4b Auto merge of #2548 - RalfJung:remove-tls-diagnostics-hack, r=RalfJung
avoid thread-local var indirection for non-halting diagnostics

This hack used to be necessary because Stacked Borrows did not have access to enough parts of the machine. But that got fixed a while ago, so now we can just emit diagnostics directly, which is a lot more reliable.

Needs https://github.com/rust-lang/rust/pull/101985
Fixes https://github.com/rust-lang/miri/issues/2538
2022-09-20 06:42:05 +00:00
Ralf Jung 7687b7e510 rustup, fmt 2022-09-20 08:41:44 +02:00
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
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