Guillaume Gomez
97b736c1a5
Rollup merge of #81033 - jyn514:nested-variant, r=CraftSpider
...
Remove useless `clean::Variant` struct
It had exactly one field and no special behavior, so there was no point in having it.
r? `@CraftSpider`
2021-01-15 23:31:00 +01:00
Guillaume Gomez
38772f1491
Rollup merge of #81030 - ehuss:update-mdbook, r=Mark-Simulacrum
...
Update mdbook
Just a few small fixes and changes, see https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-046 for a list.
2021-01-15 23:30:58 +01:00
Guillaume Gomez
033faf9499
Rollup merge of #80515 - GuillaumeGomez:js-for-loop-perf, r=Nemo157,jyn514
...
Improve JS performance by storing length before comparing to it in loops
Since https://github.com/rust-lang/rust/pull/79052 is quite complicated to review, I suggested to split into smaller parts. This first part is mostly about saving the array length into a variable (I tried to not change anything else as much as possible 😃 ).
r? `@jyn514`
2021-01-15 23:30:53 +01:00
Guillaume Gomez
b7a9d6a51f
Rollup merge of #77693 - bugadani:issue-59352, r=oli-obk
...
Add test for #59352
Issue #59352 reported an optimization regression with rustc 1.32.0+. That regression could be tracked to a change that caused a function to miss the size limit of llvm's inlining, which results in an unreachable panicing branch being generated.
Enabling mir inline solves the issue, but is currently only done for `mir-opt-level>=2`.
This PR adds a test that can serve as a regression test for #59352 , if/when mir inlining gets mature enough for opt-level 1, or some other optimization can remove the panic.
2021-01-15 23:30:51 +01:00
Smitty
e10555c658
Re-enable all num tests on WASM
...
This was partially done by #47365 , but a few tests
were missed in that PR.
2021-01-15 16:58:44 -05:00
Guillaume Gomez
e7276006ea
Use Array.some instead of onEach to have better performance
2021-01-15 22:52:33 +01:00
Guillaume Gomez
7cd8128da3
Improve JS performance by storing length before comparing to it in loops
2021-01-15 22:52:33 +01:00
Jason Newcomb
9146a77032
Update clippy_lints/src/redundant_slicing.rs
...
Co-authored-by: Philipp Krones <hello@philkrones.com>
2021-01-15 16:41:24 -05:00
Jason Newcomb
bf028b3f4a
fix copy-paste error
2021-01-15 16:41:22 -05:00
Jason Newcomb
27c0d6c14b
don't lint external macro expansions
2021-01-15 16:41:20 -05:00
Jason Newcomb
2a41d40807
fix new lint error
2021-01-15 16:41:17 -05:00
Jason Newcomb
837bc99065
Initial implementation of redundant_slicing lint
2021-01-15 16:41:13 -05:00
bors
fcbd305ee9
Auto merge of #80602 - tgnottingham:cratemetadata_you_aint_special, r=michaelwoerister
...
Remove DepKind::CrateMetadata and pre-allocation of DepNodes
Remove much of the special-case handling around crate metadata
dependency tracking by replacing `DepKind::CrateMetadata` and the
pre-allocation of corresponding `DepNodes` with on-demand invocation
of the `crate_hash` query.
2021-01-15 21:13:35 +00:00
Joshua Nelson
5053db7c00
Don't make tools responsible for checking unknown and renamed lints
...
Previously, clippy (and any other tool emitting lints) had to have their
own separate UNKNOWN_LINTS pass, because the compiler assumed any tool
lint could be valid. Now, as long as any lint starting with the tool
prefix exists, the compiler will warn when an unknown lint is present.
2021-01-15 16:08:28 -05:00
Han Mertens
32a20f4433
Change rebuild heuristic in BinaryHeap::append
...
See #77433 for why the new heuristic was chosen.
Fixes #77433
2021-01-15 21:50:05 +01:00
Matthew Jasper
5db5d8f87e
Make hitting the recursion limit in projection non-fatal
...
This is relied on by wundergraph.
2021-01-15 20:45:38 +00:00
LingMan
ba1f036c7a
Drop a few unneeded borrows
2021-01-15 21:29:28 +01:00
bors
3577cf79de
Auto merge of #6500 - Javier-varez:case_sensitive_file_extensions, r=llogiq
...
Case sensitive file extensions
Closes #6425
Looks for ends_with methods calls with case sensitive extension comparisons.
changelog: Add new lint that warns about case-sensitive file extension comparisons.
2021-01-15 19:49:39 +00:00
Joshua Nelson
d11855a8ce
Rename VariantKind -> Variant
...
There's no `Variant`, so it seems silly to have `Kind`.
2021-01-15 13:55:03 -05:00
Joshua Nelson
dd459a2be6
Remove useless clean::Variant
struct
...
It had exactly one field and no special behavior, so there was no point.
2021-01-15 13:54:59 -05:00
bors
bc39d4d9c5
Auto merge of #81043 - hyd-dev:update-miri, r=RalfJung
...
Update Miri
Fixes #80907 .
r? `@RalfJung`
2021-01-15 18:17:09 +00:00
ThibsG
46aa654c2d
Fix test due to recent Rustup merge
2021-01-15 18:58:48 +01:00
ThibsG
83f1abff48
Fix FP with empty return for needless_return
lint
2021-01-15 18:57:56 +01:00
Yoshua Wuyts
b50df6d31c
Stabilize core::slice::fill_with
2021-01-15 18:51:09 +01:00
Rune Tynan
31b17f513b
Add warning to compare.py about error messages
2021-01-15 12:50:05 -05:00
Rune Tynan
e42c1b9c2a
Fix JSON test
2021-01-15 12:50:04 -05:00
Rune Tynan
2a0c9e28cb
Address nit
2021-01-15 12:50:04 -05:00
Rune Tynan
e3274fd148
Remove doctree::Import
2021-01-15 12:49:45 -05:00
Dániel Buga
a0c5857131
Add test for #59352
2021-01-15 18:44:50 +01:00
John-John Tedro
e8757af311
Use Result and rename to filter_map
...
The use of Result allows for making use of a reconstructed original value on failed
projections.
2021-01-15 17:52:48 +01:00
1000teslas
3e9c95b9d4
Update compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs
...
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-01-16 03:32:54 +11:00
bors
2d1e129851
Auto merge of #6574 - Jarcho:single_match_eq, r=Manishearth
...
single_match: suggest `if` over `if let` when possible
fixes : #173
changelog: single_match: suggest `if` over `if let` when possible
2021-01-15 16:25:03 +00:00
hyd-dev
f3a6cad625
Update Miri
...
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-01-16 00:04:32 +08:00
bors
e48eb37b94
Auto merge of #80974 - ehuss:update-cargo, r=ehuss
...
Update cargo
10 commits in 329895f5b52a358e5d9ecb26215708b5cb31d906..a73e5b7d567c3036b296fc6b33ed52c5edcd882e
2021-01-06 00:01:52 +0000 to 2021-01-12 23:45:39 +0000
- Sort available binaries when multiple (rust-lang/cargo#9066 )
- Fix misspelling of environment variable (rust-lang/cargo#9067 )
- Remove statement that opt-level 0 turns on debug (rust-lang/cargo#9070 )
- Fix `links` vars showing up for testing packages (rust-lang/cargo#9065 )
- Fix unit_for computation on proc-macros in shared workspace. (rust-lang/cargo#9059 )
- Document `could not find the github team` error on `cargo owner --add` (rust-lang/cargo#9000 )
- Unstable section of cargo/config.toml takes bools (rust-lang/cargo#9057 )
- [doc] add note about empty environment variables for missing manifest keys (rust-lang/cargo#9053 )
- another round of clippy lint fixes (rust-lang/cargo#9051 )
- Updated display message of cargo metadata --help (rust-lang/cargo#9050 )
2021-01-15 15:26:05 +00:00
John-John Tedro
0660b8b5a5
Introduce {Ref, RefMut}::try_map for optional projections
2021-01-15 13:47:00 +01:00
bors
18ec4a9a74
Auto merge of #80625 - jyn514:python-what-python, r=Mark-Simulacrum
...
Choose the version of python at runtime (portable version)
r? `@Mark-Simulacrum`
Fixed version of https://github.com/rust-lang/rust/pull/80585 . The goal is to avoid giving 'error: python3 required' when downloading LLVM from CI and instead default to python3 where possible.
This has some minor overhead when you have `python` as python2, but almost nothing compared to actually running the build.
2021-01-15 12:26:09 +00:00
bors
9490fdca09
Auto merge of #6589 - giraffate:add_notes_of_prioritization_labels_to_doc, r=flip1995
...
Add notes of prioritization labels to doc
Refer to https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/New.20prioritization.20labels .
changelog: none
2021-01-15 10:40:35 +00:00
Philipp Krones
8a77f63879
Fix formulations in label descriptions
2021-01-15 11:30:58 +01:00
bors
9ea66e946e
Auto merge of #6555 - stanislav-tkach:patch-1, r=flip1995
...
Remove duplication in the manual_ok_or lint example
changelog: none
2021-01-15 10:27:47 +00:00
flip1995
488153ff2f
Merge commit '953f024793dab92745fee9cd2c4dee6a60451771' into clippyup
2021-01-15 10:56:44 +01:00
flip1995
3e236b3d1d
Merge commit '953f024793dab92745fee9cd2c4dee6a60451771' into clippyup
2021-01-15 10:56:44 +01:00
bors
953f024793
Auto merge of #6586 - flip1995:rustup, r=flip1995
...
Rustup
r? `@ghost`
changelog: FP fix: [`needless_return`] no longer triggers inside macros.
2021-01-15 09:48:15 +00:00
flip1995
f18cf82ca8
Don't trigger needless_return lint in macros
2021-01-15 10:41:29 +01:00
flip1995
0c5ba9a883
Bump nightly version to 2021-01-15
2021-01-15 10:40:17 +01:00
flip1995
9bd037d0b5
Merge remote-tracking branch 'upstream/master' into rustup
2021-01-15 10:39:53 +01:00
bors
4e208f6a3a
Auto merge of #81035 - JohnTitor:rollup-9m03awf, r=JohnTitor
...
Rollup of 5 pull requests
Successful merges:
- #80254 (Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`)
- #80834 (Remove unreachable panics from VecDeque::{front/back}[_mut])
- #80944 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)
- #81008 (Don't ICE when computing a layout of a generator tainted by errors)
- #81023 (Remove doctree::Variant)
Failed merges:
- #81033 (Remove useless `clean::Variant` struct)
r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-15 09:27:21 +00:00
Yuki Okushi
7286be15fa
Rollup merge of #81023 - CraftSpider:rustdoc-remove-variant, r=jyn514
...
Remove doctree::Variant
This was easy, probably was missed when whatever used it was removed
2021-01-15 18:26:18 +09:00
Yuki Okushi
ce06df2e4a
Rollup merge of #81008 - tmiasko:generator-layout-err, r=tmandry
...
Don't ICE when computing a layout of a generator tainted by errors
Fixes #80998 .
2021-01-15 18:26:16 +09:00
Yuki Okushi
a584d87417
Rollup merge of #80944 - LingMan:map_or, r=nagisa
...
Use Option::map_or instead of `.map(..).unwrap_or(..)`
``@rustbot`` modify labels +C-cleanup +T-compiler
2021-01-15 18:26:14 +09:00
Yuki Okushi
1b8fd02daa
Rollup merge of #80834 - bugadani:vecdeque, r=oli-obk
...
Remove unreachable panics from VecDeque::{front/back}[_mut]
`VecDeque`'s `front`, `front_mut`, `back` and `back_mut` methods are implemented in terms of the index operator, which causes these functions to contain [unreachable panic calls](https://rust.godbolt.org/z/MTnq1o ).
This PR reimplements these methods in terms of `get[_mut]` instead.
2021-01-15 18:26:11 +09:00