Commit graph

4988 commits

Author SHA1 Message Date
John Kåre Alsaker
b82ab24bbf Preallocate BUILTIN_ATTRIBUTES symbols and use a hash map instead of looping 2019-04-15 15:20:05 +02:00
bors
aa99abeb26 Auto merge of #59335 - Aaron1011:fix/extern-priv-final, r=Aaron1011
Properly parse '--extern-private' with name and path

It turns out that https://github.com/rust-lang/rust/pull/57586 didn't properly parse `--extern-private name=path`.

This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path.

Part of https://github.com/rust-lang/rust/issues/44663
2019-04-14 19:47:40 +00:00
Mazdak Farrokhzad
9506f62a7a
Rollup merge of #59936 - petrochenkov:confict, r=davidtwco
Fix cross-crate visibility of fictive variant constructors

After merging https://github.com/rust-lang/rust/pull/59376 I realized that the code in the decoder wasn't entirely correct - we "decoded" fictive variant constructors with their variant's visibility, which could be public, rather than demoted to `pub(crate)`.

Fictive constructors are not directly usable in expression/patterns, but the effect still can be observed with imports.

r? @davidtwco
2019-04-14 17:49:26 +02:00
Mazdak Farrokhzad
99a91094ec
Rollup merge of #59896 - estebank:dedup-spans, r=davidtwco
Remove duplicated redundant spans

Fix #59895.
2019-04-14 17:49:21 +02:00
Vadim Petrochenkov
dbc7042bfe Address review comments 2019-04-14 12:37:22 +03:00
Vadim Petrochenkov
3c3a140294 Fix cross-crate visibility of fictive variant constructors 2019-04-14 12:22:44 +03:00
bors
464473ab3b Auto merge of #59798 - rchaser53:issue-59488, r=estebank
Improvement for comparision against fn

I try to add error message.
related: https://github.com/rust-lang/rust/issues/59488
2019-04-14 05:58:13 +00:00
Aaron Hill
21491dc701
Properly parse '--extern-private' with name and path 2019-04-14 00:37:25 -04:00
bors
ee621f4232 Auto merge of #59950 - Centril:rollup-hpmr62i, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59776 (Apply resource-suffix to search-index and source-files scripts as well)
 - #59784 (Suggest importing macros from the crate root)
 - #59812 (Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.)
 - #59874 (Clean up handling of `-Z pgo-gen` commandline option.)
 - #59890 (Don't generate empty json variables)
 - #59911 (Revert "compile crates under test w/ -Zemit-stack-sizes")

Failed merges:

r? @ghost
2019-04-14 01:10:57 +00:00
Mazdak Farrokhzad
c4a3332d38
Rollup merge of #59784 - davidtwco:issue-59764, r=estebank
Suggest importing macros from the crate root

Fixes #59764.

r? @estebank
cc @varkor
2019-04-14 00:39:43 +02:00
Mazdak Farrokhzad
857416b590
Rollup merge of #59899 - nnethercote:sort-enum-variants-by-size, r=pnkfelix
In `-Zprint-type-size` output, sort enum variants by size.

It's useful to see the biggest variants first.

r? @pnkfelix
2019-04-14 00:23:46 +02:00
Mazdak Farrokhzad
abfca1e155
Rollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=Centril
Make duplicate matcher bindings a hard error

r? @Centril

Closes #57742
2019-04-14 00:23:44 +02:00
Mazdak Farrokhzad
449697b7ff
Rollup merge of #59835 - lzutao:nonzero-signed, r=Mark-Simulacrum
Re-export NonZero signed variant in std

Closes  #59834 .
2019-04-14 00:23:39 +02:00
Mazdak Farrokhzad
d5030e2489
Rollup merge of #59708 - matthewjasper:double-closure-unused-mut, r=pnkfelix
Mark variables captured by reference as mutable correctly

Closes #59620

r? @pnkfelix
2019-04-14 00:23:27 +02:00
Mazdak Farrokhzad
bdb264ff5f
Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton
Stabilize the `alloc` crate.

This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-14 00:23:25 +02:00
Esteban Küber
ca5a9ce2a1 Add test and fix dedup 2019-04-12 13:14:15 -07:00
Mazdak Farrokhzad
af4acd0533
Rollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkov
Recover from missing semicolon based on the found token

When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:

```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
  --> $DIR/recover-missing-semi.rs:4:5
   |
LL |     let _: usize = ()
   |                      - help: missing semicolon here
LL |
LL |     let _ = 3;
   |     ^^^

error[E0308]: mismatched types
  --> $DIR/recover-missing-semi.rs:2:20
   |
LL |     let _: usize = ()
   |                    ^^ expected usize, found ()
   |
   = note: expected type `usize`
              found type `()`
```
2019-04-12 20:36:16 +02:00
Mazdak Farrokhzad
ca9f04e41e
Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkov
Tweak unstable diagnostic output
2019-04-12 20:36:15 +02:00
Mazdak Farrokhzad
2bc127dcc7
Rollup merge of #59859 - davidtwco:issue-59756, r=cramertj
Suggest removing `?` to resolve type errors.

Fixes #59756.
2019-04-12 20:36:13 +02:00
Mazdak Farrokhzad
8f111951a1
Rollup merge of #59847 - Kampfkarren:try-block-catch, r=estebank
Error when using `catch` after `try`

