]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #88242 - bonega:allocation_range, r=oli-obk
bors [Wed, 25 Aug 2021 02:17:41 +0000 (02:17 +0000)]
Auto merge of #88242 - bonega:allocation_range, r=oli-obk

Use custom wrap-around type instead of RangeInclusive

Two reasons:

1. More memory is allocated than necessary for `valid_range` in `Scalar`. The range is not used as an iterator and `exhausted` is never used.
2. `contains`, `count` etc. methods in `RangeInclusive` are doing very unhelpful(and dangerous!) things when used as a wrap-around range. - In general this PR wants to limit potentially confusing methods, that have a low probability of working.

Doing a local perf run, every metric shows improvement except for instructions.
Max-rss seem to have a very consistent improvement.

Sorry - newbie here, probably doing something wrong.

2 years agoAdd type of a let tait test impl trait straight in let
Santiago Pastorino [Wed, 25 Aug 2021 01:52:41 +0000 (22:52 -0300)]
Add type of a let tait test impl trait straight in let

2 years agoAdd type of a let tait test
Santiago Pastorino [Wed, 25 Aug 2021 01:10:38 +0000 (22:10 -0300)]
Add type of a let tait test

2 years agoAuto merge of #88271 - sexxi-goose:liveness, r=nikomatsakis
bors [Tue, 24 Aug 2021 23:30:44 +0000 (23:30 +0000)]
Auto merge of #88271 - sexxi-goose:liveness, r=nikomatsakis

2229: Consider varaiables mentioned in closure as used

Fixes: https://github.com/rust-lang/project-rfc-2229/issues/57
r? `@nikomatsakis`

2 years agoPGO for LLVM builds on x86_64-unknown-linux-gnu in CI
Mark Rousskov [Wed, 11 Aug 2021 17:17:21 +0000 (13:17 -0400)]
PGO for LLVM builds on x86_64-unknown-linux-gnu in CI

This shows up to 5% less instruction counts on multiple benchmarks, and up to
19% wins on the -j1 wall times for rustc self-compilation.

We can afford to spend the extra cycles building LLVM essentially once more for
the x86_64-unknown-linux-gnu CI build today. The builder finishes in around 50
minutes on average, and this adds just 10 more minutes. Given the sizeable
improvements in compiler performance, this is definitely worth it.

2 years agoAuto merge of #88266 - nikomatsakis:issue-87879, r=jackh726
bors [Tue, 24 Aug 2021 20:49:55 +0000 (20:49 +0000)]
Auto merge of #88266 - nikomatsakis:issue-87879, r=jackh726

resolve type variables after checking casts

r? `@jackh726`

Fixes #87814
Fixes #88118

Supercedes #87879 (cc `@ldm0)`

2 years agoAdd SAFETY comments to core::slice::sort::partition_in_blocks
Mariano Casco [Tue, 24 Aug 2021 15:04:02 +0000 (12:04 -0300)]
Add SAFETY comments to core::slice::sort::partition_in_blocks

2 years agoMake explanations of cross-references between `make_mut` and `get_mut` more accurate
Frank Steffahn [Tue, 24 Aug 2021 19:34:12 +0000 (21:34 +0200)]
Make explanations of cross-references between `make_mut` and `get_mut` more accurate

2 years agoClarifiy weak pointers being diassociated…
Frank Steffahn [Tue, 24 Aug 2021 19:15:26 +0000 (21:15 +0200)]
Clarifiy weak pointers being diassociated…

…noting the fact that `clone` is not called.

Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
2 years agoMorph `layout_raw` query into `layout_of`.
Eduard-Mihai Burtescu [Tue, 24 Aug 2021 18:29:30 +0000 (21:29 +0300)]
Morph `layout_raw` query into `layout_of`.

2 years agouse convention for with_* methods
Andreas Liljeqvist [Tue, 24 Aug 2021 17:41:58 +0000 (19:41 +0200)]
use convention for with_* methods

2 years agoAuto merge of #87472 - inquisitivecrystal:stabilize-force-warn, r=Mark-Simulacrum
bors [Tue, 24 Aug 2021 17:41:24 +0000 (17:41 +0000)]
Auto merge of #87472 - inquisitivecrystal:stabilize-force-warn, r=Mark-Simulacrum

Stabilize and document `--force-warn`

