]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agojoin_orders_after_tls_destructors: ensure thread 2 is launched before thread 1 enters...
Mohsen Zohrevandi [Thu, 6 May 2021 16:36:26 +0000 (09:36 -0700)]
join_orders_after_tls_destructors: ensure thread 2 is launched before thread 1 enters TLS destructors

3 years agoUse atomics in join_orders_after_tls_destructors test
Mohsen Zohrevandi [Thu, 29 Apr 2021 15:44:45 +0000 (08:44 -0700)]
Use atomics in join_orders_after_tls_destructors test

std::sync::mpsc uses thread locals and depending on the order TLS dtors
are run `rx.recv()` can panic when used in a TLS dtor.

3 years agoEnsure TLS destructors run before thread joins in SGX
Mohsen Zohrevandi [Wed, 21 Apr 2021 20:45:57 +0000 (13:45 -0700)]
Ensure TLS destructors run before thread joins in SGX

3 years agoAuto merge of #84353 - estebank:as-ref-mir, r=davidtwco
bors [Tue, 20 Apr 2021 14:05:12 +0000 (14:05 +0000)]
Auto merge of #84353 - estebank:as-ref-mir, r=davidtwco

Suggest `.as_ref()` on borrow error involving `Option`/`Result`

When encountering a E0382 borrow error involving an `Option` or `Result`
provide a suggestion to use `.as_ref()` on the prior move location to
avoid the move.

Fix #84165.

3 years agoAuto merge of #84363 - Dylan-DPC:rollup-ink2wyq, r=Dylan-DPC
bors [Tue, 20 Apr 2021 11:19:31 +0000 (11:19 +0000)]
Auto merge of #84363 - Dylan-DPC:rollup-ink2wyq, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #84337 (Clarify the difference between insert and get_or_insert)
 - #84340 (rustdoc: Show nag box on IE11)
 - #84345 (Remove comment about doc hack.)
 - #84347 (rustdoc: Simplify some document functions)

Failed merges:

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

3 years agoRollup merge of #84347 - Swatinem:simplify-document-fns, r=jyn514
Dylan DPC [Tue, 20 Apr 2021 09:08:30 +0000 (11:08 +0200)]
Rollup merge of #84347 - Swatinem:simplify-document-fns, r=jyn514

rustdoc: Simplify some document functions

* Remove `prefix` param of `document_short/full`, `render_markdown`, as its always an empty string.
* Remove `Option` wrapping of `document_short` `parent`, as its always `Some`.

3 years agoRollup merge of #84345 - ehuss:remove-core-core-comment, r=Mark-Simulacrum
Dylan DPC [Tue, 20 Apr 2021 09:08:29 +0000 (11:08 +0200)]
Rollup merge of #84345 - ehuss:remove-core-core-comment, r=Mark-Simulacrum

Remove comment about doc hack.

I neglected to remove this comment in #83955.

3 years agoRollup merge of #84340 - notriddle:patch-4, r=GuillaumeGomez
Dylan DPC [Tue, 20 Apr 2021 09:08:28 +0000 (11:08 +0200)]
Rollup merge of #84340 - notriddle:patch-4, r=GuillaumeGomez

rustdoc: Show nag box on IE11

Rustdoc doesn't work on IE11. It's been broken for months, it isn't supported by the [tiered browser support list], it's even more severely broken on other Rust websites, and IE11 doesn't support the `<details>` tag that we want to use.

In the interest of honesty, let's give an actual error message for anyone on IE11.

[tiered browser support list]: https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md

3 years agoRollup merge of #84337 - matklad:insert_or_insert, r=jyn514
Dylan DPC [Tue, 20 Apr 2021 09:08:27 +0000 (11:08 +0200)]
Rollup merge of #84337 - matklad:insert_or_insert, r=jyn514

Clarify the difference between insert and get_or_insert

Took me a while to realize that the two are actually different.

3 years agoAuto merge of #84323 - richkadel:uncovered-functions, r=tmandry
bors [Tue, 20 Apr 2021 08:33:51 +0000 (08:33 +0000)]
Auto merge of #84323 - richkadel:uncovered-functions, r=tmandry

coverage of async function bodies should match non-async

This fixes some missing coverage within async function bodies.

Commit 1 demonstrates the problem in the fixed issue, and commit 2 corrects it.

Fixes: #83985
3 years agoAuto merge of #83900 - torhovland:issue-83832, r=jyn514
bors [Tue, 20 Apr 2021 06:03:15 +0000 (06:03 +0000)]
Auto merge of #83900 - torhovland:issue-83832, r=jyn514

Add stability tags to ImportItem.

Fixes #83832.

3 years agoAuto merge of #84295 - richkadel:continue-coverage, r=tmandry
bors [Tue, 20 Apr 2021 03:08:24 +0000 (03:08 +0000)]
Auto merge of #84295 - richkadel:continue-coverage, r=tmandry

Add coverage to continue statements

