Commit Graph

132571 Commits

Author SHA1 Message Date
Daiki Ihara
f197da655f fix shellcheck error of SC2148 2020-11-06 20:33:12 +09:00
bors
56293097f7 Auto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-se
Rollup of 7 pull requests

Successful merges:

 - #77950 (Add support for SHA256 source file hashing)
 - #78624 (Sync rustc_codegen_cranelift)
 - #78626 (Improve errors about #[deprecated] attribute)
 - #78659 (Corrected suggestion for generic parameters in `function_item_references` lint)
 - #78687 (Suggest library/std when running all stage 0 tests)
 - #78699 (Show more error information in lldb_batchmode)
 - #78709 (Fix panic in bootstrap for non-workspace path dependencies.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-03 18:58:06 +00:00
Mara Bos
a65507b47d
Rollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum
Fix panic in bootstrap for non-workspace path dependencies.

If you add a `path` dependency to a `Cargo.toml` that is located outside of the workspace, then the `in_tree_crates` function can panic because it finds a path dependency that is not defined (since it uses `cargo metadata --no-deps`).  This fixes it by skipping over those entries, which are usually not things you select on the command-line.

Fixes #78617
2020-11-03 19:32:44 +01:00
Mara Bos
f9dd8d37c2
Rollup merge of #78699 - pietroalbini:lldb-error, r=jyn514
Show more error information in lldb_batchmode

Even more information to try and debug #78665.
2020-11-03 19:32:42 +01:00
Mara Bos
8a1f9e09a1
Rollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum
Suggest library/std when running all stage 0 tests

r? ``@Mark-Simulacrum``
cc ``@ijackson``

For context, this came out of a discord conversation where ``@ijackson`` was running `test --stage 1` when they were only adding doc-tests to the standard library.
2020-11-03 19:32:40 +01:00
Mara Bos
f347dab47c
Rollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obk
Corrected suggestion for generic parameters in `function_item_references` lint

This commit handles functions with generic type parameters like you pointed out as well as const generics. Also this is probably a minor thing, but the type alias you used in the example doesn't show up so the suggestion right now would be `size_of::<[u8; 16]> as fn() ->`. This is because the lint checker works with MIR instead of HIR. I don't think we can get the alias at that point, but let me know if I'm wrong and there's a way to fix this. Also I put you as the reviewer, but I'm not sure if you want to review it or if it makes more sense to ask one of the original reviewers of this lint.
closes #78571
2020-11-03 19:32:38 +01:00
Mara Bos
f0112928cb
Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank
Improve errors about #[deprecated] attribute

This change:

1. Turns `#[deprecated]` on a trait impl block into an error, which fixes #78625;
2. Changes these and other errors about `#[deprecated]` to use the span of the attribute instead of the item; and
3. Turns this error into a lint, to make sure it can be capped with `--cap-lints` and doesn't break any existing dependencies.

Can be reviewed per commit.

---
Example:
```rust
struct X;

#[deprecated = "a"]
impl Default for X {
    #[deprecated = "b"]
    fn default() -> Self {
        X
    }
}
```

Before:
```
error: This deprecation annotation is useless
 --> src/main.rs:6:5
  |
6 | /     fn default() -> Self {
7 | |         X
8 | |     }
  | |_____^
```

After:
```
error: this `#[deprecated]' annotation has no effect
 --> src/main.rs:3:1
  |
3 | #[deprecated = "a"]
  | ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
  |
  = note: `#[deny(useless_deprecated)]` on by default

error: this `#[deprecated]' annotation has no effect
 --> src/main.rs:5:5
  |
5 |     #[deprecated = "b"]
  |     ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
```
2020-11-03 19:32:36 +01:00
Mara Bos
39f5563e73
Rollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514
Sync rustc_codegen_cranelift

This fixes bootstrapping of rustc using cg_clif again. It regressed a while before #77975 got merged.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/743
2020-11-03 19:32:34 +01:00
Mara Bos
52405f7c0c
Rollup merge of #77950 - arlosi:sha256, r=eddyb
Add support for SHA256 source file hashing

Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11.

Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256.

