]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petrochenkov
bors [Wed, 4 Nov 2020 11:37:36 +0000 (11:37 +0000)]
Auto merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petrochenkov

Use reparsed `TokenStream` if we captured any inner attributes

Fixes #78675

We now bail out of `prepend_attrs` if we ended up capturing any inner
attributes (which can happen in several places, due to token capturing
for `macro_rules!` arguments.

3 years agoFix outdated comment next to array_impl_default
est31 [Wed, 4 Nov 2020 00:48:28 +0000 (01:48 +0100)]
Fix outdated comment next to array_impl_default

The comment has become outdated as the array_impl macro
has been removed.

3 years agoMove ZST constant to the top of the impl block
oli [Mon, 2 Nov 2020 11:54:06 +0000 (11:54 +0000)]
Move ZST constant to the top of the impl block

3 years agoUpdate compiler/rustc_middle/src/ty/consts/int.rs
Oli Scherer [Mon, 2 Nov 2020 11:52:52 +0000 (12:52 +0100)]
Update compiler/rustc_middle/src/ty/consts/int.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoSimplify `assert_bits` impl
oli [Sun, 1 Nov 2020 17:32:51 +0000 (17:32 +0000)]
Simplify `assert_bits` impl

3 years agoDo not raise interp errors from the scalar int module
oli [Sun, 1 Nov 2020 17:30:33 +0000 (17:30 +0000)]
Do not raise interp errors from the scalar int module

3 years agoAdd helper for getting an `int` out of a `Scalar`
oli [Sun, 1 Nov 2020 17:21:33 +0000 (17:21 +0000)]
Add helper for getting an `int` out of a `Scalar`

3 years agoAdd `is_null` helper
oli [Sun, 1 Nov 2020 17:17:04 +0000 (17:17 +0000)]
Add `is_null` helper

This is cheaper than creating a null-`ScalarInt` and comparing
and then just throwing it away.

3 years agoExplain why we forward to self-printing during self-printing
oli [Sun, 1 Nov 2020 17:15:11 +0000 (17:15 +0000)]
Explain why we forward to self-printing during self-printing

3 years agocatch conversion errors during `ptr_sized_op`
oli [Sun, 1 Nov 2020 17:14:09 +0000 (17:14 +0000)]
catch conversion errors during `ptr_sized_op`

3 years agoReplace `Scalar::zst` with a `Scalar::ZST` constant
oli [Sun, 1 Nov 2020 17:04:13 +0000 (17:04 +0000)]
Replace `Scalar::zst` with a `Scalar::ZST` constant

3 years agoNo need for a `zst` constructor method when we can have a constant
oli [Sun, 1 Nov 2020 17:01:34 +0000 (17:01 +0000)]
No need for a `zst` constructor method when we can have a constant

3 years agoUpdate comment
oli [Sun, 1 Nov 2020 17:00:09 +0000 (17:00 +0000)]
Update comment

3 years agoUnaligned reads are UB in Rust irrelevant on which platform we are
oli [Sun, 1 Nov 2020 16:59:00 +0000 (16:59 +0000)]
Unaligned reads are UB in Rust irrelevant on which platform we are

3 years agoRemove outdated FIXME
oli [Sun, 1 Nov 2020 16:58:16 +0000 (16:58 +0000)]
Remove outdated FIXME

3 years agos/Scalar::Raw/Scalar::Int
oli [Sun, 1 Nov 2020 16:57:03 +0000 (16:57 +0000)]
s/Scalar::Raw/Scalar::Int

3 years agos/Scalar::Raw/Scalar::Int
oli [Sun, 1 Nov 2020 16:57:03 +0000 (16:57 +0000)]
s/Scalar::Raw/Scalar::Int

3 years agoFix cranelift build
oli [Thu, 29 Oct 2020 13:30:47 +0000 (13:30 +0000)]
Fix cranelift build

3 years agoExplain the use of blocks around `self.data` accesses
oli [Thu, 29 Oct 2020 10:29:26 +0000 (10:29 +0000)]
Explain the use of blocks around `self.data` accesses

3 years agoUse packed struct instead of manually packing into an array
oli [Thu, 29 Oct 2020 10:15:54 +0000 (10:15 +0000)]
Use packed struct instead of manually packing into an array

3 years agoAdd link to rust website
Guillaume Gomez [Wed, 4 Nov 2020 10:06:42 +0000 (11:06 +0100)]
Add link to rust website

3 years agoSplit the "raw integer bytes" part out of `Scalar`
Oliver Scherer [Sat, 26 Sep 2020 13:15:35 +0000 (15:15 +0200)]
Split the "raw integer bytes" part out of `Scalar`

3 years ago32 bit platforms don't have 64 bit pointers
Oliver Scherer [Thu, 1 Oct 2020 10:51:44 +0000 (12:51 +0200)]
32 bit platforms don't have 64 bit pointers

3 years agoEncode `ScalarInt::bytes` as `u128` instead of `[u8; 16]` to see if that caused the...
Oliver Scherer [Thu, 1 Oct 2020 07:47:36 +0000 (09:47 +0200)]
Encode `ScalarInt::bytes` as `u128` instead of `[u8; 16]` to see if that caused the performance regression

3 years agoSplit the "raw integer bytes" part out of `Scalar`
Oliver Scherer [Sat, 26 Sep 2020 13:15:35 +0000 (15:15 +0200)]
Split the "raw integer bytes" part out of `Scalar`

3 years agoAuto merge of #6284 - camsteffen:rustc-sym, r=flip1995
bors [Wed, 4 Nov 2020 09:22:54 +0000 (09:22 +0000)]
Auto merge of #6284 - camsteffen:rustc-sym, r=flip1995

Use const sym where possible

I ran a regex search and replace to use const `sym` values where possible. This should give some performance boost by avoiding string interning at runtime.

Con: It is not as consistent as always using `sym!`.

I also changed an internal lint to suggest using `sym::{}`, making an assumption that this will always work for diagnostic items.

changelog: none

3 years agoAuto merge of #6270 - ClashTheBunny:clarify_allow_deny_enable_disable, r=flip1995
bors [Wed, 4 Nov 2020 08:49:10 +0000 (08:49 +0000)]
Auto merge of #6270 - ClashTheBunny:clarify_allow_deny_enable_disable, r=flip1995

Clarify allow/warn/deny documentation.  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.

Documentation only update.

*Please keep the line below*
changelog: none

3 years agoAddress Pr comments regarding docstrings
Dhruv Jauhar [Wed, 4 Nov 2020 07:54:00 +0000 (02:54 -0500)]
Address Pr comments regarding docstrings

3 years agoMove Copy and Clone into the list of traits implemented for all sizes
est31 [Wed, 4 Nov 2020 00:28:37 +0000 (01:28 +0100)]
Move Copy and Clone into the list of traits implemented for all sizes

3 years agoUpdate wording to avoid code having "lint" metaphor
Randall Mason [Tue, 3 Nov 2020 21:59:24 +0000 (15:59 -0600)]
Update wording to avoid code having "lint" metaphor

3 years agoAuto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-se
bors [Tue, 3 Nov 2020 18:58:06 +0000 (18:58 +0000)]
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

3 years agoRollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum
Mara Bos [Tue, 3 Nov 2020 18:32:44 +0000 (19:32 +0100)]
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

3 years agoRollup merge of #78699 - pietroalbini:lldb-error, r=jyn514
Mara Bos [Tue, 3 Nov 2020 18:32:42 +0000 (19:32 +0100)]
Rollup merge of #78699 - pietroalbini:lldb-error, r=jyn514

Show more error information in lldb_batchmode

Even more information to try and debug #78665.

3 years agoRollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum
Mara Bos [Tue, 3 Nov 2020 18:32:40 +0000 (19:32 +0100)]
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.

3 years agoRollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obk
Mara Bos [Tue, 3 Nov 2020 18:32:38 +0000 (19:32 +0100)]
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

3 years agoRollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank
Mara Bos [Tue, 3 Nov 2020 18:32:36 +0000 (19:32 +0100)]
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
```

3 years agoRollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514
Mara Bos [Tue, 3 Nov 2020 18:32:34 +0000 (19:32 +0100)]
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

3 years agoRollup merge of #77950 - arlosi:sha256, r=eddyb
Mara Bos [Tue, 3 Nov 2020 18:32:26 +0000 (19:32 +0100)]
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`

3 years agoFix panic in bootstrap for non-workspace path dependencies.
Eric Huss [Tue, 3 Nov 2020 17:54:11 +0000 (09:54 -0800)]
Fix panic in bootstrap for non-workspace path dependencies.

3 years agoAuto merge of #6233 - montrivo:manual_ok_or, r=flip1995
bors [Tue, 3 Nov 2020 16:42:59 +0000 (16:42 +0000)]
Auto merge of #6233 - montrivo:manual_ok_or, r=flip1995

add manual_ok_or lint

Implements partially #5923

changelog: add lint manual_ok_or

3 years agoAuto merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=wesleywiser
bors [Tue, 3 Nov 2020 16:32:34 +0000 (16:32 +0000)]
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`

3 years agoAuto merge of #6165 - dvermd:ref_option_ref, r=flip1995
bors [Tue, 3 Nov 2020 16:21:51 +0000 (16:21 +0000)]
Auto merge of #6165 - dvermd:ref_option_ref, r=flip1995

Add lint 'ref_option_ref' #1377

This lint checks for usage of `&Option<&T>` which can be simplified as `Option<&T>` as suggested in #1377.

This WIP PR is here to get feedback on the lint as there's more cases to be handled:
* statics/consts,
* associated types,
* type alias,
* function/method parameter/return,
* ADT definitions (struct/tuple struct fields, enum variants)

changelog: Add 'ref_option_ref' lint

3 years agoPrint a summary of which test suite failed
Mark Rousskov [Tue, 3 Nov 2020 15:43:17 +0000 (10:43 -0500)]
Print a summary of which test suite failed

Especially on CI, where cross-compiling is common and single builder may end up
with multiple hosts and multiple targets, it can be annoying to scroll back to
the nearest start of test marker. This prints out a summary of the test suite
being run directly in compiletest.

3 years agoAuto merge of #6101 - pitiK3U:from_iter_instead_of_collect, r=flip1995
bors [Tue, 3 Nov 2020 15:59:16 +0000 (15:59 +0000)]
Auto merge of #6101 - pitiK3U:from_iter_instead_of_collect, r=flip1995

Add lint: from_iter_instead_of_collect

Fixes #5679

This implements lint for `::from_iter()` from #5679 not the general issue (`std::ops::Add::add`, etc.).
This lint checks if expression is function call with `from_iter` name and if it's implementation of the `std::iter::FromIterator` trait.

changelog: Introduce  from_iter_instead_of_collect lint

3 years agoFix: Use `.collect()` instead of `::fromIterator()`
Piti the little Light [Sat, 24 Oct 2020 11:53:09 +0000 (13:53 +0200)]
Fix: Use `.collect()` instead of `::fromIterator()`

3 years agoFix: Don't show lint for types that doesn't implement Iterator
Piti the little Light [Mon, 12 Oct 2020 15:27:50 +0000 (17:27 +0200)]
Fix: Don't show lint for types that doesn't implement Iterator

3 years agoImprove error message
Piti the little Light [Thu, 1 Oct 2020 17:04:19 +0000 (19:04 +0200)]
Improve error message

3 years agoRemove backticks
Piti the little Light [Thu, 1 Oct 2020 16:44:12 +0000 (18:44 +0200)]
Remove backticks

3 years agoRun `cargo dev fmt`
Piti the little Light [Thu, 1 Oct 2020 16:36:49 +0000 (18:36 +0200)]
Run `cargo dev fmt`

3 years agoImprove: error message
Piti the little Light [Thu, 1 Oct 2020 16:34:36 +0000 (18:34 +0200)]
Improve: error message

3 years agoAllow lint
Piti the little Light [Thu, 1 Oct 2020 16:17:50 +0000 (18:17 +0200)]
Allow  lint

3 years agoImprovements from PR feedback
Piti the little Light [Thu, 1 Oct 2020 16:04:05 +0000 (18:04 +0200)]
Improvements from PR feedback

3 years agoUpdate: stderr message format
Piti the little Light [Thu, 1 Oct 2020 10:36:17 +0000 (12:36 +0200)]
Update: stderr message format

3 years agoFix `from_iter_instead_of_collect` lint crashing on exprs without path segment
Piti the little Light [Fri, 11 Sep 2020 11:29:52 +0000 (13:29 +0200)]
Fix `from_iter_instead_of_collect` lint crashing on exprs without path segment

3 years agoAdd tests for `from_iter_instead_of_collect`
Piti the little Light [Thu, 10 Sep 2020 18:18:23 +0000 (20:18 +0200)]
Add tests for `from_iter_instead_of_collect`

3 years agoRun `cargo dev update_lints`
Piti the little Light [Thu, 10 Sep 2020 18:16:28 +0000 (20:16 +0200)]
Run `cargo dev update_lints`

3 years agoAdd `from_iter_instead_of_collect` lint implementation
Piti the little Light [Thu, 10 Sep 2020 18:14:23 +0000 (20:14 +0200)]
Add `from_iter_instead_of_collect` lint implementation

3 years agoAuto merge of #6037 - matthiaskrgr:single_char_insert, r=flip1995
bors [Tue, 3 Nov 2020 15:36:33 +0000 (15:36 +0000)]
Auto merge of #6037 - matthiaskrgr:single_char_insert, r=flip1995

single_char_insert_str: lint using insert_str() on single-char literals and suggest insert()

Fixes #6026

changelog: add single_char_insert_str lint which lints using string.insert_str() with single char literals and suggests string.insert() with a char

3 years agoAuto merge of #78597 - RalfJung:raw-retag, r=oli-obk
bors [Tue, 3 Nov 2020 13:48:54 +0000 (13:48 +0000)]
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.^^

3 years agoreview comments
Vishnunarayan K I [Tue, 3 Nov 2020 11:44:51 +0000 (17:14 +0530)]
review comments

3 years agobuild-manifest: remove legacy promote-release support
Pietro Albini [Tue, 3 Nov 2020 11:15:06 +0000 (12:15 +0100)]
build-manifest: remove legacy promote-release support

This commit removes support for the legacy promote-release, as that's
not executed anymore on the nightly channel.

3 years agolldb_batchmode: show more error information
Pietro Albini [Tue, 3 Nov 2020 11:01:46 +0000 (12:01 +0100)]
lldb_batchmode: show more error information

Even more information to try and debug #78665.

3 years agoMerge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020...
bjorn3 [Tue, 3 Nov 2020 10:00:04 +0000 (11:00 +0100)]
Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020-11-01

3 years agoAuto merge of #78489 - bugadani:array, r=estebank
bors [Tue, 3 Nov 2020 09:19:01 +0000 (09:19 +0000)]
Auto merge of #78489 - bugadani:array, r=estebank

Minor cleanup around incremental compilation

* Remove some short lived vectors
* Fix some typos
* Avoid some reallocations

3 years agoadd tests
Vishnunarayan K I [Tue, 3 Nov 2020 09:10:42 +0000 (14:40 +0530)]
add tests

3 years agoAuto merge of #78697 - JohnTitor:rollup-q0fchpv, r=JohnTitor
bors [Tue, 3 Nov 2020 06:56:46 +0000 (06:56 +0000)]
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

3 years agopreserve bindings order for Some
Vishnunarayan K I [Tue, 3 Nov 2020 06:45:41 +0000 (12:15 +0530)]
preserve bindings order for Some

3 years agoRollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievink
Yuki Okushi [Tue, 3 Nov 2020 06:27:21 +0000 (15:27 +0900)]
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`

3 years agoRollup merge of #78668 - tmiasko:inline, r=oli-obk
Yuki Okushi [Tue, 3 Nov 2020 06:27:19 +0000 (15:27 +0900)]
Rollup merge of #78668 - tmiasko:inline, r=oli-obk

inliner: Remove redundant loop

No functional changes intended.

3 years agoRollup merge of #78664 - pickfire:patch-4, r=jonas-schievink
Yuki Okushi [Tue, 3 Nov 2020 06:27:18 +0000 (15:27 +0900)]
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

3 years agoRollup merge of #78663 - Aaron1011:fix/cap-future-compat, r=tmandry
Yuki Okushi [Tue, 3 Nov 2020 06:27:16 +0000 (15:27 +0900)]
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).