`continue` statements were missing coverage. This was particularly
noticeable in a match pattern that contained only a `continue`
statement, leaving the branch appear uncounted. This PR addresses the
problem and adds tests to prove it.

r? `@tmandry`
cc: `@wesleywiser`

3 years agoAuto merge of #84334 - klensy:typo-compiler, r=jyn514
bors [Tue, 20 Apr 2021 00:16:45 +0000 (00:16 +0000)]
Auto merge of #84334 - klensy:typo-compiler, r=jyn514

fix few typos in comments

3 years agoSuggest `.as_ref()` on borrow error involving `Option`/`Result`
Esteban Küber [Sun, 18 Apr 2021 16:37:47 +0000 (09:37 -0700)]
Suggest `.as_ref()` on borrow error involving `Option`/`Result`

When encountering a E0382 borrow error involving an `Option` or `Result`
provide a suggestion to use `.as_ref()` on the prior move location to
avoid the move.

Fix #84165.

3 years agorustdoc: Simplify some document functions
Arpad Borsos [Mon, 19 Apr 2021 21:31:11 +0000 (23:31 +0200)]
rustdoc: Simplify some document functions

* Remove `prefix` param of `document_short/full`, `render_markdown`, as its always an empty string.
* Remove `Option` wrapping of `document_short` `parent`, as its always `Some`.

3 years agoUse onEachLazy to iterate DOMTokenList
Michael Howell [Mon, 19 Apr 2021 21:12:40 +0000 (14:12 -0700)]
Use onEachLazy to iterate DOMTokenList

3 years agoRemove comment about doc hack.
Eric Huss [Mon, 19 Apr 2021 21:06:36 +0000 (14:06 -0700)]
Remove comment about doc hack.

3 years agoAuto merge of #84342 - Dylan-DPC:rollup-5b40142, r=Dylan-DPC
bors [Mon, 19 Apr 2021 20:49:27 +0000 (20:49 +0000)]
Auto merge of #84342 - Dylan-DPC:rollup-5b40142, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #84123 (Introduce CompileMonoItem DepNode)
 - #84126 (Enable sanitizers for x86_64-unknown-linux-musl)
 - #84168 (Lower async fn in traits.)
 - #84256 (doc: use U+2212 for minus sign in floating-point -0.0 remarks)
 - #84291 (fix aliasing violations in thread_local_const_init)
 - #84313 (fix suggestion for unsized function parameters)
 - #84330 (Remove unused footer section)

Failed merges:

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

3 years agorustdoc: Show nag box on IE10
Michael Howell [Mon, 19 Apr 2021 18:40:25 +0000 (11:40 -0700)]
rustdoc: Show nag box on IE10

Rustdoc doesn't work on IE11. It's been broken for months, it isn't supported
by the [tiered browser support list], it's even more severely broken on other
Rust websites, and IE11 doesn't support the `<details>` tag that we want
to use.

In the interest of honesty, let's give an actual error message for anyone
on IE11.

[tiered browser support list]: https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md

3 years agoRollup merge of #84330 - GuillaumeGomez:remove-footer, r=jyn514
Dylan DPC [Mon, 19 Apr 2021 20:00:11 +0000 (22:00 +0200)]
Rollup merge of #84330 - GuillaumeGomez:remove-footer, r=jyn514

Remove unused footer section

I realized yesterday while working on docs.rs that rustdoc was generating a "footer"section that it doesn't use. No need to keep it then.

r? `@jyn514`

3 years agoRollup merge of #84313 - lcnr:sized-err-msg, r=petrochenkov
Dylan DPC [Mon, 19 Apr 2021 20:00:10 +0000 (22:00 +0200)]
Rollup merge of #84313 - lcnr:sized-err-msg, r=petrochenkov

fix suggestion for unsized function parameters

taken from `@fasterthanlime's` article https://fasterthanli.me/articles/whats-in-the-box

3 years agoRollup merge of #84291 - RalfJung:thread-local-const-init, r=alexcrichton
Dylan DPC [Mon, 19 Apr 2021 20:00:09 +0000 (22:00 +0200)]
Rollup merge of #84291 - RalfJung:thread-local-const-init, r=alexcrichton

fix aliasing violations in thread_local_const_init

Fixes https://github.com/rust-lang/rust/pull/83416#discussion_r615364774

r? `@alexcrichton` `@sfackler`

3 years agoRollup merge of #84256 - tspiteri:pretty-minus-zero, r=workingjubilee
Dylan DPC [Mon, 19 Apr 2021 20:00:08 +0000 (22:00 +0200)]
Rollup merge of #84256 - tspiteri:pretty-minus-zero, r=workingjubilee

doc: use U+2212 for minus sign in floating-point -0.0 remarks

Also remove plus sign in `-0.0 == +0.0` to make it a valid expression.