r? `@eddyb`
cc #70401 `@est31`
2020-11-03 19:32:26 +01:00
Eric Huss
2172adbd5c Fix panic in bootstrap for non-workspace path dependencies. 2020-11-03 09:54:11 -08:00
bors
5cdf5b882d Auto merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=wesleywiser
Properly handle lint spans after MIR inlining

The first commit shows what happens when we apply mir inlining and then cause lints on the inlined MIR.
The second commit fixes that.

r? `@wesleywiser`
2020-11-03 16:32:34 +00:00
bors
0cd1516696 Auto merge of #78597 - RalfJung:raw-retag, r=oli-obk
Retagging: do not retag 'raw reborrows'

When doing `&raw const (*raw_ptr).field`, we do not want any retagging; the original provenance should be fully preserved.

Fixes https://github.com/rust-lang/miri/issues/1608
Test added by https://github.com/rust-lang/miri/pull/1614

Not sure whom to ask for review on this... `@oli-obk` can you have a look? Or maybe highfive makes a good choice.^^
2020-11-03 13:48:54 +00:00
Pietro Albini
c32de757cd
lldb_batchmode: show more error information
Even more information to try and debug #78665.
2020-11-03 12:01:46 +01:00
bjorn3
216c4ae463 Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020-11-01 2020-11-03 11:00:04 +01:00
bors
8e8939b804 Auto merge of #78489 - bugadani:array, r=estebank
Minor cleanup around incremental compilation

* Remove some short lived vectors
* Fix some typos
* Avoid some reallocations
2020-11-03 09:19:01 +00:00
bors
d662f80855 Auto merge of #78697 - JohnTitor:rollup-q0fchpv, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #78376 (Treat trailing semicolon as a statement in macro call)
 - #78400 (Fix unindent in doc comments)
 - #78575 (Add a test for compiletest rustc-env & unset-rustc-env directives)
 - #78616 (Document -Zinstrument-coverage)
 - #78663 (Fix ICE when a future-incompat-report has its command-line level capped)
 - #78664 (Fix intrinsic size_of stable link)
 - #78668 (inliner: Remove redundant loop)
 - #78676 (add mipsel-unknown-none target)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-03 06:56:46 +00:00
Yuki Okushi
1cb137b3e9
Rollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievink
add mipsel-unknown-none target

This adds a target for bare MIPS32r2, little endian, softfloat. This target can be used for PIC32 microcontrollers (or possibly for other devices that have a MIPS MCU core such as the M4K core).

Tried to find a name for the target that is in line with the naming scheme apparently used for the other MIPS targets.

r? `@jonas-schievink`
2020-11-03 15:27:21 +09:00
Yuki Okushi
cf062179a8
Rollup merge of #78668 - tmiasko:inline, r=oli-obk
inliner: Remove redundant loop

No functional changes intended.
2020-11-03 15:27:19 +09:00
Yuki Okushi
9d4cdbbfcd
Rollup merge of #78664 - pickfire:patch-4, r=jonas-schievink
Fix intrinsic size_of stable link

I noticed that it is pointing to the same link when I was reading
https://github.com/rust-lang/rust-clippy/issues/2997
2020-11-03 15:27:18 +09:00
Yuki Okushi
8894c903cb
Rollup merge of #78663 - Aaron1011:fix/cap-future-compat, r=tmandry
Fix ICE when a future-incompat-report has its command-line level capped

Fixes #78660

With PR https://github.com/rust-lang/rust/pull/75534 merged, we now run
more lint-related code for future-incompat-report, even when their final
level is Allow. Some lint-related code was not expecting `Level::Allow`,
and had an explicit panic.

This PR explicitly tracks the lint level set on the command line before
`--cap-lints` is applied. This is used to emit a more precise error
note (e.g. we don't say that `-W lint-name` was specified on the
command line just because a lint was capped to Warn). As a result, we
can now correctly emit a note that `-A` was used if we got
`Level::Allow` from the command line (before the cap is applied).
2020-11-03 15:27:16 +09:00
Yuki Okushi
416dd6757b
Rollup merge of #78616 - richkadel:unstable-book-instr-cov, r=tmandry
Document -Zinstrument-coverage

