Vadim Petrochenkov
d0c63bccc5
parser: Cleanup LazyTokenStream
and avoid some clones
...
by using a named struct instead of a closure.
2020-10-31 01:56:34 +03:00
bors
0d033dee3e
Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obk
...
TypeVisitor: use `std::ops::ControlFlow` instead of `bool`
Implements MCP rust-lang/compiler-team#374 .
Blocked on FCP in rust-lang/compiler-team#374 .
r? `@lcnr` cc `@jonas-schievink`
2020-10-30 22:53:55 +00:00
Eduardo Broto
f8ac1f99ef
Address suggestions in PR review
2020-10-30 23:47:22 +01:00
Eduardo Broto
d958269fe5
Rename single_char_push_str to single_char_add_str
2020-10-30 23:29:44 +01:00
Matthias Krüger
c1eb8ceede
get_hint_if_single_char_arg: fix bug where multi-char letters are not detected properly
2020-10-30 23:29:44 +01:00
Matthias Krüger
c6412aeebc
handle macros returning Strings in single_char_push_str and single_char_insert_str
2020-10-30 23:29:38 +01:00
Matthias Krüger
2350ee75b2
single_char_push_str lint using insert_str() on single-char literals and suggest insert()
...
changelog: single_char_push_str: lint using string.insert_str() with single char literals and suggests string.insert() with a char
Fixes #6026
2020-10-30 23:28:17 +01:00
bors
084b203988
Auto merge of #6260 - matthiaskrgr:ices, r=ebroto
...
add a couple of ICE testcases
Fixes #6250
Fixes #6251
Fixes #6252
Fixes #6255
Fixes #6256
changelog: none
2020-10-30 22:19:11 +00:00
bors
7387b87bb9
Auto merge of #6197 - ThibsG:ImproveFilterNext, r=ebroto
...
Improve suggestions for several lints
This PR is a follow-up of this [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/filter_next.20lint ).
It unifies placeholders for `methods` module and improves several suggestions for `filter_next`, `filter_map_next` and `map_unwrap_or` lints.
changelog: none
2020-10-30 21:58:09 +00:00
Mike Hommey
5fb5707f35
Add LLVM upgrades from 7 to 10 to RELEASES.md
...
Fixes #78464
2020-10-31 06:54:39 +09:00
Michael Howell
17b8ca952b
Pull theme picker keyboard code into main.js
...
Most of the code in mod.rs should be code that really needs to have
the list of available themes inlined into it.
2020-10-30 14:31:04 -07:00
Michael Howell
90c7c634e3
Add comment describing the Escape key weirdness
2020-10-30 13:54:36 -07:00
Michael Howell
6918a17aa4
Add aria roles for theme picker menu
2020-10-30 13:35:41 -07:00
Michael Howell
ac3a434ed9
Allow the theme picker to work with arrow keys
...
This is mostly motivated by docs.rs. It's really weird
when arrow keys work in the top dropdown menu, but don't work
in other dropdown menus on the same page.
2020-10-30 13:34:30 -07:00
Federico Poli
97a65b6f81
Add option to customize the nll-facts' folder location
2020-10-30 21:33:08 +01:00
Michael Howell
300362e0e4
Close the theme picker when Escape is pressed
2020-10-30 13:03:01 -07:00
Benoît du Garreau
307cc11beb
Constantify more BTreeMap and BTreeSet functions
...
- BTreeMap::len
- BTreeMap::is_empty
- BTreeSet::len
- BTreeSet::is_empty
2020-10-30 19:24:08 +01:00
Randall Mason
9f402c991b
Clarify allow/warn/deny. Remove enable/disable.
...
Disable and enable when not specifically explained were not clear to me
as an English language speaker, but I was able to figure it out fairly
easily due to the examples having A/W, which I assumed meant `allow` and
`warn`. I removed both words to be sure it was clear as well as
extending the note on what deny means. It now includes a statement on
exactly what each word means.
2020-10-30 12:16:11 -05:00
bors
ffe52882ed
Auto merge of #78424 - jyn514:THE-PAPERCLIP-COMETH, r=davidtwco
...
Fix some more clippy warnings
Found while working on https://github.com/rust-lang/rust/pull/77351 . It turns out that `x.py clippy --fix` does work on that branch as long as you pass `CARGOFLAGS=--lib`.
2020-10-30 14:24:02 +00:00
Joshua Nelson
5339bd1ebe
Add back missing comments
2020-10-30 10:13:41 -04:00
Joshua Nelson
57c6ed0c07
Fix even more clippy warnings
2020-10-30 10:13:39 -04:00
Joshua Nelson
bfecb18771
Fix some more clippy warnings
2020-10-30 10:12:56 -04:00
Maarten de Vries
59c6ae615e
Use SOCK_CLOEXEC and accept4() on more platforms.
2020-10-30 14:20:10 +01:00
bors
0be654482c
Auto merge of #6229 - henil:improve-integer-division-lint, r=phansch
...
Update the existing arithmetic lint
re: #6209
Updates the lint to not the error message if RHS of binary operation `/` of `%` is a literal/constant that is not `0` or `-1`, as suggested [here](https://github.com/rust-lang/rust-clippy/issues/6209#issuecomment-715624354 )
changelog: Expand [`integer_arithmetic`] to work with RHS literals and constants
2020-10-30 12:37:46 +00:00
henil
fa0a78b130
removed lint for division/modulo for literal 0
2020-10-30 17:31:10 +05:30
LeSeulArtichaut
1c8c3d14ef
Remove implicit Continue
type
2020-10-30 12:27:47 +01:00
LeSeulArtichaut
9433eb83fe
Remove implicit Continue
type
2020-10-30 12:27:47 +01:00
LeSeulArtichaut
4a06145ced
Use ControlFlow::is{break,continue}
2020-10-30 12:27:46 +01:00
LeSeulArtichaut
24e1a7e656
Use ControlFlow::is{break,continue}
2020-10-30 12:27:46 +01:00
LeSeulArtichaut
fa79cc4f6f
TypeVisitor: use ControlFlow
in clippy
2020-10-30 12:27:45 +01:00
LeSeulArtichaut
8e4cf0b3ed
TypeVisitor: use ControlFlow
in clippy
2020-10-30 12:27:45 +01:00
LeSeulArtichaut
61f8182cec
TypeVisitor: use ControlFlow
in rustc_{mir,privacy,traits,typeck}
2020-10-30 12:27:44 +01:00
LeSeulArtichaut
4fe735b320
TypeVisitor: use ControlFlow
in rustc_{infer,lint,trait_selection}
2020-10-30 12:27:34 +01:00
LeSeulArtichaut
2c85b6fae0
TypeVisitor: use std::ops::ControlFlow
instead of bool
2020-10-30 12:25:24 +01:00
bors
74d8fbb7a4
Auto merge of #6200 - rail-rain:borrowed_box_invalid_sugg, r=phansch
...
fix the error-causing suggestion of 'borrowed_box'
Fixes #3128
Fix the suggestion of 'borrowed_box', which causes a syntax error because it misses necessary parentheses.
---
changelog: Fix the error-causing suggestion of 'borrowed_box'
2020-10-30 10:40:44 +00:00
bors
388ef34904
Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitor
...
Rollup of 8 pull requests
Successful merges:
- #77334 (Reorder benches const variable)
- #77888 (Simplify a nested bool match)
- #77921 (f64: Refactor collapsible_if)
- #78523 (Revert invalid `fn` return type parsing change)
- #78524 (Avoid BorrowMutError with RUSTC_LOG=debug)
- #78545 (Make anonymous binders start at 0)
- #78554 (Improve wording of `core::ptr::drop_in_place` docs)
- #78556 (Link to pass docs from NRVO module docs)
Failed merges:
- #78424 (Fix some more clippy warnings)
r? `@ghost`
2020-10-30 10:01:49 +00:00
Yuki Okushi
2471a7cdaa
Rollup merge of #78556 - camelid:mir-opt-nrvo-docs, r=jyn514
...
Link to pass docs from NRVO module docs
It can be easy to miss that this is documented on the pass's struct if you are
looking at the module docs.
Cc https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20is.20NRVO.3F
2020-10-30 18:00:58 +09:00
Yuki Okushi
73d0340fd5
Rollup merge of #78554 - camelid:improve-drop_in_place-docs-wording, r=jyn514
...
Improve wording of `core::ptr::drop_in_place` docs
And two small intra-doc link conversions in `std::{f32, f64}`.
2020-10-30 18:00:58 +09:00
Yuki Okushi
05f80f03a9
Rollup merge of #78545 - jackh726:anonymous, r=oli-obk
...
Make anonymous binders start at 0
A few changes to some test outputs, but these actually look *more* correct to me.
2020-10-30 18:00:56 +09:00
Yuki Okushi
f8539221d0
Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011
...
Avoid BorrowMutError with RUSTC_LOG=debug
```console
$ touch empty.rs
$ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs
```
Fails with a `BorrowMutError` because source map files are already
borrowed while `features_query` attempts to format a log message
containing a span.
Release the borrow before the query to avoid the issue.
2020-10-30 18:00:54 +09:00
Yuki Okushi
8111706c18
Rollup merge of #78523 - estebank:fix-return-type-parse-regression, r=dtolnay
...
Revert invalid `fn` return type parsing change
Revert one of the changes in #78379 .
Fix #78507 .
2020-10-30 18:00:53 +09:00
Yuki Okushi
02a4b58a3f
Rollup merge of #77921 - wcampbell0x2a:f64-collapsible-if, r=jyn514
...
f64: Refactor collapsible_if
2020-10-30 18:00:49 +09:00
Yuki Okushi
439ea4b621
Rollup merge of #77888 - LingMan:ast_pretty_tt_prepend_space, r=jyn514
...
Simplify a nested bool match
Logically this first eliminates the innermost match by merging the patterns.
Then, in a second step, turns the newly innermost match into a `matches!` call.
2020-10-30 18:00:45 +09:00
Yuki Okushi
0723b274d2
Rollup merge of #77334 - pickfire:patch-4, r=jyn514
...
Reorder benches const variable
Move LEN so it is is read in order.
2020-10-30 18:00:41 +09:00
kadmin
a7e8208074
Add regression test
2020-10-30 07:49:14 +00:00
bors
8df58ae03a
Auto merge of #78393 - SNCPlay42:match-if-guard, r=tmandry
...
Always record reference to binding in match if guards
When encountering a binding from a `match` pattern in its `if` guard when computing a generator's interior types, we must always record the type of a reference to the binding because of how `if` guards are lowered to MIR. This was missed in #75213 because the binding in that test case was autorefed and we recorded that adjusted type anyway.
Fixes #78366
2020-10-30 07:05:57 +00:00
Camelid
f558d96253
Link to pass docs from NRVO module docs
2020-10-29 23:05:45 -07:00
Camelid
fee4f8feb0
Improve wording of core::ptr::drop_in_place
docs
...
And two small intra-doc link conversions in `std::{f32, f64}`.
2020-10-29 20:09:29 -07:00
bors
0d33ab7af4
Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakis
...
Handle type errors in closure/generator upvar_tys
Fixes #77993
2020-10-30 03:00:13 +00:00
Joshua Nelson
8cf7d66d0a
Create config.toml in the current directory, not the top-level directory
...
See https://github.com/rust-lang/rust/issues/78509 for discussion.
2020-10-29 21:23:55 -04:00