Commit graph

129203 commits

Author SHA1 Message Date
Yuki Okushi
22c5e0c347 Rollup merge of #77560 - rschoon:fix-litkind-rc-bytebuf, r=lcnr
Fix LitKind's byte buffer to use refcounted slice

While working on adding a new lint for clippy (see https://github.com/rust-lang/rust-clippy/pull/6044) for avoiding shared ownership of "mutable buffer" types (such as using `Rc<Vec<T>>` instead of `Rc<[T]>`), I noticed a type exported from rustc_ast and used by clippy gets caught by the lint. This PR fixes the exported type.

This PR includes the actual change to clippy too, but I will open a PR directly against clippy for that part (although it will currently fail to build there).
2020-10-06 16:26:11 +09:00
Yuki Okushi
5c1e01196d
Rollup merge of #77560 - rschoon:fix-litkind-rc-bytebuf, r=lcnr
Fix LitKind's byte buffer to use refcounted slice

While working on adding a new lint for clippy (see https://github.com/rust-lang/rust-clippy/pull/6044) for avoiding shared ownership of "mutable buffer" types (such as using `Rc<Vec<T>>` instead of `Rc<[T]>`), I noticed a type exported from rustc_ast and used by clippy gets caught by the lint. This PR fixes the exported type.

This PR includes the actual change to clippy too, but I will open a PR directly against clippy for that part (although it will currently fail to build there).
2020-10-06 16:26:11 +09:00
Yuki Okushi
2970af8e28
Rollup merge of #77559 - camelid:fix-rustdoc-warnings-invalid-rust-syntax, r=lcnr
Fix rustdoc warnings about invalid Rust syntax
2020-10-06 16:26:09 +09:00
Yuki Okushi
54d72d73e9
Rollup merge of #77558 - thomcc:defaults-toml-extension, r=jyn514
Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml}

This allows these files to have okay syntax highlighting in editors, and helps avoid nagging from editors which want to suggest that I install a plugin for `*.library` files to view the `config.toml.library` or whatever.

It's a very minor change.

r?@jyn514
2020-10-06 16:26:07 +09:00
Yuki Okushi
2b5049b5ea
Rollup merge of #77555 - camelid:patch-8, r=Mark-Simulacrum
Allow anyone to set regression labels

Cc https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/improve.20reporting.20of.20regressions/near/212245535

r? @Mark-Simulacrum
2020-10-06 16:26:05 +09:00
Yuki Okushi
a7b721968a Rollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-override-forbid-in-same-scope, r=petrochenkov
Disallow overriding forbid in same scope

Rebased #73379.

Fixes #70819.
2020-10-06 16:26:04 +09:00
Yuki Okushi
bc600c3905
Rollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-override-forbid-in-same-scope, r=petrochenkov
Disallow overriding forbid in same scope

Rebased #73379.

Fixes #70819.
2020-10-06 16:26:04 +09:00
Yuki Okushi
eac25fefaf
Rollup merge of #77528 - tamird:avoid-cast-net-parser, r=dtolnay
Avoid unchecked casts in net parser

Once this and #77426 are in, I'll send another PR adding scope id parsing.

r? @dtolnay
2020-10-06 16:26:02 +09:00
Yuki Okushi
d7123c2393
Rollup merge of #77228 - GuillaumeGomez:maybeuninit-examples, r=pickfire
Add missing examples for MaybeUninit

r? @Dylan-DPC
2020-10-06 16:26:00 +09:00
Yuki Okushi
d50349ba8d
Rollup merge of #76995 - LingMan:middle_matches, r=varkor
Reduce boilerplate with the matches! macro

Replaces simple bool `match`es of the form

    match $expr {
        $pattern => true
        _ => false
    }

and their inverse with invocations of the matches! macro.

Limited to rustc_middle for now to get my feet wet.
2020-10-06 16:25:58 +09:00
Yuki Okushi
97ee62cee4
Rollup merge of #76855 - jyn514:platform-specific, r=ollie27
Revamp rustdoc docs about documentation using `cfg`

- Move `cfg(doc)` out of `unstable-features`. It's not unstable.
- Remove outdated reference to `everybody_loops`.
- Improve wording in various places
- Give an example of code this allows (and does not allow)
- Link to `cfg(doc)` in `doc(cfg)` documentation. Since one is stable
and the other is not, don't combine them.
- Cleanup wording for `doc(cfg)`
- Incorporate changes from #76849
- Mention that `doc(cfg)` is also for features

Addresses https://github.com/rust-lang/rust/pull/76849#issuecomment-694516199.
Obsoletes https://github.com/rust-lang/rust/pull/76849 (I made sure to fix the weird dashes too).
r? @steveklabnik
2020-10-06 16:25:55 +09:00
Yuki Okushi
59476e9e57
Rollup merge of #76388 - poliorcetics:system-time-document-panic, r=KodrAus
Add a note about the panic behavior of math operations on time objects

Fixes #71226.
2020-10-06 16:25:53 +09:00
bors
c9fdeef643 Auto merge of #6078 - ebroto:unnecessary_sort_by_take_2, r=phansch
unnecessary sort by: avoid dereferencing the suggested closure parameter

This change tries to simplify the solution for problematic cases but is less restrictive than  #6006.

* We can't dereference shared references to non-Copy types, so the new suggestion does not do that. Note that this implies that the suggested closure parameter will be a reference.
* We can't take a reference to the closure parameter in the returned key, so we don't lint in those cases. This can happen either because the key borrows from the parameter (e.g. `|a| a.borrows()`), or because we suggest `|a| Reverse(a)`. If we did we would hit this error:
```
error: lifetime may not live long enough
  --> /home/ebroto/src/ebroto-clippy/tests/ui/unnecessary_sort_by.fixed:19:25
   |
19 |     vec.sort_by_key(|b| Reverse(b));
   |                      -- ^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
   |                      ||
   |                      |return type of closure is Reverse<&'2 isize>
   |                      has type `&'1 isize`

error: aborting due to previous error
```

Note that Clippy does not currently have the (MIR-based) machinery necessary to check that what is borrowed is actually the closure parameter.

changelog: [`unnecessary_sort_by`]: avoid dereferencing the suggested closure parameter

Fixes #6001
2020-10-06 06:59:33 +00:00
Philipp Hansch
9b4ceee593
integration tests: Replace lazy_static with SyncLazy 2020-10-06 08:20:18 +02:00
Philipp Hansch
4b459596a9
clippy_dev: Replace lazy_static with SyncLazy 2020-10-06 08:18:11 +02:00
Dan Aloni
d25c580453 Fix rustc_def_path to show the full path and not the trimmed one 2020-10-06 09:17:44 +03:00
Dylan MacKenzie
9beb6f81e4 Make impl Trait unstable in all contexts 2020-10-05 21:44:00 -07:00
Dylan MacKenzie
c4ef5fdf8f Remove fn from feature name 2020-10-05 21:44:00 -07:00
Dylan MacKenzie
af03b1143e Make min_const_fn impl Trait test into a gate test 2020-10-05 19:57:27 -07:00
Dylan MacKenzie
2e412fc8e4 Bless test outupt 2020-10-05 19:57:27 -07:00
Dylan MacKenzie
7a0c66bad1 Use new feature gate in impl-trait tests 2020-10-05 19:57:27 -07:00
Dylan MacKenzie
c959eefa74 Add requisite feature gates in the standard library 2020-10-05 19:57:25 -07:00
Dylan MacKenzie
e1d76818b2 Add #![feature(const_fn_impl)] 2020-10-05 19:56:50 -07:00
Cassandra Fridkin
0845627f73
Make changes based on @jyn514's comments 2020-10-05 22:00:43 -04:00
Cassandra Fridkin
d585c96eaf
Add install_git_hook_maybe to setup.rs 2020-10-05 20:22:11 -04:00
Cassandra Fridkin
68ca4742c5
Clean up pre-commit.sh 2020-10-05 19:35:06 -04:00
Joshua Nelson
dc5a000d79 Revamp rustdoc docs about documentation using cfg
- Move `cfg(doc)` out of `unstable-features`. It's not unstable.
- Remove outdated reference to `everybody_loops`.
- Improve wording in various places
- Give an example of code this allows (and does not allow)
- Link to `cfg(doc)` in `doc(cfg)` documentation. Since one is stable
and the other is not, don't combine them.
- Cleanup wording for `doc(cfg)`
- Incorporate changes from #76849
- Mention that `doc(cfg)` is also for features
2020-10-05 19:06:38 -04:00
Cassandra Fridkin
f53d436638
Remove the rust stuff and just make it a simple shell script
It's ok, now I'm writing enough Rust that i'm able to get my fix elsewhere
2020-10-05 18:59:47 -04:00
Cassandra Fridkin
7de557bf9c
Move script to src/etc 2020-10-05 18:57:48 -04:00
Cassandra Fridkin
44af74f6dd
Merge branch 'master' into hooks 2020-10-05 18:49:51 -04:00
Tim Vermeulen
1d27a508d1 Test with non-fused iterators 2020-10-06 00:48:34 +02:00
Eduardo Broto
13781ae2f8 Remove "thanks" section 2020-10-06 00:09:45 +02:00
Camelid
c8d25af698 Fixup 2020-10-05 15:07:27 -07:00
Vadim Petrochenkov
219c66c55c rustc_parse: Make Parser::unexpected public and use it in built-in macros 2020-10-06 00:23:36 +03:00
Vadim Petrochenkov
299136b9c7 builtin_macros: Fix use of interpolated identifiers in asm! 2020-10-06 00:18:03 +03:00
bors
3239b46e92 Auto merge of #6114 - FliegendeWurst:no-mistyped-fraction, r=Manishearth
Do not lint float fractions in `mistyped_literal_suffixes`

As suggested in https://github.com/rust-lang/rust-clippy/issues/4706#issuecomment-544797928, the fractional part is now ignored (the integer part is checked instead).

Fixes: #4706

changelog: `mistyped_literal_suffixes` no longer warns on the fractional part of a float (e.g. 713.23_64)
2020-10-05 21:17:37 +00:00
Tim Vermeulen
bcacfe1dbf Add tests 2020-10-05 22:55:48 +02:00
Tim Vermeulen
c5d6a0dd96 Implement iter::Chain::{advance_by, advance_back_by} 2020-10-05 22:55:48 +02:00
bors
411e3bac56 Auto merge of #6118 - ebroto:rustup, r=ebroto
Rustup

changelog: none

r? `@ghost`
2020-10-05 20:44:31 +00:00
Eduardo Broto
5554641fce Fix rustup fallout 2020-10-05 22:32:04 +02:00
Eduardo Broto
5f492490a3 Merge remote-tracking branch 'upstream/master' into rustup 2020-10-05 22:13:44 +02:00
Aaron Hill
8d11f90a16
Record expansion_that_defined into crate metadata
Fixes #77523

Now that hygiene serialization is implemented, we also need to record
`expansion_that_defined` so that we properly handle a foreign
`SyntaxContext`.
2020-10-05 16:01:19 -04:00
Igor Matuszewski
1b9c45bddc Update RLS and Rustfmt 2020-10-05 21:40:20 +02:00
bors
a1dfd2490a Auto merge of #77080 - richkadel:llvm-coverage-counters-2, r=tmandry
Working branch-level code coverage

Add a generalized implementation for computing branch-level coverage spans.

This iteration resolves some of the challenges I had identified a few weeks ago.

I've tried to implement a solution that is general enough to work for a lot of different graphs/patterns. It's encouraging to see the results on fairly large and complex crates seem to meet my expectations. This may be a "functionally complete" implementation.

Except for bug fixes or edge cases I haven't run into yet, the next and essentially final step, I think, is to replace some Counters with CounterExpressions (where their counter values can be computed by adding or subtracting other counters/expressions).

Examples of branch-level coverage support enabled in this PR:

* https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_drop_trait.txt
* https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_if.txt
* https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_if_else.txt
* https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_simple_loop.txt
* https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_show_coverage.coverage_of_simple_match.txt
* ... _and others in the same directory_

Examples of coverage analysis results (MIR spanview files) used to inject counters in the right `BasicBlocks`:

* https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_drop_trait/coverage_of_drop_trait.main.-------.InstrumentCoverage.0.html
* https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if/coverage_of_if.main.-------.InstrumentCoverage.0.html
* https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html
* https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_simple_loop/coverage_of_simple_loop.main.-------.InstrumentCoverage.0.html
* https://htmlpreview.github.io/?https://github.com/richkadel/rust/blob/llvm-coverage-counters-2/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_simple_match/coverage_of_simple_match.main.-------.InstrumentCoverage.0.html
* ... _and others in the same directory_

Here is some sample coverage output after compiling a few real-world crates with the new branch-level coverage features:

<img width="801" alt="Screen Shot 2020-09-25 at 1 03 11 PM" src="https://user-images.githubusercontent.com/3827298/94316848-fd882c00-ff39-11ea-9cff-0402d3abd1e7.png">
<img width="721" alt="Screen Shot 2020-09-25 at 1 00 36 PM" src="https://user-images.githubusercontent.com/3827298/94316886-11cc2900-ff3a-11ea-9d03-80b26c8a5173.png">
<img width="889" alt="Screen Shot 2020-09-25 at 12 54 57 PM" src="https://user-images.githubusercontent.com/3827298/94316900-18f33700-ff3a-11ea-8a80-58f67d84b8de.png">

r? `@tmandry`
FYI: `@wesleywiser`
2020-10-05 19:34:44 +00:00
Eric Huss
35192ff574 Fix span for unicode escape suggestion. 2020-10-05 11:19:08 -07:00
Dylan MacKenzie
af4b13283f Move EarlyOtherwiseBranch to mir-opt-level 2
This didn't have an effect in most cases, and is not trivially sound.
Let it bake at `mir-opt-level=2` for a while.
2020-10-05 10:21:14 -07:00
bors
ea7e131435 Auto merge of #77171 - VFLashM:better_sso_structures, r=oli-obk
Better sso structures

This change greatly expands interface of MiniSet/MiniMap and renames them because they are no longer "Mini".
2020-10-05 17:18:01 +00:00
Dylan MacKenzie
3b87398738 Print to stderr when a graphviz file can't be written
`warn` prints nothing by default
2020-10-05 10:14:40 -07:00
Dylan MacKenzie
29e5e6e766 Use MIR dump interface for dataflow 2020-10-05 10:14:40 -07:00
Rich Kadel
6f627663a7 Renamed tests to avoid exceeding Windows max path limit 2020-10-05 09:40:25 -07:00