Commit graph

142512 commits

Author SHA1 Message Date
Dylan DPC
3b81ea86fb
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.
2021-04-19 22:00:04 +02:00
Dylan DPC
817b7e0c11
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
2021-04-19 22:00:01 +02:00
Rich Kadel
5d8d67f746 compute fn_sig span from body call_site, and use body ctxt, not root 2021-04-19 12:30:55 -07:00
Jacob Hoffman-Andrews
9fcfe5e0c7 Remove collapse param from collapseNonInherent. 2021-04-19 12:07:55 -07:00
Tor Hovland
64a68ae69a No longer need to add attrs to ImportSource. 2021-04-19 20:39:04 +02:00
lcnr
419bf6bbd8 fix suggestion for unsized function parameters 2021-04-19 20:06:19 +02:00
lcnr
a8193ca4c3 fix suggestion for unsized function parameters 2021-04-19 20:06:19 +02:00
bors
1a6c98e4d6 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.
2021-04-19 18:05:44 +00:00
bors
8f77e2067f Auto merge of #7111 - giraffate:fix_link_in_doc, r=Manishearth
Fix links in doc

changelog: none
2021-04-19 15:56:04 +00:00
Caleb Tennis
42d070286e Ignore aarch64 for this test as it's x86 assembly only. Fixes #7091 2021-04-19 11:39:42 -04:00
Basavesh Shivakumar
c6b381c59b useless use of format! should return function directly 2021-04-19 17:20:21 +02:00
Aleksey Kladov
de16951dad Clarify the difference between insert and get_or_insert 2021-04-19 18:17:45 +03:00
bors
a3b1efd8e6 Auto merge of #7112 - giraffate:update_pull_request_template, r=camsteffen
Update pull request template

A follow-up of <https://github.com/rust-lang/rust-clippy/pull/7064#issuecomment-817857168>.

changelog: none
2021-04-19 14:39:11 +00:00
Takayuki Nakata
2d65b2d543 Update pull request template 2021-04-19 23:02:41 +09:00
Takayuki Nakata
b20cbff666 Fix links in doc 2021-04-19 22:47:09 +09:00
bors
fe5cefceba Auto merge of #7101 - camsteffen:flat-map-option, r=giraffate
Add flat_map_option lint

changelog: Add flat_map_option lint

Closes #2241
2021-04-19 13:34:23 +00:00
Ralf Jung
46d09f7a4b remove E0723 error code 2021-04-19 14:58:11 +02:00
klensy
f43ee8ebf6 fix few typos 2021-04-19 15:57:08 +03:00
bors
41f0e13bc5 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
2021-04-19 11:55:52 +00:00
Christiaan Dirkx
9bd9cbb28e Fix vxworks compilation errors 2021-04-19 13:29:35 +02:00
Christiaan Dirkx
12120409d5 Move sys::vxworks code to sys::unix 2021-04-19 13:29:22 +02:00
Ralf Jung
04db4abbfc add gate tests and pacify tidy 2021-04-19 10:25:31 +02:00
Guillaume Gomez
4fa1d6177c Remove unused footer section 2021-04-19 10:21:31 +02:00
Arpad Borsos
9f8eeca3bf
rustdoc: Convert sub-variant toggle to HTML
Instead of creating a JS toggle, this injects details/summary for
sub-variants of enums. This also fixes the CSS so that the toggle button
does not jump when expanding/collapsing.
2021-04-19 09:38:22 +02:00
bors
62652865b6 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
2021-04-19 07:32:55 +00:00
Jacob Hoffman-Andrews
39b299f8a4 rustdoc: make expand/collapse all ephemeral
The `[+]` in the upper right of a rustdoc page expands or collapses all
toggles on the page. That state is stored across page loads, but is used
inconsistently. This change explicitly stops storing or using the state.
2021-04-18 22:44:10 -07:00
bors
532609b01c Auto merge of #84316 - teymour-aldridge:improve-defaulted-never-note, r=petrochenkov
Improve an error message.
2021-04-19 04:51:48 +00:00
bors
8108e17faa Auto merge of #84288 - notriddle:short-links, r=jyn514
rustdoc: get rid of CURRENT_DEPTH

Fixes #82742
2021-04-19 01:59:20 +00:00
Trevor Spiteri
4c6477026d
Update library/std/src/primitive_docs.rs
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2021-04-19 02:58:38 +02:00
bors
c569d33be5 Auto merge of #7108 - rust-lang:fix-return-try-err, r=Manishearth
un-double `return` on try_err

This fixes #7103 by looking at the parent expression and omitting the "return " in the suggestion when its already a `return` expression.

---

changelog: none
2021-04-18 23:47:18 +00:00
bors
c4ba8e3e5f 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`
2021-04-18 23:28:43 +00:00
Rich Kadel
1893721ec4 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.
2021-04-18 16:26:18 -07:00
Rich Kadel
3ece6061b4 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
2021-04-18 15:04:59 -07:00
Andre Bogus
243dc46250 un-double return on try_err 2021-04-18 23:49:54 +02:00
Ralf Jung
bd9556956a fix feature use in rustc libs 2021-04-18 22:05:45 +02:00
bors
392d54963f 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.
2021-04-18 20:03:54 +00:00
bors
5a4ab26459 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.
2021-04-18 20:03:54 +00:00
teymour-aldridge
567de4a202 Improve an error message. 2021-04-18 20:38:23 +01:00
Rich Kadel
d1d7fb1ae5 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.)
2021-04-18 12:09:14 -07:00
Ralf Jung
fbfaab2cb7 separate feature flag for unsizing casts in const fn 2021-04-18 19:11:29 +02:00
Ralf Jung
fdad6ab3a3 move 'trait bounds on const fn' to separate feature gate 2021-04-18 18:36:41 +02:00
r00ster
c86ffe9e89
Say that it "may panic" 2021-04-18 18:16:10 +02:00
Tor Hovland
c975fe25e4 Put attrs in a Box for memory efficiency. 2021-04-18 18:02:08 +02:00
bors
ef88434286 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
2021-04-18 14:39:34 +00:00
r00ster
df01b3a67b
Document that index and index_mut can panic 2021-04-18 15:51:16 +02:00
bors
b021beeb60 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].
2021-04-18 11:42:51 +00:00
Rich Kadel
448e52d97c 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.
2021-04-18 03:11:25 -07:00
Waffle Lapkin
3ecaf57b29
Slightly change wording and fix typo in vec/mod.rs 2021-04-18 12:32:10 +03:00
Ralf Jung
7a5418dae1 fix aliasing violations in thread_local_const_init 2021-04-18 10:55:09 +02:00
Tor Hovland
e2a77b3d46 Test Deprecated, Portability, and Unstable. 2021-04-18 10:46:06 +02:00