3 years agoRollup merge of #84168 - cjgillot:asi, r=davidtwco
Dylan DPC [Mon, 19 Apr 2021 20:00:06 +0000 (22:00 +0200)]
Rollup merge of #84168 - cjgillot:asi, r=davidtwco

Lower async fn in traits.

An error is already created by AST validation.

Fixes #84149

3 years agoRollup merge of #84126 - 12101111:musl-sanitizer, r=davidtwco
Dylan DPC [Mon, 19 Apr 2021 20:00:04 +0000 (22:00 +0200)]
Rollup merge of #84126 - 12101111:musl-sanitizer, r=davidtwco

Enable sanitizers for x86_64-unknown-linux-musl

Those 4 sanitizers get musl target support in LLVM 12 release.

3 years agoRollup merge of #84123 - bjorn3:compile_mono_item_dep_node, r=wesleywiser
Dylan DPC [Mon, 19 Apr 2021 20:00:01 +0000 (22:00 +0200)]
Rollup merge of #84123 - bjorn3:compile_mono_item_dep_node, r=wesleywiser

Introduce CompileMonoItem DepNode

This is likely required for allowing efficient hot code swap support in cg_clif's jit mode. My prototype currently requires re-compiling all functions, which is both slow and uses a lot of memory as there is not support for freeing the memory used by replaced functions yet.

cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087

3 years agocompute fn_sig span from body call_site, and use body ctxt, not root
Rich Kadel [Mon, 19 Apr 2021 19:30:55 +0000 (12:30 -0700)]
compute fn_sig span from body call_site, and use body ctxt, not root

3 years agoNo longer need to add attrs to ImportSource.
Tor Hovland [Mon, 19 Apr 2021 18:39:04 +0000 (20:39 +0200)]
No longer need to add attrs to ImportSource.

3 years agofix suggestion for unsized function parameters
lcnr [Sun, 18 Apr 2021 17:35:23 +0000 (19:35 +0200)]
fix suggestion for unsized function parameters

3 years agoAuto merge of #84091 - tmiasko:check-attrs-sym, r=davidtwco
bors [Mon, 19 Apr 2021 18:05:44 +0000 (18:05 +0000)]
Auto merge of #84091 - tmiasko:check-attrs-sym, r=davidtwco

Match against attribute name when validating attributes

Extract attribute name once and match it against symbols that are being
validated, instead of using `Session::check_name` for each symbol
individually.

Assume that all validated attributes are used, instead of marking them
as such, since the attribute check should be exhaustive.

3 years agoClarify the difference between insert and get_or_insert
Aleksey Kladov [Mon, 19 Apr 2021 14:48:51 +0000 (17:48 +0300)]
Clarify the difference between insert and get_or_insert

3 years agofix few typos
klensy [Mon, 19 Apr 2021 12:57:08 +0000 (15:57 +0300)]
fix few typos

3 years agoAuto merge of #84294 - WaffleLapkin:patch-2, r=jonas-schievink
bors [Mon, 19 Apr 2021 11:55:52 +0000 (11:55 +0000)]
Auto merge of #84294 - WaffleLapkin:patch-2, r=jonas-schievink

Slightly change wording in doc comment and fix typo in vec/mod.rs

Suggested by `@pickfire` in https://github.com/rust-lang/rust/pull/82760

3 years agoRemove unused footer section
Guillaume Gomez [Mon, 19 Apr 2021 08:21:31 +0000 (10:21 +0200)]
Remove unused footer section

3 years agoAuto merge of #84283 - jsha:de-emphasize-attributes, r=GuillaumeGomez
bors [Mon, 19 Apr 2021 07:32:55 +0000 (07:32 +0000)]
Auto merge of #84283 - jsha:de-emphasize-attributes, r=GuillaumeGomez

rustdoc: Reduce visual weight of attributes.

Followup from #83337. As part of that PR, we stopped hiding attributes behind a toggle, because most things have just zero or one attributes. However, this made clear that the current rendering of attributes emphasizes them a lot, which distracts from function signatures. This PR changes their color of attributes to be the same as the toggles, and reduces their font weight.

This also removes `#[lang]` from the list of ALLOWED_ATTRIBUTES. This attribute is an implementation detail rather than part of the public-facing documentation.

![image](https://user-images.githubusercontent.com/220205/115131061-cc407d80-9fa9-11eb-9a77-ad3f3217f391.png)

Demo at https://hoffman-andrews.com/rust/de-emph-attr/std/string/struct.String.html#method.trim

3 years agoAuto merge of #84316 - teymour-aldridge:improve-defaulted-never-note, r=petrochenkov
bors [Mon, 19 Apr 2021 04:51:48 +0000 (04:51 +0000)]
Auto merge of #84316 - teymour-aldridge:improve-defaulted-never-note, r=petrochenkov

Improve an error message.

3 years agoAuto merge of #84288 - notriddle:short-links, r=jyn514
bors [Mon, 19 Apr 2021 01:59:20 +0000 (01:59 +0000)]
Auto merge of #84288 - notriddle:short-links, r=jyn514

rustdoc: get rid of CURRENT_DEPTH

Fixes #82742

3 years agoUpdate library/std/src/primitive_docs.rs
Trevor Spiteri [Mon, 19 Apr 2021 00:58:38 +0000 (02:58 +0200)]
Update library/std/src/primitive_docs.rs

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
3 years agoAuto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearth
bors [Sun, 18 Apr 2021 23:28:43 +0000 (23:28 +0000)]
Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearth

Stablize `non-ascii-idents`

This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467).