This PR will stabilize and document the `--force-warn` command line option. It is currently a draft, pending an FCP.

I've taken the liberty of tidying up the lint level command line options a bit as part of this. The changes are quite minor and should only affect rustc's help output. I'm making them here because they're trivial and, in one case, necessary to unify the way `--force-warn` with the way the other options are displayed.

I also want to mention that `@rylev` has done a ton of work on moving this along and deserves most of the credit. I'm just the one who landed up writing this particular PR.

Resolves #86516.

2 years agoStabilise BufWriter::into_parts
Ian Jackson [Fri, 30 Apr 2021 23:38:01 +0000 (00:38 +0100)]
Stabilise BufWriter::into_parts

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agotests: add v0 structural const value demangling test.
Eduard-Mihai Burtescu [Tue, 10 Aug 2021 22:13:31 +0000 (01:13 +0300)]
tests: add v0 structural const value demangling test.

2 years agotests: add v0 `&str` const value demangling test.
Eduard-Mihai Burtescu [Tue, 10 Aug 2021 21:38:14 +0000 (00:38 +0300)]
tests: add v0 `&str` const value demangling test.

2 years agoUpdate rustc-demangle to 0.1.21.
Eduard-Mihai Burtescu [Tue, 10 Aug 2021 21:05:25 +0000 (00:05 +0300)]
Update rustc-demangle to 0.1.21.

2 years agoFix tidy
Ian Jackson [Tue, 24 Aug 2021 16:44:16 +0000 (17:44 +0100)]
Fix tidy

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agotests: shorten symbol-names/const-generics-demangling output.
Eduard-Mihai Burtescu [Tue, 10 Aug 2021 20:46:50 +0000 (23:46 +0300)]
tests: shorten symbol-names/const-generics-demangling output.

2 years agotests: support -Zsymbol-mangling-version=v0 being the default.
Eduard-Mihai Burtescu [Fri, 16 Jul 2021 15:22:14 +0000 (18:22 +0300)]
tests: support -Zsymbol-mangling-version=v0 being the default.

2 years agorustc_symbol_mangling: support structural constants and &str in v0.
Eduard-Mihai Burtescu [Fri, 16 Jul 2021 15:21:41 +0000 (18:21 +0300)]
rustc_symbol_mangling: support structural constants and &str in v0.