Part of https://github.com/rust-lang/rust/issues/31436
2019-04-12 20:36:11 +02:00
Mazdak Farrokhzad
29f9dd2364
Rollup merge of #59846 - euclio:not-a-module, r=davidtwco
clarify what the item is in "not a module" error

The motivation here was that I was trying to import an associated constant when I thought it was an enum variant, and got confused by this error.

Ideally I would like to add a note saying that associated constants, types, and methods cannot be imported, but I'm not sure that the associated items for a `Def` can be checked at resolve time.
2019-04-12 20:36:09 +02:00
Mazdak Farrokhzad
1fb4837bb6
Rollup merge of #59781 - whitfin:issue-59378, r=oli-obk
Remove check_match from const_eval

This fixes #59378.

It seems that the `check_match` may be unnecessary, so this removes it per instructions provided in the issue. I re-ran the tests for `librustc_mir` and everything seemed fine!
2019-04-12 20:36:05 +02:00
Simon Sapin
fc928a18ba Stabilize the alloc crate.
This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-12 20:07:30 +02:00
rchaser53
d01ac0d61e add the logic for when other_ty is FnDef 2019-04-12 23:57:06 +09:00
Nicholas Nethercote
ca1ab3ed30 In -Zprint-type-size output, sort enum variants by size.
It's useful to see the biggest variants first.
2019-04-12 12:18:23 +10:00
David Wood
5158063c3e
Switch to multipart suggestions.
This commit changes the suggestion so that it is split into multiple
parts in an effort to reduce the impact the applied suggestion could
have on formatting.
2019-04-12 01:54:33 +02:00
David Wood
137ffa1022
Improve robustness of nested check.
This commit removes the assumption that the start of a use statement
will always be on one line with a single space - which was silly in the
first place.
2019-04-12 01:54:33 +02:00
David Wood
7c955409e3
Handle edge cases.
This commit introduces more dirty span manipulation into the compiler
in order to handle the various edge cases in moving/renaming the macro
import so it is at the root of the import.
2019-04-12 01:54:33 +02:00
David Wood
d589cf9111
Handle renamed imports.
This commit extends the suggestion to handle imports that are aliased to
another name.
2019-04-12 01:54:32 +02:00
David Wood
d84907bbcc
Suggest macro import from crate root.
This commit suggests importing a macro from the root of a crate as the
intent may have been to import a macro from the definition location that
was annotated with `#[macro_export]`.
2019-04-12 01:54:32 +02:00
Esteban Küber
9b6b3d618c review comments 2019-04-11 14:45:23 -07:00
Mark Mansi
e149dc02a4 remove warn 2019-04-11 15:09:43 -05:00
Esteban Küber
146d040f0b Reword tracking issue note 2019-04-11 11:42:06 -07:00
rchaser53
199b0bad3c improve error messages 2019-04-12 00:27:46 +09:00
Mark Mansi
d7f5c50a33 make duplicate matcher bindings a hard error 2019-04-10 21:29:17 -05:00
Kampfkarren
1156ce6f54 Feedback 2019-04-10 19:22:43 -07:00
Esteban Küber
3ab97062cf Tweak unstable diagnostic output 2019-04-10 18:10:30 -07:00
Esteban Küber
ac037c1359 Recover from missing semicolon based on the found token
When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:

```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
  --> $DIR/recover-missing-semi.rs:4:5
   |
LL |     let _: usize = ()
   |                      - help: missing semicolon here
LL |
LL |     let _ = 3;
   |     ^^^

error[E0308]: mismatched types
  --> $DIR/recover-missing-semi.rs:2:20
   |
LL |     let _: usize = ()
   |                    ^^ expected usize, found ()
   |
   = note: expected type `usize`
              found type `()`
```
2019-04-10 18:07:52 -07:00
David Wood
16592f691b
Suggest removing ? to resolve type errors.
This commit adds a suggestion to remove the `?` from expressions if
removing the `?` would resolve a type error.
2019-04-10 23:52:01 +02:00
Kampfkarren
4af7cf37d4 Fix tests, I think 2019-04-10 14:39:51 -07:00
Kampfkarren
2b6143126d Fix error brought up by changing tabs to spaces 2019-04-10 12:14:53 -07:00
Kampfkarren
de02dd96fd Adhere to tidy script 2019-04-10 10:41:47 -07:00
Kampfkarren
4a938b5b3c Special error when using catch after try 2019-04-10 10:35:48 -07:00
Andy Russell
bbdeafc13c
clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
Lzu Tao
404df312d3 Update ui test 2019-04-10 06:33:43 +00:00
Andy Russell
757ef38431
improve unknown enum variant errors 2019-04-09 14:19:20 -04:00
Isaac Whitfield
d4d2317e02 Update test cases for changes to error messages 2019-04-08 12:21:18 -07:00
rchaser53
aeb1e39b2b Merge remote-tracking branch 'origin/master' 2019-04-08 22:03:17 +09:00
David Wood
77bdb354bf
Add test demonstrating existing behaviour.
This commit adds a test that demonstrates the compiler's current
behaviour when a function attempts to return a value that was unwrapped
by a `?` operator when the omission of `?` would have made the code
compile.
2019-04-08 00:19:58 +02:00
Oliver Scherer
01e83943f9 Only run SIMD tests on x86 2019-04-07 21:46:39 +02:00