3 years agoRollup merge of #78616 - richkadel:unstable-book-instr-cov, r=tmandry
Yuki Okushi [Tue, 3 Nov 2020 06:27:13 +0000 (15:27 +0900)]
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.

3 years agoRollup merge of #78575 - tmiasko:compiletest-rustc-env, r=Aaron1011
Yuki Okushi [Tue, 3 Nov 2020 06:27:11 +0000 (15:27 +0900)]
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.

3 years agoRollup merge of #78400 - GuillaumeGomez:fix-unindent, r=jyn514
Yuki Okushi [Tue, 3 Nov 2020 06:27:05 +0000 (15:27 +0900)]
Rollup merge of #78400 - GuillaumeGomez:fix-unindent, r=jyn514

Fix unindent in doc comments

Fixes #70732

r? ``@jyn514``

3 years agoRollup merge of #78376 - Aaron1011:feature/consistent-empty-expr, r=petrochenkov
Yuki Okushi [Tue, 3 Nov 2020 06:27:03 +0000 (15:27 +0900)]
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.

3 years agoAuto merge of #78448 - rylev:cache-foreign_modules, r=wesleywiser
bors [Tue, 3 Nov 2020 04:27:27 +0000 (04:27 +0000)]
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.

3 years agoAuto merge of #77271 - petrochenkov:notokenexp, r=Aaron1011
bors [Tue, 3 Nov 2020 00:58:24 +0000 (00:58 +0000)]
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

