Commit Graph

122588 Commits

Author SHA1 Message Date
bors
0c04344d86 Auto merge of #73669 - Manishearth:rollup-0n4u7vq, r=Manishearth
Rollup of 11 pull requests

Successful merges:

 - #72780 (Enforce doc alias check)
 - #72876 (Mention that BTreeMap::new() doesn't allocate)
 - #73244 (Check for assignments between non-conflicting generator saved locals)
 - #73488 (code coverage foundation for hash and num_counters)
 - #73523 (Fix -Z unpretty=everybody_loops)
 - #73587 (Move remaining `NodeId` APIs from `Definitions` to `Resolver`)
 - #73601 (Point at the call span when overflow occurs during monomorphization)
 - #73613 (The const propagator cannot trace references.)
 - #73614 (fix `intrinsics::needs_drop` docs)
 - #73630 (Provide context on E0308 involving fn items)
 - #73665 (rustc: Modernize wasm checks for atomics)

Failed merges:

r? @ghost
2020-06-23 21:33:22 +00:00
Manish Goregaokar
6ed6a844e1
Rollup merge of #73665 - alexcrichton:update-wasm-atomics-feature, r=davidtwco
rustc: Modernize wasm checks for atomics

This commit modernizes how rustc checks for whether the `atomics`
feature is enabled for the wasm target. The `sess.target_features` set
is consulted instead of fiddling around with dealing with various
aspects of LLVM and that syntax.
2020-06-23 13:10:19 -07:00
Manish Goregaokar
4f2e540520
Rollup merge of #73630 - estebank:fn-item-e0308, r=davidtwco
Provide context on E0308 involving fn items

Fix #73487.
2020-06-23 13:10:17 -07:00
Manish Goregaokar
f7d5687eba
Rollup merge of #73614 - lcnr:patch-4, r=Dylan-DPC
fix `intrinsics::needs_drop` docs
2020-06-23 13:10:15 -07:00
Manish Goregaokar
d8b4604f41
Rollup merge of #73613 - oli-obk:const_prop_miscompile, r=wesleywiser
The const propagator cannot trace references.

Thus we avoid propagation of a local the moment we encounter references to it.

fixes #73609

cc @RalfJung

r? @wesleywiser
2020-06-23 13:10:13 -07:00
Manish Goregaokar
30fba22a9b
Rollup merge of #73601 - Aaron1011:fix/better-mono-overflow-err, r=ecstatic-morse
Point at the call span when overflow occurs during monomorphization

This improves the output for issue #72577, but there's still more work
to be done.

Currently, an overflow error during monomorphization results in an error
that points at the function we were unable to monomorphize. However, we
don't point at the call that caused the monomorphization to happen. In
the overflow occurs in a large recursive function, it may be difficult
to determine where the issue is.

This commit tracks and `Span` information during collection of
`MonoItem`s, which is used when emitting an overflow error. `MonoItem`
itself is unchanged, so this only affects
`src/librustc_mir/monomorphize/collector.rs`
2020-06-23 13:10:11 -07:00
Manish Goregaokar
045761c8d0
Rollup merge of #73587 - marmeladema:hir-id-ification-final, r=petrochenkov
Move remaining `NodeId` APIs from `Definitions` to `Resolver`

Implements https://github.com/rust-lang/rust/pull/73291#issuecomment-643515557

TL;DR: it moves all fields that are only needed during name resolution passes into the `Resolver` and keep the rest in `Definitions`. This effectively enforces that all references to `NodeId`s are gone once HIR lowering is completed.

After this, the only remaining work for #50928 should be to adjust the dev guide.

r? @petrochenkov
2020-06-23 13:10:09 -07:00
Manish Goregaokar
505cf52c53
Rollup merge of #73523 - jyn514:everybody_loops, r=ecstatic-morse
Fix -Z unpretty=everybody_loops

It turns out that this has not been working for who knows how long.
Previously:

```
pub fn h() { 1 + 2; }
```

After this change:

```
pub fn h() { loop { } }
```

This only affected the pass when run with the command line
pretty-printing option, so rustdoc was still replacing bodies with
`loop {}`.
2020-06-23 13:10:07 -07:00
Manish Goregaokar
f5e46fe46c
Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandry
code coverage foundation for hash and num_counters

This PR is the next iteration after PR #73011 (which is still waiting on bors to merge).

@wesleywiser - PTAL
r? @tmandry