r? `@Manishearth`

3 years agoFixes the issue with uncovered source in async function bodies
Rich Kadel [Sun, 18 Apr 2021 23:26:18 +0000 (16:26 -0700)]
Fixes the issue with uncovered source in async function bodies

The body_span was assumed to be in the Span root context, but this was
not the case for async function bodies.

3 years agoDRAFT: coverage of async function bodies should match non-async
Rich Kadel [Sun, 18 Apr 2021 22:04:59 +0000 (15:04 -0700)]
DRAFT: coverage of async function bodies should match non-async

The initial commit demonstrates the issue, but the fix is not yet
implemented.

Once corrected...

Fixes: #83985
3 years agoAuto merge of #78880 - CDirkx:not_supported, r=joshtriplett
bors [Sun, 18 Apr 2021 20:03:54 +0000 (20:03 +0000)]
Auto merge of #78880 - CDirkx:not_supported, r=joshtriplett

Add `Unsupported` to `std::io::ErrorKind`

I noticed a significant portion of the uses of `ErrorKind::Other` in std is for unsupported operations.
The notion that a specific operation is not available on a target (and will thus never succeed) seems semantically distinct enough from just "an unspecified error occurred", which is why I am proposing to add the variant `Unsupported` to `std::io::ErrorKind`.

**Implementation**:

The following variant will be added to `std::io::ErrorKind`:

```rust
/// This operation is unsupported on this platform.
Unsupported
```
`std::io::ErrorKind::Unsupported` is an error returned when a given operation is not supported on a platform, and will thus never succeed; there is no way for the software to recover. It will be used instead of `Other` where appropriate, e.g. on wasm for file and network operations.

`decode_error_kind` will be updated  to decode operating system errors to `Unsupported`:
- Unix and VxWorks: `libc::ENOSYS`
- Windows: `c::ERROR_CALL_NOT_IMPLEMENTED`
- WASI: `wasi::ERRNO_NOSYS`

**Stability**:
This changes the kind of error returned by some functions on some platforms, which I think is not covered by the stability guarantees of the std? User code could depend on this behavior, expecting `ErrorKind::Other`, however the docs already mention:

> Errors that are `Other` now may move to a different or a new `ErrorKind` variant in the future. It is not recommended to match an error against `Other` and to expect any additional characteristics, e.g., a specific `Error::raw_os_error` return value.

The most recent variant added to `ErrorKind` was `UnexpectedEof` in `1.6.0` (almost 5 years ago), but `ErrorKind` is marked as `#[non_exhaustive]` and the docs warn about exhaustively matching on it, so adding a new variant per se should not be a breaking change.

The variant `Unsupported` itself could be marked as `#[unstable]`, however, because this PR also immediately uses this new variant and changes the errors returned by functions I'm inclined to agree with the others in this thread that the variant should be insta-stabilized.

3 years agoImprove an error message.
teymour-aldridge [Sun, 18 Apr 2021 19:38:23 +0000 (20:38 +0100)]
Improve an error message.

3 years agoOnly generate dummy assign when instrumenting coverage
Rich Kadel [Sun, 18 Apr 2021 18:51:42 +0000 (11:51 -0700)]
Only generate dummy assign when instrumenting coverage

And make the LocalDecl internal, to avoid needing to declare storage.
(For multiple `continue` stateuemtns, it must also be mutable.)

3 years agoPut attrs in a Box for memory efficiency.
Tor Hovland [Sun, 18 Apr 2021 15:30:04 +0000 (17:30 +0200)]
Put attrs in a Box for memory efficiency.

3 years agoAuto merge of #84274 - nagisa:fix-simd, r=nikic
bors [Sun, 18 Apr 2021 14:39:34 +0000 (14:39 +0000)]
Auto merge of #84274 - nagisa:fix-simd, r=nikic

Don't set fast-math for the SIMD operations we set it for previously

Instead of `fast-math`. `fast-math` implies things like functions not
being able to accept as an argument or return as a result, say, `inf`
which made these functions confusingly named or behaving incorrectly,
depending on how you interpret it. It seems that the intended behaviour
was to set a `afn` flag instead. In doing so we also renamed the
intrinsics to say `_approx` so that it is clear these are not precision
oriented and the users can act accordingly.

Fixes #84268