3 years agoSuggest library/std when running all stage 0 tests
Joshua Nelson [Mon, 2 Nov 2020 22:34:28 +0000 (17:34 -0500)]
Suggest library/std when running all stage 0 tests

3 years agoadd mipsel-unknown-none target
Stephan [Mon, 2 Nov 2020 22:31:15 +0000 (23:31 +0100)]
add mipsel-unknown-none target

3 years agoindicate calling convention
Stephan [Mon, 2 Nov 2020 22:29:00 +0000 (23:29 +0100)]
indicate calling convention

3 years agoimprove comments
Stephan [Mon, 2 Nov 2020 22:18:32 +0000 (23:18 +0100)]
improve comments

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoExpand `NtExpr` tokens only in key-value attributes
Vadim Petrochenkov [Sun, 27 Sep 2020 13:52:51 +0000 (16:52 +0300)]
Expand `NtExpr` tokens only in key-value attributes

3 years agoadd blacklist for unsupported calling conventions
Stephan [Mon, 2 Nov 2020 21:52:47 +0000 (22:52 +0100)]
add blacklist for unsupported calling conventions

3 years agoaddressed feedback
Rich Kadel [Mon, 2 Nov 2020 19:59:24 +0000 (11:59 -0800)]
addressed feedback

3 years agoUse reparsed `TokenStream` if we captured any inner attributes
Aaron Hill [Mon, 2 Nov 2020 18:22:03 +0000 (13:22 -0500)]
Use reparsed `TokenStream` if we captured any inner attributes