2 years agoFix typo (variant_id should've been variant_idx).
Eduard-Mihai Burtescu [Fri, 16 Jul 2021 12:40:33 +0000 (15:40 +0300)]
Fix typo (variant_id should've been variant_idx).

2 years agorustc_symbol_mangling: never cache placeholders in print_const.
Eduard-Mihai Burtescu [Fri, 16 Jul 2021 12:34:29 +0000 (15:34 +0300)]
rustc_symbol_mangling: never cache placeholders in print_const.

2 years agoPretty-print uninhabited const values more explicitly.
Eduard-Mihai Burtescu [Fri, 16 Jul 2021 11:12:18 +0000 (14:12 +0300)]
Pretty-print uninhabited const values more explicitly.

2 years agoFix grammar
est31 [Tue, 24 Aug 2021 15:56:39 +0000 (17:56 +0200)]
Fix grammar

2 years agoio::ErrorKind: rationalise ordering in main enum
Ian Jackson [Tue, 24 Aug 2021 15:53:58 +0000 (16:53 +0100)]
io::ErrorKind: rationalise ordering in main enum

It is useful to keep some coherent structure to this ordering.  In
particular, Other and Uncategorized should be next to each other, at
the end.

Also it seems to make sense to treat UnexpectedEof and OutOfMemory
specially, since they are not like the other errors (despite
OutOfMemory also being generatable by some OS errors).

So:
 * Move Other to the end, just before Uncategorized
 * Move Unsupported to between Interrupted and UnexpectedEof
 * Add some comments documenting where to add things

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoio::Error: alphabeticise the match in as_str()
Ian Jackson [Tue, 24 Aug 2021 15:51:58 +0000 (16:51 +0100)]
io::Error: alphabeticise the match in as_str()

There was no rationale for the previous ordering.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoUpdate tests
inquisitivecrystal [Sat, 24 Jul 2021 08:08:33 +0000 (01:08 -0700)]
Update tests

This updates tests to reflect that `force-warn` is now stable.

2 years agoDocument `force-warn`
inquisitivecrystal [Sat, 24 Jul 2021 06:31:09 +0000 (23:31 -0700)]
Document `force-warn`

Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
2 years agoStabilize `force-warn`
inquisitivecrystal [Sat, 24 Jul 2021 07:05:24 +0000 (00:05 -0700)]
Stabilize `force-warn`

2 years agoTidy up lint command line flags
inquisitivecrystal [Sat, 24 Jul 2021 06:59:17 +0000 (23:59 -0700)]
Tidy up lint command line flags

2 years agoAuto merge of #87900 - jackh726:issue-87429, r=nikomatsakis
bors [Tue, 24 Aug 2021 14:55:48 +0000 (14:55 +0000)]
Auto merge of #87900 - jackh726:issue-87429, r=nikomatsakis

Use bound vars for GAT params in param_env in check_type_bounds

Fixes #87429

2 years agoMove `named_asm_labels` to a HIR lint
asquared31415 [Thu, 19 Aug 2021 20:34:01 +0000 (16:34 -0400)]
Move `named_asm_labels` to a HIR lint

2 years agoIgnore test on Windows
Andy Wang [Tue, 24 Aug 2021 12:21:27 +0000 (13:21 +0100)]
Ignore test on Windows

2 years agoAuto merge of #87699 - ubamrein:use-iphone-deployment-target-for-llvm, r=petrochenkov
bors [Tue, 24 Aug 2021 12:13:37 +0000 (12:13 +0000)]
Auto merge of #87699 - ubamrein:use-iphone-deployment-target-for-llvm, r=petrochenkov

Allow specifying an deployment target version for all iOS llvm targets

Closes: https://github.com/rust-lang/rust/issues/79408
This pull requests adds the same procedure to define the iOS-version for the LLVM-target as was used for the simulator target and the desktop target.

This then closes the original problem mentioned in the above issue. The problem with incompatible bitcode remains, but is probably not easy fixable.

I realised that something is still not right. Try to fix that.

r? `@petrochenkov`

2 years agoImprove liveness analysis for generators
Tomasz Miąsko [Mon, 19 Apr 2021 00:00:00 +0000 (00:00 +0000)]
Improve liveness analysis for generators

Liveness analysis for generators assumes that execution always continues
normally after a yield point, not accounting for the fact that generator
could be dropped before completion.

If generators captures any variables by reference, those variables could
be used within a generator, or when the generator completes, but also
after each yield point in the case the generator is dropped.

Account for the case when generator is dropped after yielding, but
before running to the completion. This effectively considers all
variables captured by reference to be used after a yield point.

2 years agoForce inline: small functions and single call-site
Andreas Liljeqvist [Tue, 24 Aug 2021 08:18:07 +0000 (10:18 +0200)]
Force inline: small functions and single call-site

2 years agoallow specifying an ios version for the llvm target
Patrick Amrein [Mon, 2 Aug 2021 13:26:24 +0000 (15:26 +0200)]
allow specifying an ios version for the llvm target

2 years agoAuto merge of #87739 - Aaron1011:remove-used-attrs, r=wesleywiser
bors [Tue, 24 Aug 2021 03:58:22 +0000 (03:58 +0000)]
Auto merge of #87739 - Aaron1011:remove-used-attrs, r=wesleywiser

Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`

Instead of updating global state to mark attributes as used,
we now explicitly emit a warning when an attribute is used in
an unsupported position. As a side effect, we are to emit more
detailed warning messages (instead of just a generic "unused" message).

`Session.check_name` is removed, since its only purpose was to mark
the attribute as used. All of the callers are modified to use
`Attribute.has_name`

Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed
used' attribute is implemented by simply not performing any checks
in `CheckAttrVisitor` for a particular attribute.

We no longer emit unused attribute warnings for the `#[rustc_dummy]`
attribute - it's an internal attribute used for tests, so it doesn't
mark sense to treat it as 'unused'.

With this commit, a large source of global untracked state is removed.

2 years agoUpdate books
Eric Huss [Tue, 24 Aug 2021 02:42:31 +0000 (19:42 -0700)]
Update books

2 years agoAuto merge of #85556 - FabianWolff:issue-85071, r=estebank,jackh726
bors [Tue, 24 Aug 2021 01:36:09 +0000 (01:36 +0000)]
Auto merge of #85556 - FabianWolff:issue-85071, r=estebank,jackh726

Warn about unreachable code following an expression with an uninhabited type

This pull request fixes #85071. The issue is that liveness analysis currently is "smarter" than reachability analysis when it comes to detecting uninhabited types: Unreachable code is detected during type checking, where full type information is not yet available. Therefore, the check for type inhabitedness is quite crude:
https://github.com/rust-lang/rust/blob/fc81ad22c453776de16acf9938976930cf8c9401/compiler/rustc_typeck/src/check/expr.rs#L202-L205

i.e. it only checks for `!`, but not other, non-trivially uninhabited types, such as empty enums, structs containing an uninhabited type, etc. By contrast, liveness analysis, which runs after type checking, can benefit from the more sophisticated `tcx.is_ty_uninhabited_from()`:
https://github.com/rust-lang/rust/blob/fc81ad22c453776de16acf9938976930cf8c9401/compiler/rustc_passes/src/liveness.rs#L981
https://github.com/rust-lang/rust/blob/fc81ad22c453776de16acf9938976930cf8c9401/compiler/rustc_passes/src/liveness.rs#L996

This can lead to confusing warnings when a variable is reported as unused, but the use of the variable is not reported as unreachable. For instance:
```rust
enum Foo {}
fn f() -> Foo {todo!()}

fn main() {
    let x = f();
    let _ = x;
}
```
currently leads to
```
warning: unused variable: `x`
 --> t1.rs:5:9
  |
5 |     let x = f();
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted
```
which is confusing, because `x` _appears_ to be used in line 6. With my changes, I get:
```
warning: unreachable expression
 --> t1.rs:6:13
  |
5 |     let x = f();
  |             --- any code following this expression is unreachable
6 |     let _ = x;
  |             ^ unreachable expression
  |
  = note: `#[warn(unreachable_code)]` on by default
note: this expression has type `Foo`, which is uninhabited
 --> t1.rs:5:13
  |
5 |     let x = f();
  |             ^^^

warning: unused variable: `x`
 --> t1.rs:5:9
  |
5 |     let x = f();
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 2 warnings emitted
```
My implementation is slightly inelegant because unreachable code warnings can now be issued in two different places (during type checking and during liveness analysis), but I think it is the solution with the least amount of unnecessary code duplication, given that the new warning integrates nicely with liveness analysis, where unreachable code is already implicitly detected for the purpose of finding unused variables.

2 years agoAlso fix “a `OwningRef`”
Frank Steffahn [Sun, 22 Aug 2021 10:41:53 +0000 (12:41 +0200)]
Also fix “a `OwningRef`”

2 years agoAlso fix “a RwLock*”
Frank Steffahn [Sun, 22 Aug 2021 10:39:39 +0000 (12:39 +0200)]
Also fix “a RwLock*”

2 years agoFix typo “a Rc” → “an Rc”
Frank Steffahn [Sun, 22 Aug 2021 10:33:27 +0000 (12:33 +0200)]
Fix typo “a Rc” → “an Rc”

2 years agoFix references to `ControlFlow` in docs
Jacob Pratt [Tue, 24 Aug 2021 00:02:17 +0000 (20:02 -0400)]
Fix references to `ControlFlow` in docs

2 years agoAuto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnay
bors [Mon, 23 Aug 2021 22:55:19 +0000 (22:55 +0000)]
Auto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnay

Get piece unchecked in `write`

We already use specialized `zip`, but it seems like we can do a little better by not checking `pieces` length at all.

`Arguments` constructors are now unsafe. So the `format_args!` expansion now includes an `unsafe` block.

<details>
<summary>Local Bench Diff</summary>

```text
 name                        before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 fmt::write_str_macro1       22,967          19,718               -3,249  -14.15%   x 1.16
 fmt::write_str_macro2       35,527          32,654               -2,873   -8.09%   x 1.09
 fmt::write_str_macro_debug  571,953         575,973               4,020    0.70%   x 0.99
 fmt::write_str_ref          9,579           9,459                  -120   -1.25%   x 1.01
 fmt::write_str_value        9,573           9,572                    -1   -0.01%   x 1.00
 fmt::write_u128_max         176             173                      -3   -1.70%   x 1.02
 fmt::write_u128_min         138             134                      -4   -2.90%   x 1.03
 fmt::write_u64_max          139             136                      -3   -2.16%   x 1.02
 fmt::write_u64_min          129             135                       6    4.65%   x 0.96
 fmt::write_vec_macro1       24,401          22,273               -2,128   -8.72%   x 1.10
 fmt::write_vec_macro2       37,096          35,602               -1,494   -4.03%   x 1.04
 fmt::write_vec_macro_debug  588,291         589,575               1,284    0.22%   x 1.00
 fmt::write_vec_ref          9,568           9,732                   164    1.71%   x 0.98
 fmt::write_vec_value        9,516           9,625                   109    1.15%   x 0.99
```
</details>

2 years ago2229: Consider varaiables mentioned in closure as used
Aman Arora [Mon, 23 Aug 2021 22:47:38 +0000 (18:47 -0400)]
2229: Consider varaiables mentioned in closure as used

2 years agofix test
Niko Matsakis [Mon, 23 Aug 2021 22:25:55 +0000 (22:25 +0000)]
fix test

2 years agox.py fmt
Niko Matsakis [Mon, 23 Aug 2021 22:21:21 +0000 (22:21 +0000)]
x.py fmt

2 years agoUpdate NLL HRTB type ascription blessed expectations
Rémy Rakic [Mon, 23 Aug 2021 21:34:04 +0000 (23:34 +0200)]
Update NLL HRTB type ascription blessed expectations

Some of these tests have reached parity with the migrate-mode output.

2 years agoAdd comment and extra test
jackh726 [Mon, 23 Aug 2021 20:39:11 +0000 (16:39 -0400)]
Add comment and extra test

2 years agoAdd a couple more tests
jackh726 [Mon, 16 Aug 2021 14:49:36 +0000 (10:49 -0400)]
Add a couple more tests

2 years agoWhen checking associated type bounds, use bound vars for GAT params in param_env
jackh726 [Mon, 9 Aug 2021 23:26:13 +0000 (19:26 -0400)]
When checking associated type bounds, use bound vars for GAT params in param_env

2 years agohandle ascription type op in NLL HRTB diagnostics
Rémy Rakic [Mon, 23 Aug 2021 21:31:01 +0000 (23:31 +0200)]
handle ascription type op in NLL HRTB diagnostics

Refactors the `type_op_ascribe_user_type` query into a version which
accepts a span, and uses it in the nicer NLL HRTB bound region errors.

2 years ago2229: Update signature for truncate function
Aman Arora [Mon, 23 Aug 2021 19:59:46 +0000 (15:59 -0400)]
2229: Update signature for truncate function

2 years agoAuto merge of #88265 - m-ou-se:rollup-soymv20, r=m-ou-se
bors [Mon, 23 Aug 2021 20:10:29 +0000 (20:10 +0000)]
Auto merge of #88265 - m-ou-se:rollup-soymv20, r=m-ou-se

Rollup of 6 pull requests

Successful merges:

 - #87976 (Account for tabs when highlighting multiline code suggestions)
 - #88174 (Clarify some wording in Rust 2021 lint docs)
 - #88188 (Greatly improve limitation handling on parallel rustdoc GUI test run)
 - #88230 (Fix typos “a”→“an”)
 - #88232 (Add notes to macro-not-found diagnostics to point out how things with the same name were not a match.)
 - #88259 (Do not mark `-Z thir-unsafeck` as unsound anymore)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoadd trailing newline
Niko Matsakis [Mon, 23 Aug 2021 19:53:18 +0000 (19:53 +0000)]
add trailing newline

2 years agouseful debug printouts
Niko Matsakis [Mon, 23 Aug 2021 19:14:06 +0000 (19:14 +0000)]
useful debug printouts

The changes to dumping expressions seem particularly useful

2 years agofix apparent typo in resolving variables
Niko Matsakis [Mon, 23 Aug 2021 19:07:14 +0000 (19:07 +0000)]
fix apparent typo in resolving variables

2 years agoselect obligations after `check_casts`
liudingming [Mon, 9 Aug 2021 12:25:57 +0000 (20:25 +0800)]
select obligations after `check_casts`

Otherwise, we can get into a situation where you have
a subtype obligation `#1 <: #2` pending, #1 is constrained
by `check_casts`, but #2` is unaffected.

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2 years agoRollup merge of #88259 - LeSeulArtichaut:complete-thir-unsafeck, r=oli-obk
Mara Bos [Mon, 23 Aug 2021 18:45:51 +0000 (20:45 +0200)]
Rollup merge of #88259 - LeSeulArtichaut:complete-thir-unsafeck, r=oli-obk

Do not mark `-Z thir-unsafeck` as unsound anymore

The initial implementation of the THIR unsafety checker is now complete (rust-lang/project-thir-unsafeck#7).

r? `@oli-obk`

2 years agoRollup merge of #88232 - m-ou-se:macro-name-imported-but-not-macro, r=estebank
Mara Bos [Mon, 23 Aug 2021 18:45:50 +0000 (20:45 +0200)]
Rollup merge of #88232 - m-ou-se:macro-name-imported-but-not-macro, r=estebank

Add notes to macro-not-found diagnostics to point out how things with the same name were not a match.

This adds notes like:
```
error: cannot find derive macro `Serialize` in this scope
  --> $DIR/issue-88206.rs:22:10
   |
LL | #[derive(Serialize)]
   |          ^^^^^^^^^
   |
note: `Serialize` is imported here, but it is not a derive macro
  --> $DIR/issue-88206.rs:17:11
   |
LL | use hey::{Serialize, Deserialize};
   |           ^^^^^^^^^
```

Fixes https://github.com/rust-lang/rust/issues/88206

Includes https://github.com/rust-lang/rust/pull/88229

r? `@estebank`

2 years agoRollup merge of #88230 - steffahn:a_an, r=oli-obk
Mara Bos [Mon, 23 Aug 2021 18:45:49 +0000 (20:45 +0200)]
Rollup merge of #88230 - steffahn:a_an, r=oli-obk

Fix typos “a”→“an”

Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an.

While automation was used to find these, every change was checked manually.

Changes in submodules get separate PRs:
* https://github.com/rust-lang/stdarch/pull/1201
* https://github.com/rust-lang/cargo/pull/9821
* https://github.com/rust-lang/miri/pull/1874
* https://github.com/rust-lang/rls/pull/1746
* https://github.com/rust-analyzer/rust-analyzer/pull/9984
  _folks @ rust-analyzer are fast at merging…_
  * https://github.com/rust-analyzer/rust-analyzer/pull/9985
  * https://github.com/rust-analyzer/rust-analyzer/pull/9987
  * https://github.com/rust-analyzer/rust-analyzer/pull/9989

_For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._

<hr>

This has some overlap with #88226, but neither is a strict superset of the other.

If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.

2 years agoRollup merge of #88188 - GuillaumeGomez:rustdoc-gui-parallel-limit, r=dns2utf8
Mara Bos [Mon, 23 Aug 2021 18:45:48 +0000 (20:45 +0200)]
Rollup merge of #88188 - GuillaumeGomez:rustdoc-gui-parallel-limit, r=dns2utf8

Greatly improve limitation handling on parallel rustdoc GUI test run

Follow-up of https://github.com/rust-lang/rust/pull/88082.

r? `@dns2utf8`

2 years agoRollup merge of #88174 - camelid:clarify-rust-2021-lint-docs, r=m-ou-se
Mara Bos [Mon, 23 Aug 2021 18:45:47 +0000 (20:45 +0200)]
Rollup merge of #88174 - camelid:clarify-rust-2021-lint-docs, r=m-ou-se

Clarify some wording in Rust 2021 lint docs

Also added some inline code styling.

2 years agoRollup merge of #87976 - estebank:fix-suggestion-span-coloring, r=m-ou-se
Mara Bos [Mon, 23 Aug 2021 18:45:40 +0000 (20:45 +0200)]
Rollup merge of #87976 - estebank:fix-suggestion-span-coloring, r=m-ou-se

Account for tabs when highlighting multiline code suggestions

Address `'\t'` case in #87972.

Before:

![Screen Shot 2021-08-12 at 8 52 27 AM](https://user-images.githubusercontent.com/1606434/129228214-e5cfd203-9aa8-41c7-acd9-ce255ef8a21e.png)

After:

![Screen Shot 2021-08-12 at 8 52 15 AM](https://user-images.githubusercontent.com/1606434/129228236-57c951fc-c8cf-4901-989f-b9b5aa5eebca.png)

2 years agoAuto merge of #87676 - sexxi-goose:truncate_unique, r=nikomatsakis
bors [Mon, 23 Aug 2021 17:27:23 +0000 (17:27 +0000)]
Auto merge of #87676 - sexxi-goose:truncate_unique, r=nikomatsakis

2229: Handle MutBorrow/UniqueImmBorrow better

We only want to use UniqueImmBorrow when the capture place is truncated and we
drop Deref of a MutRef.

r? `@nikomatsakis`

Fixes: https://github.com/rust-lang/project-rfc-2229/issues/56
2 years agoImprove wording of macro-not-found-but-name-exists note.
Mara Bos [Sun, 22 Aug 2021 16:22:06 +0000 (18:22 +0200)]
Improve wording of macro-not-found-but-name-exists note.

2 years agoShow what things are, but also what they are not.
Mara Bos [Sun, 22 Aug 2021 16:15:07 +0000 (18:15 +0200)]
Show what things are, but also what they are not.

2 years agoDon't confuse the user with notes about tool modules.
Mara Bos [Sun, 22 Aug 2021 15:41:22 +0000 (17:41 +0200)]
Don't confuse the user with notes about tool modules.

2 years agoClarify what attribute and derive macros look like.
Mara Bos [Sun, 22 Aug 2021 15:26:19 +0000 (17:26 +0200)]
Clarify what attribute and derive macros look like.

2 years agoSay what things are, instead of what they are not.
Mara Bos [Sun, 22 Aug 2021 15:16:24 +0000 (17:16 +0200)]
Say what things are, instead of what they are not.

2 years agoSilence confusing 'unused import' warnings.
Mara Bos [Sun, 22 Aug 2021 14:33:21 +0000 (16:33 +0200)]
Silence confusing 'unused import' warnings.

2 years agoUpdate tests.
Mara Bos [Sun, 22 Aug 2021 13:05:35 +0000 (15:05 +0200)]
Update tests.

2 years agoAdd tests for macro-not-found diagnostics.
Mara Bos [Sun, 22 Aug 2021 13:05:13 +0000 (15:05 +0200)]
Add tests for macro-not-found diagnostics.

2 years agoLook for macro names in all namespaces for diagnostics.
Mara Bos [Sun, 22 Aug 2021 13:02:35 +0000 (15:02 +0200)]
Look for macro names in all namespaces for diagnostics.

2 years agoAdd test for macro-not-found-but-name-imported-here note.
Mara Bos [Sun, 22 Aug 2021 11:37:27 +0000 (13:37 +0200)]
Add test for macro-not-found-but-name-imported-here note.

2 years agoAdd note to 'macro not found' to point to identically-named imports.
Mara Bos [Sun, 22 Aug 2021 11:35:51 +0000 (13:35 +0200)]
Add note to 'macro not found' to point to identically-named imports.

2 years agoAuto merge of #87661 - FabianWolff:issue-87461, r=estebank
bors [Mon, 23 Aug 2021 14:41:14 +0000 (14:41 +0000)]
Auto merge of #87661 - FabianWolff:issue-87461, r=estebank

Improve error reporting for closure return type mismatches

Fixes #87461.

2 years agoreview comments
Esteban Kuber [Mon, 23 Aug 2021 12:42:08 +0000 (12:42 +0000)]
review comments

2 years agoDetect incorrect number of lang item generics
asquared31415 [Sun, 15 Aug 2021 01:38:37 +0000 (21:38 -0400)]
Detect incorrect number of lang item generics

2 years agoSimplify zero check
Andreas Liljeqvist [Mon, 23 Aug 2021 13:52:47 +0000 (15:52 +0200)]
Simplify zero check

2 years agoadd `with_start` and `with_end`
Andreas Liljeqvist [Mon, 23 Aug 2021 13:44:56 +0000 (15:44 +0200)]
add `with_start` and `with_end`

2 years agoimplement debug in similar way to RangeInclusive
Andreas Liljeqvist [Mon, 23 Aug 2021 13:05:40 +0000 (15:05 +0200)]
implement debug in similar way to RangeInclusive

2 years agoDo not mark `-Z thir-unsafeck` as unsound anymore
Léo Lanteri Thauvin [Mon, 23 Aug 2021 12:52:42 +0000 (14:52 +0200)]
Do not mark `-Z thir-unsafeck` as unsound anymore

2 years agoRename to WrappingRange
Andreas Liljeqvist [Mon, 23 Aug 2021 12:24:34 +0000 (14:24 +0200)]
Rename to WrappingRange

2 years agoGreatly improve limitation handling on parallel rustdoc GUI test run
Guillaume Gomez [Fri, 20 Aug 2021 18:55:48 +0000 (20:55 +0200)]
Greatly improve limitation handling on parallel rustdoc GUI test run

2 years agoimplement contains_zero method
Andreas Liljeqvist [Mon, 23 Aug 2021 12:20:38 +0000 (14:20 +0200)]
implement contains_zero method

2 years agoUse ref
Andreas Liljeqvist [Mon, 23 Aug 2021 12:18:48 +0000 (14:18 +0200)]
Use ref

2 years agoremove unnecessary `info!()` logging
Esteban Kuber [Tue, 17 Aug 2021 16:06:18 +0000 (16:06 +0000)]
remove unnecessary `info!()` logging

2 years agoFixes to span locations
Esteban Kuber [Tue, 17 Aug 2021 15:46:42 +0000 (15:46 +0000)]
Fixes to span locations

2 years agowip
Esteban Kuber [Sat, 14 Aug 2021 13:31:48 +0000 (13:31 +0000)]
wip

2 years agoAccount for tabs when highlighting multiline code suggestions
Esteban Kuber [Thu, 12 Aug 2021 19:33:19 +0000 (19:33 +0000)]
Account for tabs when highlighting multiline code suggestions

2 years agoRemoved fixed fixme
Andreas Liljeqvist [Mon, 23 Aug 2021 11:56:28 +0000 (13:56 +0200)]
Removed fixed fixme

2 years agoAuto merge of #88249 - lnicola:rust-analyzer-2021-08-23, r=lnicola
bors [Mon, 23 Aug 2021 10:46:31 +0000 (10:46 +0000)]
Auto merge of #88249 - lnicola:rust-analyzer-2021-08-23, r=lnicola

:arrow_up: rust-analyzer

2 years agoremove commented code
Andreas Liljeqvist [Mon, 23 Aug 2021 09:21:27 +0000 (11:21 +0200)]
remove commented code

2 years agoAuto merge of #88220 - sunfishcode:sunfishcode/unix-listener-io-safety, r=joshtriplett
bors [Mon, 23 Aug 2021 07:36:49 +0000 (07:36 +0000)]
Auto merge of #88220 - sunfishcode:sunfishcode/unix-listener-io-safety, r=joshtriplett

Implement `AsFd` etc. for `UnixListener`.

Implement `AsFd`, `From<OwnedFd>`, and `Into<OwnedFd>` for
`UnixListener`. This is a follow-up to #87329.

r? `@joshtriplett`

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 23 Aug 2021 06:01:38 +0000 (09:01 +0300)]
:arrow_up: rust-analyzer

2 years agoAuto merge of #87598 - ccqpein:master, r=yaahc
bors [Mon, 23 Aug 2021 05:06:29 +0000 (05:06 +0000)]
Auto merge of #87598 - ccqpein:master, r=yaahc

Add doctests for HashMap's into_values and into_keys methods

Fixes #87591

2 years agoadd Cell::as_array_of_cells, similar to Cell::as_slice_of_cells
Jack O'Connor [Wed, 11 Aug 2021 18:38:20 +0000 (14:38 -0400)]
add Cell::as_array_of_cells, similar to Cell::as_slice_of_cells

Previously, converting `&mut [T; N]` to `&[Cell<T>; N]` looks like this:

    let array = &mut [1, 2, 3];
    let cells: &[Cell<i32>; 3] = Cell::from_mut(&mut array[..])
        .as_slice_of_cells()
        .try_into()
        .unwrap();

With this new helper method, it looks like this:

    let array = &mut [1, 2, 3];
    let cells: &[Cell<i32>; 3] = Cell::from_mut(array).as_array_of_cells();

2 years agoAuto merge of #88210 - spastorino:diff-lifetimes-def-use-test, r=oli-obk
bors [Mon, 23 Aug 2021 02:25:36 +0000 (02:25 +0000)]
Auto merge of #88210 - spastorino:diff-lifetimes-def-use-test, r=oli-obk

Test TAITs different lifetimes in defining uses fail

r? `@oli-obk`

Related to #86727