3 years agoAuto merge of #84285 - hi-rustin:rustin-patch-search, r=GuillaumeGomez
bors [Sun, 18 Apr 2021 11:42:51 +0000 (11:42 +0000)]
Auto merge of #84285 - hi-rustin:rustin-patch-search, r=GuillaumeGomez

Fix the wrong return value type description of validateResult

It's should be boolean not [boolean].

3 years agoAdd coverage to continue statements
Rich Kadel [Sun, 18 Apr 2021 09:55:17 +0000 (02:55 -0700)]
Add coverage to continue statements

`continue` statements were missing coverage. This was particularly
noticeable in a match pattern that contained only a `continue`
statement, leaving the branch appear uncounted. This PR addresses the
problem and adds tests to prove it.

3 years agoSlightly change wording and fix typo in vec/mod.rs
Waffle Lapkin [Sun, 18 Apr 2021 09:32:10 +0000 (12:32 +0300)]
Slightly change wording and fix typo in vec/mod.rs

3 years agofix aliasing violations in thread_local_const_init
Ralf Jung [Sun, 18 Apr 2021 08:55:09 +0000 (10:55 +0200)]
fix aliasing violations in thread_local_const_init

3 years agoTest Deprecated, Portability, and Unstable.
Tor Hovland [Wed, 14 Apr 2021 19:41:46 +0000 (21:41 +0200)]
Test Deprecated, Portability, and Unstable.

3 years agoNow also displays portability tags.
Tor Hovland [Wed, 14 Apr 2021 18:49:08 +0000 (20:49 +0200)]
Now also displays portability tags.

3 years agoGive import items their own CSS class.
Tor Hovland [Tue, 13 Apr 2021 15:23:27 +0000 (17:23 +0200)]
Give import items their own CSS class.

3 years agoAdded a test.
Tor Hovland [Thu, 8 Apr 2021 21:03:39 +0000 (23:03 +0200)]
Added a test.

3 years agoAdd stability tags to ImportItem.
Tor Hovland [Mon, 5 Apr 2021 18:57:49 +0000 (20:57 +0200)]
Add stability tags to ImportItem.

3 years agoFix clippy test using `ErrorKind`
Christiaan Dirkx [Mon, 29 Mar 2021 10:35:16 +0000 (12:35 +0200)]
Fix clippy test using `ErrorKind`

3 years agoBump to 1.53.0
CDirkx [Sun, 21 Mar 2021 23:29:17 +0000 (00:29 +0100)]
Bump to 1.53.0

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
3 years agoFix test `metadata_access_times` to also check for `Unsupported`
Christiaan Dirkx [Fri, 19 Mar 2021 19:48:48 +0000 (20:48 +0100)]
Fix test `metadata_access_times` to also check for `Unsupported`

3 years agoRename `NotSupported` to `Unsupported`
Christiaan Dirkx [Fri, 19 Mar 2021 00:39:20 +0000 (01:39 +0100)]
Rename `NotSupported` to `Unsupported`

3 years agoUse `NotSupported` in more places
Christiaan Dirkx [Thu, 25 Feb 2021 23:17:36 +0000 (00:17 +0100)]
Use `NotSupported` in more places

3 years agoBump since to 1.52.0
CDirkx [Tue, 23 Feb 2021 04:49:37 +0000 (05:49 +0100)]
Bump since to 1.52.0

3 years agoUpdate `decode_error_kind` to decode os errors to `NotSupported`
Christiaan Dirkx [Fri, 12 Feb 2021 23:00:54 +0000 (00:00 +0100)]
Update `decode_error_kind` to decode os errors to `NotSupported`

3 years agoAdd and insta-stabilize `std::io::ErrorKind::NotSupported`
Christiaan Dirkx [Fri, 20 Nov 2020 05:14:29 +0000 (06:14 +0100)]
Add and insta-stabilize `std::io::ErrorKind::NotSupported`

3 years agoAuto merge of #84207 - SimonSapin:deprecate-core-raw, r=dtolnay
bors [Sun, 18 Apr 2021 07:23:54 +0000 (07:23 +0000)]
Auto merge of #84207 - SimonSapin:deprecate-core-raw, r=dtolnay

Deprecate the core::raw / std::raw module

It only contains the `TraitObject` struct which exposes components of wide pointer. Pointer metadata APIs are designed to replace this: https://github.com/rust-lang/rust/issues/81513

3 years agorustdoc: get rid of CURRENT_DEPTH
Michael Howell [Sun, 18 Apr 2021 05:34:58 +0000 (22:34 -0700)]
rustdoc: get rid of CURRENT_DEPTH

3 years agoAuto merge of #84065 - c410-f3r:tests-tests-tests, r=petrochenkov
bors [Sun, 18 Apr 2021 04:53:18 +0000 (04:53 +0000)]
Auto merge of #84065 - c410-f3r:tests-tests-tests, r=petrochenkov

Move some tests to more reasonable directories - 6

cc #73494
r? `@petrochenkov`