Fixes #78675

We now bail out of `prepend_attrs` if we ended up capturing any inner
attributes (which can happen in several places, due to token capturing
for `macro_rules!` arguments.

3 years agoMerge pull request #1105 from bjorn3/test_rustc_bootstrapping
bjorn3 [Mon, 2 Nov 2020 18:14:50 +0000 (19:14 +0100)]
Merge pull request #1105 from bjorn3/test_rustc_bootstrapping

Test bootstrapping of rustc using cg_clif

3 years agoadd mipsel_unknown_none target
Stephan [Mon, 2 Nov 2020 18:11:24 +0000 (19:11 +0100)]
add mipsel_unknown_none target

3 years agoTreat trailing semicolon as a statement in macro call
Aaron Hill [Sun, 25 Oct 2020 21:14:19 +0000 (17:14 -0400)]
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.

3 years agoTest bootstrapping of rustc using cg_clif
bjorn3 [Sun, 1 Nov 2020 15:57:14 +0000 (16:57 +0100)]
Test bootstrapping of rustc using cg_clif

3 years agoRevert unintentional change
bjorn3 [Mon, 2 Nov 2020 17:54:10 +0000 (18:54 +0100)]
Revert unintentional change

3 years agoChange lint to use const sym
Cameron Steffen [Mon, 2 Nov 2020 17:47:17 +0000 (11:47 -0600)]
Change lint to use const sym

3 years agoUse const rustc sym where possible
Cameron Steffen [Mon, 2 Nov 2020 16:32:55 +0000 (10:32 -0600)]
Use const rustc sym where possible

3 years agoMerge pull request #1104 from bjorn3/build_system_refactor
bjorn3 [Mon, 2 Nov 2020 17:46:36 +0000 (18:46 +0100)]
Merge pull request #1104 from bjorn3/build_system_refactor

Build system refactor

3 years agoUpload prebuilt cg_clif
bjorn3 [Mon, 2 Nov 2020 17:24:21 +0000 (18:24 +0100)]
Upload prebuilt cg_clif

3 years agoRefactor the build system
bjorn3 [Mon, 2 Nov 2020 17:16:57 +0000 (18:16 +0100)]
Refactor the build system

3 years agonew fix method and update tests
Vishnunarayan K I [Mon, 2 Nov 2020 16:59:20 +0000 (22:29 +0530)]
new fix method and update tests

3 years agoAuto merge of #78607 - HeroicKatora:post-order-walk-iter, r=davidtwco
bors [Mon, 2 Nov 2020 16:01:10 +0000 (16:01 +0000)]
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).

3 years agoAuto merge of #78667 - pietroalbini:lldb-unbuffered, r=Mark-Simulacrum
bors [Mon, 2 Nov 2020 13:07:01 +0000 (13:07 +0000)]
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.

3 years agoImprove deprecation attribute diagnostic messages.
Mara Bos [Mon, 2 Nov 2020 12:17:14 +0000 (13:17 +0100)]
Improve deprecation attribute diagnostic messages.

(From the PR feedback.)

Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
3 years agocompiletest: try running lldb_batchmode.py with PYTHONUNBUFFERED
Pietro Albini [Mon, 2 Nov 2020 12:20:16 +0000 (13:20 +0100)]
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.