Commit Graph

142425 Commits

Author SHA1 Message Date
bors
79b9eb5371 Auto merge of #7072 - ebobrow:imports-ending-with-self, r=camsteffen
add unnecessary_self_imports lint

fixes #6552

changelog: add `unnecessary_self_imports` lint
2021-04-21 14:47:49 +00:00
Amanieu d'Antras
e34f7e665f Update LLVM submodule
Fixes #83467
2021-04-21 15:22:46 +01:00
Elliot Bobrow
224881b94d add unnecessary_self_imports lint 2021-04-21 07:17:42 -07:00
Alex Crichton
de2a4601ab rustc: Use LLVM's new saturating float-to-int intrinsics
This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.
2021-04-21 07:15:53 -07:00
Christiaan Dirkx
aa46f08abd Apply suggestions from code review 2021-04-21 16:06:32 +02:00
bors
bbc22e2ef3 Auto merge of #7083 - GuillaumeGomez:bool-assert-eq, r=camsteffen
Add lint to check for boolean comparison in assert macro calls

This PR adds a lint to check if an assert macro is using a boolean as "comparison value". For example:

```rust
assert_eq!("a".is_empty(), false);
```

Could be rewritten as:

```rust
assert!(!"a".is_empty());
```

PS: The dev guidelines are amazing. Thanks a lot for writing them!

changelog: Add `bool_assert_comparison` lint
2021-04-21 13:58:53 +00:00
Mara Bos
9ac18da17e Upgrade expat dependency in riscv64 to newer version.
The old version was renamed to
`expat-2.2.6-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD`. :)
2021-04-21 15:54:57 +02:00
Christiaan Dirkx
fccc75cf82 Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00
lcnr
d3e0d2f53d supply substs to anon consts in defaults 2021-04-21 15:25:58 +02:00
lcnr
312b4fdfd2 improve wf check for const param defaults 2021-04-21 15:25:58 +02:00
lcnr
7cb1dcd488 loosen ordering restricts for const_generics_defaults 2021-04-21 15:25:58 +02:00
lcnr
259a368e9e fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
Christiaan Dirkx
fdae75738b Change the Debug impl of Any and UnsafeCell to use finish_non_exhaustive 2021-04-21 14:51:04 +02:00
Christiaan Dirkx
1fb3256fcb Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
Guillaume Gomez
cc44ce0a3f Correctly handle --open argument on doc command 2021-04-21 14:36:26 +02:00
Mara Bos
82dc73b1ae Format Struct { .. } on one line even with {:#?}. 2021-04-21 13:50:56 +02:00
bors
926286acfe Auto merge of #7109 - ctennis:ct/asm_syntax_aarch64, r=flip1995
Ignore aarch64 for this test as it's x86 assembly only.  Fixes #7091

fixes #7091 - asm_syntax lint test will not compile on aarch64

changelog: none
2021-04-21 08:49:15 +00:00
Jack Huey
4568e7d62e Move nested quantification check to ast_validation 2021-04-21 03:12:04 -04:00
Tomasz Miąsko
75732dd00e Check for intrinsics before coercing to a function pointer
Return an error if coercing function items / non-capturing closures
to a common function pointer type would require reifying an intrinsic.
2021-04-21 00:00:00 +00:00
Smitty
df147c718c Just merge all of the <title> tests into one 2021-04-20 19:56:28 -04:00
Smitty
3ddafb2d7c Add test for title of root page in item-title.rs 2021-04-20 19:53:44 -04:00
marmeladema
d328dbc60f Add test for issue #71176 2021-04-21 00:33:26 +01:00
marmeladema
cbd0d89a26 Add test for issue #70304 2021-04-21 00:15:48 +01:00
Smitty
05121a22e6 fix is_module check 2021-04-20 19:10:00 -04:00
Smitty
a9ff7ac9c3 Merge mod-title and item-title tests 2021-04-20 18:57:26 -04:00
Smitty
7cf4f4276f Rename pushname to is_module 2021-04-20 18:53:15 -04:00
marmeladema
1ef760d88e Add test for issue #70303 2021-04-20 23:49:35 +01:00
marmeladema
25cb1af7b2 Add test for issue #78671 2021-04-20 23:42:48 +01:00
marmeladema
19e51aaef7 Add test for issue #79636 2021-04-20 23:42:41 +01:00
marmeladema
b6647b5692 Add test for issue #79949 2021-04-20 23:42:21 +01:00
Smitty
0c193f82e7 Write Rustdoc titles like "x in crate::mod - Rust"
This makes Rustdoc titles for items read like
"x in cratename::blah::foo - Rust". Title for modules and other
non-items are unchanged, and still read like
"doccratenameconst::blah::foo - Rust". This makes managing several open
Rustdoc tabs easier.

Closes #84371.
2021-04-20 17:31:18 -04:00
Stephen Albert-Moore
c968594456
Fix broken doc link 2021-04-20 17:10:20 -04:00
Jack Huey
9891582897 Remove TraitRefHackInner and use the concatenating functionality instead of trait_ref_hack 2021-04-20 16:43:04 -04:00
Jack Huey
457c4c133a Add BinderScopeType to replace binder_depth and from_poly_trait_ref 2021-04-20 16:42:46 -04:00
Jack Huey
32942ab807 A non-minimal set of TraitRefBoundarys to work on removing from_poly_trait_ref 2021-04-20 16:41:54 -04:00
Jack Huey
ba3d22ed66 Precompute inverse binder depth 2021-04-20 16:41:54 -04:00
Tor Hovland
a10d01be22 Uses flex to fix formatting of h1 at any width. 2021-04-20 22:31:48 +02:00
Christiaan Dirkx
d45e1314f3 Change uses of never type 2021-04-20 20:53:07 +02:00
Christiaan Dirkx
389fef3b30 Replace Void with never type 2021-04-20 20:53:07 +02:00
bors
6df26f897c 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.
2021-04-20 14:05:12 +00:00
Oli Scherer
85b1c67910 Limit test to 64 bit systems to keep the sizes in the diagnostics stable 2021-04-20 09:30:28 -04:00
Oli Scherer
6e988c0613 Typo 2021-04-20 09:30:28 -04:00
Oli Scherer
a46bc5664a Tidy 2021-04-20 09:30:28 -04:00
Oli Scherer
a2f2179026 Add an attribute to be able to configure the limit 2021-04-20 09:30:28 -04:00
Oli Scherer
e9696c8b62 Implement a lint that highlights all moves larger than 1000 bytes 2021-04-20 09:30:21 -04:00
bors
7d0132ae90 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
2021-04-20 11:19:31 +00:00
Edd Barrett
8cc918a3dc Improve the docstrings of the Lto struct. 2021-04-20 10:28:17 +01:00
Dylan DPC
868de80ac2
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`.
2021-04-20 11:08:30 +02:00
Dylan DPC
61f6cfb79b
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.
2021-04-20 11:08:29 +02:00
Dylan DPC
5cc3994654
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
2021-04-20 11:08:28 +02:00