git mv bad/bad-const-type.* static/
git mv bad/bad-crate-name.* extern
git mv bad/bad-env-capture* fn/
git mv bad/bad-expr-lhs.* expr/
git mv bad/bad-expr-path* expr/
git mv bad/bad-extern-link-attrs.* extern/
git mv bad/bad-intrinsic-monomorphization.* intrinsics/
git mv bad/bad-lint-cap* lint/
git mv bad/bad-main.* fn
git mv bad/bad-method-typaram-kind.* type/
git mv bad/bad-mid-path-type-params.* fn
git mv bad/bad-module.* modules/
git mv bad/bad-sized.* type/
git mv bad/bad-type-env-capture.* fn

3 years agoFix the wrong return value type description of validateResult
hi-rustin [Sun, 18 Apr 2021 02:43:14 +0000 (10:43 +0800)]
Fix the wrong return value type description of validateResult

3 years agoAuto merge of #84064 - hyd-dev:unknown-lints, r=petrochenkov
bors [Sun, 18 Apr 2021 02:12:13 +0000 (02:12 +0000)]
Auto merge of #84064 - hyd-dev:unknown-lints, r=petrochenkov

Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes

Fixes #83477.

3 years agoReduce visual weight of attributes.
Jacob Hoffman-Andrews [Sun, 18 Apr 2021 01:08:50 +0000 (18:08 -0700)]
Reduce visual weight of attributes.

3 years agoAuto merge of #84061 - AngelicosPhosphoros:issue-75598-add-inline-always-arithmetic...
bors [Sat, 17 Apr 2021 23:31:10 +0000 (23:31 +0000)]
Auto merge of #84061 - AngelicosPhosphoros:issue-75598-add-inline-always-arithmetic, r=nagisa

Add some #[inline(always)] to arithmetic methods of integers

I tried to add it only to methods which return results of intrinsics and don't have any branching.
Branching could made performance of debug builds (`-Copt-level=0`) worse.
Main goal of changes is allowing wider optimizations in `-Copt-level=1`.

Closes: https://github.com/rust-lang/rust/issues/75598
r? `@nagisa`

3 years agoMove some tests to more reasonable directories - 6
Caio [Sat, 17 Apr 2021 21:53:54 +0000 (18:53 -0300)]
Move some tests to more reasonable directories - 6

3 years agoAuto merge of #84279 - Dylan-DPC:rollup-k7otd7e, r=Dylan-DPC
bors [Sat, 17 Apr 2021 20:41:37 +0000 (20:41 +0000)]
Auto merge of #84279 - Dylan-DPC:rollup-k7otd7e, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #83237 (rustdoc: use more precise relative URLs)
 - #84150 (rustdoc: move some search code into search.js)
 - #84203 (rustdoc: Give a more accurate span for anchor failures)
 - #84257 (Add documentation to help people find `Ipv4Addr::UNSPECIFIED`)

Failed merges:

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

3 years agoDon't set `fast`(-math) for certain simd ops
Simonas Kazlauskas [Sat, 17 Apr 2021 17:40:59 +0000 (20:40 +0300)]
Don't set `fast`(-math) for certain simd ops

`fast-math` implies things like functions not being able to accept as an
argument or return as a result, say, `inf` which made these functions
confusingly named or behaving incorrectly, depending on how you
interpret it. Since the time when these intrinsics have been implemented
the intrinsics user's (stdsimd) approach has changed significantly and
so now it is required that these intrinsics operate normally rather than
in "whatever" way.

Fixes #84268

3 years agoRollup merge of #84257 - joshtriplett:inaddr-any, r=m-ou-se
Dylan DPC [Sat, 17 Apr 2021 20:31:34 +0000 (22:31 +0200)]
Rollup merge of #84257 - joshtriplett:inaddr-any, r=m-ou-se

Add documentation to help people find `Ipv4Addr::UNSPECIFIED`