(FYI, I'm also working on injecting the coverage maps, in another branch, while waiting for these to merge.)

Thanks!
2020-06-23 13:10:05 -07:00
Manish Goregaokar
781b589997
Rollup merge of #73244 - ecstatic-morse:validate-generator-mir, r=tmandry
Check for assignments between non-conflicting generator saved locals

This is to prevent future changes to the generator transform from reintroducing the problem that caused #73137. Namely, a store between two generator saved locals whose storage does not conflict.

My ultimate goal is to introduce a modified version of #71956 that handles this case properly.

r? @tmandry
2020-06-23 13:10:03 -07:00
Manish Goregaokar
317a15142e
Rollup merge of #72876 - TrolledWoods:patch-2, r=Dylan-DPC
Mention that BTreeMap::new() doesn't allocate

I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().
2020-06-23 13:10:01 -07:00
Manish Goregaokar
7d2fba1bd2
Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ollie27
Enforce doc alias check

Part of #50146.

r? @ollie27
2020-06-23 13:09:59 -07:00
Esteban Küber
6e8aa1ff27 review comments: wording and style 2020-06-23 13:01:24 -07:00
Dan Aloni
037e930df7 Review fixes 2020-06-23 22:30:09 +03:00
Nikodem Rabuliński
f37c157f2c
Update map.rs 2020-06-23 20:06:44 +02:00
bors
ff5b446d2f Auto merge of #73644 - ollie27:rustdoc_alias_filter, r=GuillaumeGomez
rustdoc: Fix doc aliases with crate filtering

Fix a crash when searching for an alias contained in the currently selected filter crate.

Also remove alias search results for crates that should be filtered out.

The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected.

Needs to be backported to beta to fix the `std` docs.

Fixes #73620

r? @GuillaumeGomez
2020-06-23 17:30:54 +00:00
Alex Crichton
0c2b02536c rustc: Modernize wasm checks for atomics
This commit modernizes how rustc checks for whether the `atomics`
feature is enabled for the wasm target. The `sess.target_features` set
is consulted instead of fiddling around with dealing with various
aspects of LLVM and that syntax.
2020-06-23 09:41:56 -07:00
Ayaz Hafiz
86f6c0e086
Record span of const kw in GenericParamKind
Context: this is needed to fix https://github.com/rust-lang/rustfmt/issues/4263,
which currently records the span of a const generic param incorrectly
because the location of the `const` kw is not known.

I am not sure how to add tests for this; any guidance in how to do so
would be appreciated 🙂
2020-06-23 09:25:46 -07:00
flip1995
a2c0499b39
Merge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyup 2020-06-23 17:05:22 +02:00
bors
c2c07fa9d0 Auto merge of #5740 - lzutao:unused-unused, r=flip1995
Remove unused allowed unused attributes

changelog: none
2020-06-23 14:34:18 +00:00
bors
c420382ac2 Auto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr
Improve end of expression check in for loop lints

changelog: none
2020-06-23 14:05:45 +00:00
Lzu Tao
7374185b36 Remove unused allowed unused attributes 2020-06-23 20:59:35 +07:00
bors
9504efc94e Auto merge of #5735 - lzutao:issue-temp, r=flip1995
Add more specific GitHub issue templates

changelog: Make it easier to create feature request and bug reports with issue templates.
2020-06-23 13:40:02 +00:00
bors
b452ad3c0b Auto merge of #5741 - flip1995:rollup-8chbwhy, r=flip1995
Rollup of 9 pull requests

Successful merges:

 - #5178 (clippy-driver: pass all args to rustc if --rustc is present)
 - #5705 (Downgrade unnested_or_patterns to pedantic)
 - #5709 (Fix ICE in consts::binop)
 - #5710 (typo)
 - #5712 (Remove `bar` from blacklisted names)
 - #5713 (Use lints in Clippy that are enabled in rustc bootstrap)
 - #5716 (Fix typo in wildcard_imports)
 - #5724 (redundant_pattern_matching: avoid non-`const fn` calls in const contexts)
 - #5726 (Fix typo)

Failed merges:

r? @ghost

changelog: rollup
2020-06-23 12:52:46 +00:00
Philipp Krones
e4cbd1df4e
Rollup merge of #5726 - sozysozbot:patch-1, r=flip1995
Fix typo

changelog: extending it's lifetime -> extending its lifetime
2020-06-23 14:39:50 +02:00
Philipp Krones
f562117788
Rollup merge of #5724 - ebroto:5697_const_result_option, r=Manishearth
redundant_pattern_matching: avoid non-`const fn` calls in const contexts

changelog: Avoid suggesting non-`const fn` calls in const contexts in [`redundant_pattern_matching`]

Fixes #5697
2020-06-23 14:39:49 +02:00
Philipp Krones
68c0b24e23
Rollup merge of #5716 - bugadani:patch-1, r=matthiaskrgr
Fix typo in wildcard_imports

changelog: none
2020-06-23 14:39:48 +02:00
Philipp Krones
598a79f309
Rollup merge of #5713 - flip1995:more_lints, r=Manishearth
Use lints in Clippy that are enabled in rustc bootstrap

cc https://github.com/rust-lang/rust/pull/73297#discussion_r439747061

changelog: none
2020-06-23 14:39:47 +02:00
Philipp Krones
0799be7156
Rollup merge of #5712 - ijijn:master, r=flip1995
Remove `bar` from blacklisted names

changelog: Remove `bar` from blacklisted names
fixes #5225
2020-06-23 14:39:45 +02:00
Philipp Krones
24b77ea72f
Rollup merge of #5710 - lcnr:patch-1, r=flip1995
typo

changelog: none
2020-06-23 14:39:44 +02:00
Philipp Krones
9505919be5
Rollup merge of #5709 - ebroto:5389_ice, r=Manishearth
Fix ICE in consts::binop

changelog: Fix ICE in `consts::binop`

Fixes #5389
2020-06-23 14:39:43 +02:00
Philipp Krones
1f39eeb06d
Rollup merge of #5705 - dtolnay:orpat, r=flip1995
Downgrade unnested_or_patterns to pedantic

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints
2020-06-23 14:39:42 +02:00
Philipp Krones
7c61be615a
Rollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995
clippy-driver: pass all args to rustc if --rustc is present

changelog: clippy-driver: pass all args to rustc if --rustc is present
2020-06-23 14:39:40 +02:00
flip1995
b886c06c1a
Fix fallout 2020-06-23 14:05:53 +02:00
flip1995
ed083cc959
Use lints in Clippy that are enabled in rustc bootstrap 2020-06-23 14:05:52 +02:00
bors
4cc2fa933b Auto merge of #5739 - flip1995:rustup, r=flip1995
Rustup

changelog: none

r? @ghost
2020-06-23 12:04:08 +00:00
Dan Aloni
404df1cbbf Add re-exports to use suggestions
In the following example, an inaccessible path is suggested via
`use foo::bar::X;` whereas an accessible public exported path can
be suggested instead.

```
mod foo {
    mod bar {
        pub struct X;
    }
    pub use self::bar::X;
}

fn main() { X; }
```

This fixes the issue.
2020-06-23 13:37:50 +03:00
Yuki Okushi
814782b4c6
Add test for issue-69840 2020-06-23 17:52:51 +09:00
Yuki Okushi
e817cd2a6e
Add test for issue-59435 2020-06-23 17:52:42 +09:00
Yuki Okushi
43ef554b6a
Add test for issue-51506 2020-06-23 17:52:26 +09:00
Yuki Okushi
bb882d74bd
Add test for issue-44861 2020-06-23 17:52:01 +09:00
Oliver Middleton
478750c1db rustdoc: Fix doc aliases with crate filtering
Fix a crash when searching for an alias contained in the currently selected filter crate.

Also remove alias search results for crates that should be filtered out.

The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected.
2020-06-23 09:27:37 +01:00
Oliver Scherer
5fa8b08808 The const propagator cannot trace references.
Thus we avoid propagation of a local the moment we encounter references to it.
2020-06-23 10:18:14 +02:00
bors
1557fb031b Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #72271 (Improve compiler error message for wrong generic parameter order)
 - #72493 ( move leak-check to during coherence, candidate eval)
 - #73398 (A way forward for pointer equality in const eval)
 - #73472 (Clean up E0689 explanation)
 - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`)
 - #73515 (Add second message for LiveDrop errors)
 - #73567 (Clarify --extern documentation.)
 - #73572 (Fix typos in doc comments)
 - #73590 (bootstrap: no `config.toml` exists regression)

Failed merges:

r? @ghost
2020-06-23 07:50:51 +00:00
Lzu Tao
51c3b42ef3 Add more specific GitHub issue templates
Apply suggestions from code review

Co-authored-by: Philipp Krones <hello@philkrones.com>
2020-06-23 14:34:32 +07:00
Manish Goregaokar
44900f8236
Rollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Mark-Simulacrum
bootstrap: no `config.toml` exists regression

Fixes #73574.

This PR fixes a regression introduced in #73317 where an oversight meant that `config.toml` was assumed to exist.
2020-06-23 00:34:06 -07:00
Manish Goregaokar
84bd1e776b
Rollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink
Fix typos in doc comments

Hello 🦀 ,

This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'

Thank you for reviewing this PR 👍
2020-06-23 00:34:05 -07:00
Manish Goregaokar
05601515be
Rollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay
Clarify --extern documentation.

Fixes #64731, #73531.

See also https://github.com/rust-lang/rust/issues/64402#issuecomment-530852886
2020-06-23 00:34:03 -07:00
Manish Goregaokar
0f9a6edc09
Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk
Add second message for LiveDrop errors

This is an attempt to fix https://github.com/rust-lang/rust/issues/72907 by adding a second message to the `LiveDrop` diagnostics. Changing from this
```
error[E0493]: destructors cannot be evaluated at compile-time
 --> src/lib.rs:7:9
  |
7 |     let mut always_returned = None;
  |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors

error: aborting due to previous error
```
to this
```
error[E0493]: destructors cannot be evaluated at compile-time
  --> foo.rs:6:9
   |
6  |     let mut always_returned = None;
   |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
...
10 |         always_returned = never_returned;
   |         --------------- value is dropped here

error: aborting due to previous error
```
r? @RalfJung @ecstatic-morse
2020-06-23 00:34:00 -07:00
Manish Goregaokar
cd18ac1ce8
Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakis
Account for multiple impl/dyn Trait in return type when suggesting `'_`

Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient.

Follow up to #72804.

r? @nikomatsakis
2020-06-23 00:33:58 -07:00