r? ``@tmandry``
FYI ``@wesleywiser``

Here is my proposed document for LLVM source-based code coverage.

I based it on the `profile.md` page, in the same directory, and on the Clang guide for LLVM source-based coverage.
2020-11-03 15:27:13 +09:00
Yuki Okushi
54d9a67ba5
Rollup merge of #78575 - tmiasko:compiletest-rustc-env, r=Aaron1011
Add a test for compiletest rustc-env & unset-rustc-env directives

... and move compiletest meta tests into a separate directory.
2020-11-03 15:27:11 +09:00
Yuki Okushi
e731a5a7f5
Rollup merge of #78400 - GuillaumeGomez:fix-unindent, r=jyn514
Fix unindent in doc comments

Fixes #70732

r? ``@jyn514``
2020-11-03 15:27:05 +09:00
Yuki Okushi
0716724a0b
Rollup merge of #78376 - Aaron1011:feature/consistent-empty-expr, r=petrochenkov
Treat trailing semicolon as a statement in macro call

See #61733 (comment)

We now preserve the trailing semicolon in a macro invocation, even if
the macro expands to nothing. As a result, the following code no longer
compiles:

```rust
macro_rules! empty {
    () => { }
}

fn foo() -> bool { //~ ERROR mismatched
    { true } //~ ERROR mismatched
    empty!();
}
```

Previously, `{ true }` would be considered the trailing expression, even
though there's a semicolon in `empty!();`

This makes macro expansion more token-based.
2020-11-03 15:27:03 +09:00
bors
7b5a9e9cd2 Auto merge of #78448 - rylev:cache-foreign_modules, r=wesleywiser
foreign_modules query hash table lookups

When compiling a large monolithic crate we're seeing huge times in the `foreign_modules` query due to repeated iteration over foreign modules (in order to find a module by its id). This implements hash table lookups so that which massively reduces time spent in that query in this particular case. We'll need to see if the overhead of creating the hash table has a negative impact on performance in more normal compilation scenarios.

I'm working with `@wesleywiser` on this.
2020-11-03 04:27:27 +00:00
bors
4c0c5e099a Auto merge of #77271 - petrochenkov:notokenexp, r=Aaron1011
Expand `NtExpr` tokens only in key-value attributes

Implement the experiment described in https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412

This PR also removes some customization points and token visiting functionality from AST visitors.
Read-only visitor no longer visits tokens, mutable visitor visits tokens only when specifically enabled, mutable token visiting is restricted to its single intended use case.

I haven't changed the representation of `MacArgs::Eq` yet, but it potentially can use a `TokenTree` or a `Token` instead of `TokenStream`.
It's hard to get rid of `Nonterminal::NtExpr` there (and e.g. replace it with `ast::Expr`) due to the dual nature of key-value attributes (the value is both an expression and a token stream, depending on context), and `Nonterminal` has all the machinery for maintaining both representations in sync.

Fixes https://github.com/rust-lang/rust/issues/55414
Fixes https://github.com/rust-lang/rust/issues/43860
2020-11-03 00:58:24 +00:00
Joshua Nelson
1aedcd33f5 Suggest library/std when running all stage 0 tests 2020-11-02 17:35:52 -05:00
Stephan
5130f2e777 add mipsel-unknown-none target 2020-11-02 23:31:15 +01:00
Stephan
1a232cb976 indicate calling convention 2020-11-02 23:29:00 +01:00
Stephan
96db99a145
improve comments
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-11-02 23:18:32 +01:00
Vadim Petrochenkov
19dbb02a89 Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00
Stephan
7d2441134b add blacklist for unsupported calling conventions 2020-11-02 22:52:47 +01:00
Rich Kadel
6d949112f6 addressed feedback 2020-11-02 12:05:00 -08:00
bjorn3
03f01bbe90
Merge pull request #1105 from bjorn3/test_rustc_bootstrapping
Test bootstrapping of rustc using cg_clif
2020-11-02 19:14:50 +01:00
Stephan
6e58b1c3c9 add mipsel_unknown_none target 2020-11-02 19:11:24 +01:00
Aaron Hill
e78e9d4a06
Treat trailing semicolon as a statement in macro call
See https://github.com/rust-lang/rust/issues/61733#issuecomment-716188981