People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`;
add some documentation to help.

3 years agoRollup merge of #84203 - jyn514:anchor-span, r=euclio
Dylan DPC [Sat, 17 Apr 2021 20:31:33 +0000 (22:31 +0200)]
Rollup merge of #84203 - jyn514:anchor-span, r=euclio

rustdoc: Give a more accurate span for anchor failures

r? `@euclio`

3 years agoRollup merge of #84150 - jsha:defer-search-js, r=GuillaumeGomez
Dylan DPC [Sat, 17 Apr 2021 20:31:32 +0000 (22:31 +0200)]
Rollup merge of #84150 - jsha:defer-search-js, r=GuillaumeGomez

rustdoc: move some search code into search.js

This reduces main.s from 3094 lines to 1587. Also it saves some bytes
of download in the case where search isn't used.

There were a fair number of variables that needed to be accessible in
both main.js and search.js, but I didn't want to put too many symbols in
the global namespace, so I consolidated much of the search-related
state and functions into a new object `window.searchState`.

Demo at https://hoffman-andrews.com/rust/move-search/std/?search=foo

3 years agoRollup merge of #83237 - notriddle:short-links, r=jyn514
Dylan DPC [Sat, 17 Apr 2021 20:31:31 +0000 (22:31 +0200)]
Rollup merge of #83237 - notriddle:short-links, r=jyn514

rustdoc: use more precise relative URLs

This is a fairly large diff, and will probably conflict with https://github.com/rust-lang/rust/pull/82815 since it reduces (but does not eliminate) the use of the old depth variable.

Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter.

Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping).

    $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html
    2387389 struct.Wrapping.old.html
    2298538 struct.Wrapping.new.html

Most if it can be efficiently gzipped away.

    $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz
    70679 struct.Wrapping.old.html.gz
    70050 struct.Wrapping.new.html.gz

But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.

3 years agorustdoc: Give a more accurate span for anchor failures
Joshua Nelson [Wed, 14 Apr 2021 20:59:41 +0000 (16:59 -0400)]
rustdoc: Give a more accurate span for anchor failures

3 years agoAuto merge of #84270 - nagisa:nagisa/bump-llvm, r=cuviper
bors [Sat, 17 Apr 2021 18:10:41 +0000 (18:10 +0000)]
Auto merge of #84270 - nagisa:nagisa/bump-llvm, r=cuviper

Include a backport for wrong DWARF information

A partial fix for #83139

r? `@cuviper` or `@nikic`

3 years agorustdoc: move the cx argument to the end of the list
Michael Howell [Fri, 16 Apr 2021 19:29:35 +0000 (12:29 -0700)]
rustdoc: move the cx argument to the end of the list

This should help make things consistent.

3 years agorustdoc: change 'cx to 'tcx, to match the struct itself
Michael Howell [Fri, 16 Apr 2021 18:21:17 +0000 (11:21 -0700)]
rustdoc: change 'cx to 'tcx, to match the struct itself

3 years agoRemove assert that no longer matters
Michael Howell [Fri, 16 Apr 2021 17:06:48 +0000 (10:06 -0700)]
Remove assert that no longer matters

The function `to_src_with_space` doesn't even accept the cache as a parameter,
so it doesn't matter any more what's in it.

3 years agorustdoc: use more precise relative URLS
Michael Howell [Wed, 17 Mar 2021 18:41:01 +0000 (11:41 -0700)]
rustdoc: use more precise relative URLS

Instead of using a depth counter and adding "../" to get to the top,
this commit makes rustdoc actually compare the path of what it's
linking from to the path that it's linking to. This makes the resulting
HTML shorter.

Here's a comparison of one of the largest (non-source) files in the
Rust standard library docs (about 4% improvement before gzipping).

    $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html
    2387389 struct.Wrapping.old.html
    2298538 struct.Wrapping.new.html

Most if it can be efficiently gzipped away.

    $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz
    70679 struct.Wrapping.old.html.gz
    70050 struct.Wrapping.new.html.gz

But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.

3 years agoAuto merge of #84261 - Aaron1011:error-dup-revisions, r=Mark-Simulacrum
bors [Sat, 17 Apr 2021 15:29:34 +0000 (15:29 +0000)]
Auto merge of #84261 - Aaron1011:error-dup-revisions, r=Mark-Simulacrum

Error when compiletest is passed duplicate revisions

Currently, we allow the user to write things like
'// revisions: rpass1 rpass1', which will not test what they were
intending to test.

3 years agoAuto merge of #84260 - Aaron1011:global-alloc-eval-always, r=cjgillot
bors [Sat, 17 Apr 2021 12:48:50 +0000 (12:48 +0000)]
Auto merge of #84260 - Aaron1011:global-alloc-eval-always, r=cjgillot

Mark `has_global_allocator` query as `eval_always`

Fixes #84252

This query reads from untracked global state in `CStore`.

3 years agoInclude a backport for wrong DWARF information
Simonas Kazlauskas [Sat, 17 Apr 2021 11:53:33 +0000 (14:53 +0300)]
Include a backport for wrong DWARF information

A partial fix for #83139

3 years agoDo not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid...
hyd-dev [Sat, 10 Apr 2021 17:08:31 +0000 (01:08 +0800)]
Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes

3 years agoAuto merge of #84246 - notriddle:rustdoc-path-printing-cleanup, r=jyn514
bors [Sat, 17 Apr 2021 09:58:27 +0000 (09:58 +0000)]
Auto merge of #84246 - notriddle:rustdoc-path-printing-cleanup, r=jyn514

rustdoc: get rid of unused path printing code

The code for printing a raw path is only used in utils.rs, which only prints the alternative (non-HTML) format. Path has
a function that does the same thing without HTML support, so use that instead.

3 years agoAuto merge of #84244 - ABouttefeux:closure-return-conflict-suggest, r=estebank
bors [Sat, 17 Apr 2021 07:17:31 +0000 (07:17 +0000)]
Auto merge of #84244 - ABouttefeux:closure-return-conflict-suggest, r=estebank

fix incomplete diagnostic notes when closure returns conflicting for genric type

fixes #84128
Correctly report the span on for conflicting return type in closures

3 years agoAuto merge of #84243 - Soveu:fix-derive-macro-const-default, r=petrochenkov
bors [Sat, 17 Apr 2021 04:48:36 +0000 (04:48 +0000)]
Auto merge of #84243 - Soveu:fix-derive-macro-const-default, r=petrochenkov

Builtin derive macros: fix error with const generics default

This fixes a bug where builtin derive macros (like Clone, Debug) would basically copy-paste the default from a const generic, causing a compile error with very confusing message - it would say defaults are not allowed in impl blocks, while pointing at struct/enum/union definition.

3 years agoAuto merge of #84113 - SNCPlay42:suggestion-extern-crate, r=petrochenkov
bors [Sat, 17 Apr 2021 02:23:10 +0000 (02:23 +0000)]
Auto merge of #84113 - SNCPlay42:suggestion-extern-crate, r=petrochenkov

Detect when suggested paths enter extern crates more rigorously

When reporting resolution errors, the compiler tries to avoid suggesting importing inaccessible paths from other crates. However, the search for suggestions only recognized when it was entering a crate root directly, and so failed to recognize a path like `crate::module::private_item`, where `module` was imported from another crate with `use other_crate::module`, as entering another crate.

Fixes #80079
Fixes #84081

3 years agoAuto merge of #84074 - notriddle:rustdoc-macro-visibility, r=jyn514
bors [Fri, 16 Apr 2021 23:41:43 +0000 (23:41 +0000)]
Auto merge of #84074 - notriddle:rustdoc-macro-visibility, r=jyn514

rustdoc: clean up and test macro visibility print

This fixes the overly-complex invariant mentioned in <https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570>, where the macro source can't have any links in it only because the cache hasn't been populated yet.

3 years agoError when compiletest is passed duplicate revisions
Aaron Hill [Fri, 16 Apr 2021 21:05:59 +0000 (17:05 -0400)]
Error when compiletest is passed duplicate revisions

Currently, we allow the user to write things like
'// revisions: rpass1 rpass1', which will not test what they were
intending to test.

3 years agoMark `has_global_allocator` query as `eval_always`
Aaron Hill [Fri, 16 Apr 2021 20:28:54 +0000 (16:28 -0400)]
Mark `has_global_allocator` query as `eval_always`

Fixes #84252

This query reads from untracked global state in `CStore`.

3 years agoAdd documentation to help people find `Ipv4Addr::UNSPECIFIED`
Josh Triplett [Fri, 16 Apr 2021 19:57:20 +0000 (12:57 -0700)]
Add documentation to help people find `Ipv4Addr::UNSPECIFIED`

People looking for `INADDR_ANY` don't always find
`Ipv4Addr::UNSPECIFIED`; add some documentation and an alias to help.

3 years agodoc: use U+2212 for minus sign in floating-point -0.0 remarks
Trevor Spiteri [Fri, 16 Apr 2021 19:48:41 +0000 (21:48 +0200)]
doc: use U+2212 for minus sign in floating-point -0.0 remarks

Also remove plus sign in `-0.0 == +0.0` to make it a valid expression.

3 years agoAuto merge of #84249 - crlf0710:fix_miri, r=RalfJung
bors [Fri, 16 Apr 2021 19:25:23 +0000 (19:25 +0000)]
Auto merge of #84249 - crlf0710:fix_miri, r=RalfJung

Update miri.

Fixes #84240.

r? `@RalfJung`

3 years agoAdd comment
bjorn3 [Fri, 16 Apr 2021 18:55:51 +0000 (20:55 +0200)]
Add comment

3 years agoUpdate miri.
Charles Lew [Fri, 16 Apr 2021 18:22:13 +0000 (02:22 +0800)]
Update miri.

3 years agoAuto merge of #83416 - alexcrichton:const-thread-local, r=sfackler
bors [Fri, 16 Apr 2021 16:36:46 +0000 (16:36 +0000)]
Auto merge of #83416 - alexcrichton:const-thread-local, r=sfackler

std: Add a variant of thread locals with const init

This commit adds a variant of the `thread_local!` macro as a new
`thread_local_const_init!` macro which requires that the initialization
expression is constant (e.g. could be stuck into a `const` if so
desired). This form of thread local allows for a more efficient
implementation of `LocalKey::with` both if the value has a destructor
and if it doesn't. If the value doesn't have a destructor then `with`
should desugar to exactly as-if you use `#[thread_local]` given
sufficient inlining.

The purpose of this new form of thread locals is to precisely be
equivalent to `#[thread_local]` on platforms where possible for values
which fit the bill (those without destructors). This should help close
the gap in performance between `thread_local!`, which is safe, relative
to `#[thread_local]`, which is not easy to use in a portable fashion.