Commit graph

132783 commits

Author SHA1 Message Date
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
Cameron Steffen
b2332a7357 Change lint to use const sym 2020-11-02 11:52:17 -06:00
Cameron Steffen
22cc77a232 Use const rustc sym where possible 2020-11-02 11:46:37 -06: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
Vishnunarayan K I
6bdce7bedd new fix method and update tests 2020-11-02 22:29:20 +05:30
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
Vishnunarayan K I
9088807dd3 update mir tests 2020-11-02 13:48:53 +05:30
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
bors
c45255b145 Auto merge of #6282 - giraffate:sync-from-rust, r=ebroto
Rustup

changelog: none
2020-11-02 07:36:35 +00:00
Vishnunarayan K I
5dee38d8bb update some ui tests and update move ref drop semantics output 2020-11-02 12:30:38 +05:30
Yuki Okushi
2da86a1bfd Add "this has type {} which {}" note 2020-11-02 15:53:59 +09:00
Yuki Okushi
66226ca157 Address some code reviews 2020-11-02 15:53:59 +09:00
Yuki Okushi
ad978e5572 Separate complex multispan into some notes 2020-11-02 15:53:59 +09:00
Yuki Okushi
c2695255a5 Avoid complex diagnostics in snippets which contain newlines 2020-11-02 15:53:58 +09:00
Aaron Hill
6c1f15fa81
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-02 01:43:25 -05:00
Dhruv Jauhar
5f973264bd Provide diagnostic suggestion in ExprUseVisitor Delegate
The [Delegate
trait](981346fc07/compiler/rustc_typeck/src/expr_use_visitor.rs (L28-L38))
currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

 Closes: https://github.com/rust-lang/project-rfc-2229/issues/20
2020-11-02 01:31:34 -05:00
Dhruv Jauhar
1f53754236 Provide diagnostic suggestion in ExprUseVisitor Delegate
The [Delegate
trait](981346fc07/compiler/rustc_typeck/src/expr_use_visitor.rs (L28-L38))
currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

 Closes: https://github.com/rust-lang/project-rfc-2229/issues/20
2020-11-02 01:31:34 -05:00
Yuki Okushi
50d7716efb
Rollup merge of #78637 - mystor:atomic_ptr_bool, r=m-ou-se
Add fetch_update methods to AtomicBool and AtomicPtr

These methods were stabilized for the integer atomics in #71843, but the methods were not added for the non-integer atomics `AtomicBool` and `AtomicPtr`.
2020-11-02 14:14:41 +09:00
Yuki Okushi
fb7948e7c1
Rollup merge of #78627 - est31:total_cmp_no_superset, r=m-ou-se
Point out that total_cmp is no strict superset of partial comparison

Partial comparison and total_cmp are not equal. This helps
preventing the mistake of creating float wrappers that
base their Ord impl on total_cmp and their PartialOrd impl on
the PartialOrd impl of the float type. PartialOrd and Ord
[are required to agree with each other](https://doc.rust-lang.org/std/cmp/trait.Ord.html#how-can-i-implement-ord).
2020-11-02 14:14:38 +09:00
Yuki Okushi
7baf48ffc0
Rollup merge of #78620 - gabhijit:bitops_doc_fix, r=m-ou-se
Trivial fixes to bitwise operator documentation

Added fixes to documentation of `BitAnd`, `BitOr`, `BitXor` and
`BitAndAssign`, where the documentation for implementation on
`Vector<bool>` was using logical operators in place of the bitwise
operators.

r? @steveklabnik
Closes #78619
2020-11-02 14:14:36 +09:00
Yuki Okushi
61305d5ab4
Rollup merge of #78610 - petrochenkov:nostriptok, r=Aaron1011
Do not remove tokens before AST json serialization

`TokenStripper` is error-prone and introduces one more use of `MutVisitor`.
It's much simpler to treat serialization as just one more place that wants lazy token stream to turn into a real token stream.
Also, no code is better than more code, in general.
r? @Aaron1011

(I also merged tests for `TokenStripper` ICEs into one.)
2020-11-02 14:14:34 +09:00
Yuki Okushi
0fdb371d5a
Rollup merge of #78606 - autarch:patch-1, r=m-ou-se
Clarify handling of final line ending in str::lines()

I found the description as it stands a bit confusing. I've added a bit more explanation to make it clear that a trailing line ending does not produce a final empty line.
2020-11-02 14:14:33 +09:00
bors
3e93027557 Auto merge of #78592 - fpoli:nll-facts-dir, r=matthewjasper
Add option to customize the nll-facts' folder location

This PR adds a `nll-facts-dir` option to specify the location of the directory in which NLL facts are dumped into. It works the same way `dump-mir-dir` controls the location used by the `dump-mir` option.
2020-11-02 04:39:05 +00:00
Rich Kadel
a8dfb26b62 Document -Zinstrument-coverage 2020-11-01 20:13:28 -08:00
Ayrton
ace02c40f0 Corrected suggestion for generic parameters in function_item_references lint
This lint was incorrectly suggesting casting a function to a pointer without
specifying generic type parameters or const generics. This would cause a
compiler error since the missing parameters couldn't be inferred. This commit
fixed the suggestion and added a few tests with generics.
2020-11-01 23:50:17 -04:00
bors
d8ef0d7757 Auto merge of #78645 - JulianKnodt:i78622, r=estebank
Add delay_span_bug to no longer ICE

Fixes #78622

r? `@matthewjasper`
2020-11-02 02:18:36 +00:00
Takayuki Nakata
4a3a249cb6 Merge remote-tracking branch 'upstream/master' into sync-from-rust 2020-11-02 10:34:49 +09:00
bors
3d0682b97a Auto merge of #78605 - nox:relax-elf-relocations, r=nagisa
Implement -Z relax-elf-relocations=yes|no

This lets rustc users tweak whether the linker should relax ELF relocations without recompiling a whole new target with its own libcore etc.
2020-11-02 00:12:32 +00:00
Tomasz Miąsko
c0cbf6368d inliner: Remove redundant loop
No functional changes intended.
2020-11-02 00:00:00 +00:00
kadmin
ab946dd3e7 Add delay_span_bug to no longer ICE 2020-11-01 22:31:19 +00:00
Guillaume Gomez
87f28978c5 Improve code in unindent_comment a bit more 2020-11-01 22:16:42 +01:00
Mara Bos
9fc991a0ea Add test for #[deprecated] attribute on trait impl block. 2020-11-01 20:48:58 +01:00
Mara Bos
6f1992a7d6 Turn 'useless #[deprecated]' error into a lint. 2020-11-01 20:48:58 +01:00
Mara Bos
706bc33651 Use the right span for errors about #[deprecated] attributes. 2020-11-01 20:48:58 +01:00
Mara Bos
0e2337a5d6 Deny #[deprecated] on trait impl blocks.
They have no effect there, but were silently accepted.
2020-11-01 20:48:58 +01:00
Nika Layzell
00f32e6631 Add fetch_update methods to AtomicBool and AtomicPtr
These methods were stabilized for the integer atomics in #71843, but the methods
were not added for the non-integer atomics `AtomicBool` and `AtomicPtr`.
2020-11-01 13:57:45 -05:00
bjorn3
9410b5820a Update build instructions 2020-11-01 19:51:35 +01:00