We now preserve the trailing semicolon in a macro invocation, even if
the macro expands to nothing. As a result, the following code no longer
compiles:

```rust
macro_rules! empty {
    () => { }
}

fn foo() -> bool { //~ ERROR mismatched
    { true } //~ ERROR mismatched
    empty!();
}
```

Previously, `{ true }` would be considered the trailing expression, even
though there's a semicolon in `empty!();`

This makes macro expansion more token-based.
2020-11-02 13:03:13 -05:00
bjorn3
54b1d101ef Test bootstrapping of rustc using cg_clif 2020-11-02 18:54:55 +01:00
bjorn3
646b00ff77 Revert unintentional change 2020-11-02 18:54:10 +01:00
bjorn3
520a61f21b
Merge pull request #1104 from bjorn3/build_system_refactor
Build system refactor
2020-11-02 18:46:36 +01:00
bjorn3
8315730895 Upload prebuilt cg_clif 2020-11-02 18:24:21 +01:00
bjorn3
0c34f5aba8 Refactor the build system 2020-11-02 18:17:39 +01:00
bors
338f939a8d Auto merge of #78607 - HeroicKatora:post-order-walk-iter, r=davidtwco
Transform post order walk to an iterative approach

The previous recursive approach might overflow the stack when walking a
particularly deep, list-like, graph. In particular, dominator
calculation for borrow checking does such a traversal and very long
functions might lead to a region dependency graph with in this
problematic structure.

This addresses what appears to be the cause of #78567 (`@SunHao-0` thanks for the stack trace).
2020-11-02 16:01:10 +00:00
bors
499ebcfdf3 Auto merge of #78667 - pietroalbini:lldb-unbuffered, r=Mark-Simulacrum
Try running lldb_batchmode.py with PYTHONUNBUFFERED

When reporting fatal errors, LLVM calls abort() to exit the program. There is a chance that might interfere with Python printing stuff to stdout, as by default it relies on buffering to increase performance.

This commit tries to disable Python buffering, to hopefully get useful logs while debugging #78665.
2020-11-02 13:07:01 +00:00
Mara Bos
9c647d1021 Improve deprecation attribute diagnostic messages.
(From the PR feedback.)

Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
2020-11-02 13:21:18 +01:00
Pietro Albini
0af9f7edb7
compiletest: try running lldb_batchmode.py with PYTHONUNBUFFERED
When reporting fatal errors, LLVM calls abort() to exit the program.
There is a chance that might interfere with Python printing stuff to
stdout, as by default it relies on buffering to increase performance.

This commit tries to disable Python buffering, to hopefully get useful
logs while debugging #78665.
2020-11-02 13:20:16 +01:00
bors
4051473c8b Auto merge of #78661 - JohnTitor:rollup-er2isja, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #78606 (Clarify handling of final line ending in str::lines())
 - #78610 (Do not remove tokens before AST json serialization)
 - #78620 (Trivial fixes to bitwise operator documentation)
 - #78627 (Point out that total_cmp is no strict superset of partial comparison)
 - #78637 (Add fetch_update methods to AtomicBool and AtomicPtr)

Failed merges:

r? `@ghost`
2020-11-02 10:42:45 +00:00
bors
234099d1d1 Auto merge of #75020 - JohnTitor:fix-multispan, r=estebank,tmandry
Avoid complex diagnostics in snippets which contain newlines

Fixes #70935

r? `@estebank` `@tmandry`
2020-11-02 08:17:36 +00:00
Ivan Tham
c83c635751
Fix intrinsic size_of stable link
I noticed that it is pointing to the same link when I was reading
https://github.com/rust-lang/rust-clippy/issues/2997
2020-11-02 16:03:23 +08:00
Yuki Okushi
8d651013e4 Fix format 2020-11-02 16:59:11 +09:00
Yuki Okushi
54d9ffc0b9 Only separate notes if span is multiline 2020-11-02 16:54:53 +09:00