Commit Graph

102823 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
4bd9168d7f
Rollup merge of #66514 - GuillaumeGomez:fix-search-filter-save, r=kinnison
Fix selected crate search filter

Fixes #62929.

r? @kinnison
2019-11-20 18:32:10 +01:00
Mazdak Farrokhzad
5a84f9b86e
Rollup merge of #66496 - petrochenkov:metapriv2, r=eddyb
rustc_metadata: Privatize more things

Continuation of https://github.com/rust-lang/rust/pull/66056.

The most notable change here is that `CrateMetadata` is moved from `cstore.rs` to `decoder.rs`.
Most of uses of `CrateMetadata` fields are in the decoder and uses of `root: CrateRoot` and other fields are so intertwined with each other that it would be hard to move a part of them into `cstore.rs` to privatize `CrateMetadata` fields, so we are going the other way round.

`cstore.rs` can probably be dismantled now, but I'll leave this to some other day.
Similarly, remaining `CrateMetadata` fields can be privatized by introducing some getter/setter methods, but not today.

r? @eddyb
2019-11-20 18:32:09 +01:00
Mazdak Farrokhzad
647eda17e8
Rollup merge of #66457 - cjgillot:just_hashstable, r=Zoxc
Just derive Hashstable in librustc

Split out of #66279

r? @Zoxc
2019-11-20 18:32:07 +01:00
Mazdak Farrokhzad
00cbc75c74
Rollup merge of #66298 - Ppjet6:disable-search-field, r=GuillaumeGomez
rustdoc: fixes #64305: disable search field instead of hidding it

The result seems to be ok but I wasn't entirely sure how to get there. I tried to stay generic a bit but maybe it's not required at all.

@GuillaumeGomez

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 18:32:06 +01:00
Mazdak Farrokhzad
e32397a754
Rollup merge of #66060 - traxys:test_65401, r=michaelwoerister
Making ICEs and test them in incremental

This adds:
 - A way to make the compiler ICE
 - A way to check for ICE in `cfail` tests with `should-ice`
 - A regression test for issue #65401

I am not sure the attribute added `should-ice` is the best for this job
2019-11-20 18:32:04 +01:00
Mark Rousskov
7ec20dd31d Remove pretty printing of specific nodes in AST
The ability to print a specific item as identified by NodeId or path
seems not particularly useful, and certainly carries quite a bit of
complexity with it.
2019-11-20 12:10:23 -05:00
Felix S. Klock II
9b40e0bb9a made gdb pretty-printing script more robust when printing uninitialized vec.
I based this solution on my reading of:

https://rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers#what-is-still-to-be-done

That post claims that there is no clean way to check for garbage pointers, and
so this PR adopts the same solution of tentatively attempting to convert a
dererence to a string, which throws a clean exception on garbage that we can
catch and recover from.

I only made the change to vec and not the other pretty printers because I wanted
to focus my effort on the simplest thing that would resolve issue #64343. In
particular, I *considered* generalizing this fix to work on the other datatypes
in the pretty-printing support library, but I don't want to invest effort in
that until after we resolve our overall debugging support strategy; see also
issues #60826 and #65564.
2019-11-20 16:37:17 +01:00
bors
b9cf541789 Auto merge of #66571 - Centril:rollup-41tn2fw, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #65665 (Update Source Code Pro and include italics)
 - #66478 (rustc_plugin: Remove the compatibility shim)
 - #66497 (Fix #53820)
 - #66526 (Add more context to `async fn` trait error)
 - #66532 (Generate DWARF address ranges for faster lookups)
 - #66546 (Remove duplicate function)
 - #66548 ([RISCV] Disable Atomics on all Non-A RISC-V targets)
 - #66553 (remove HermitCore leftovers from sys/unix)

Failed merges:

r? @ghost
2019-11-20 14:04:12 +00:00
Felix S. Klock II
6ab28b50da Ignore run-make reproducible-build-2 on Mac (we already ignore it on Windows).
Until we can dedicate resources to fixing this properly, I think we are
best off just ignoring this test on platforms/contexts where it does not
matter as much.
2019-11-20 14:07:01 +01:00
Mazdak Farrokhzad
ebd0ef9a39
Rollup merge of #66553 - hermitcore:hermit, r=rkruppe
remove HermitCore leftovers from sys/unix

HermitCore support is already moved to the directory "sys/hermit". => remove leftovers
2019-11-20 12:58:37 +01:00
Mazdak Farrokhzad
fff8ae1aa8
Rollup merge of #66548 - lenary:riscv/disable-atomics-non-a, r=alexcrichton
[RISCV] Disable Atomics on all Non-A RISC-V targets

In a `TargetOptions` configuration, `max_atomic_width: None` causes `max_atomic_width()` to return `Some(target_pointer_width)`. So, contrary to assumptions, `max_atomic_width: None` means you do have atomic support!

RISC-V's rv32i and rv32imc do not have architectural support for atomic memory accesses of any size, because they do not include the `A` architecture extension. This means the values in the target definition should be `Some(0)`.

This bug has been observed via a build failure with oreboot/oreboot#191, where LLVM was still generating libcalls for atomic operations. According to rust-lang/compiler-builtins, "Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations." - so this PR tries to bring rustc inline with this decision.

This commit also removes the outdated bug link, which references a now irrelevant GCC bug.

I will likely also have to revisit the `min_atomic_width` of all the RISC-V targets so they are correct and match what the hardware is capable of (which is more restricted than one might imagine).

r? @alexcrichton
2019-11-20 12:58:35 +01:00
Mazdak Farrokhzad
4997604503
Rollup merge of #66546 - aradzie:remove_duplicate_function, r=Dylan-DPC
Remove duplicate function

Function `source_name` declared in file

[src/librustc_driver/lib.rs](https://github.com/rust-lang/rust/blob/master/src/librustc_driver/lib.rs#L87)

is a duplicate of the function by the same name declared in file

[src/librustc/session/config.rs](https://github.com/rust-lang/rust/blob/master/src/librustc/session/config.rs#L511)
2019-11-20 12:58:33 +01:00
Mazdak Farrokhzad
1346557ba1
Rollup merge of #66532 - cuviper:dwarf-aranges, r=michaelwoerister
Generate DWARF address ranges for faster lookups

This adds a new option `-Zgenerate-arange-section`, enabled by default,
corresponding to LLVM's `-generate-arange-section`. This creates a
`.debug_aranges` section with DWARF address ranges, which some tools
depend on to optimize address lookups (elfutils [22288], [25173]).

This only has effect when debuginfo is enabled, and the additional data
is small compared to the other debug sections. For example, libstd.so
with full debuginfo is about 11MB, with just 61kB in aranges.

[22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288
[25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173

Closes #45246.
r? @michaelwoerister
2019-11-20 12:58:32 +01:00
Mazdak Farrokhzad
0a0d07a1fc
Rollup merge of #66526 - estebank:async-fn-trait-information, r=Centril
Add more context to `async fn` trait error

Follow up to #65937. Fix #65899.
2019-11-20 12:58:30 +01:00
Mazdak Farrokhzad
2d6e3764b4
Rollup merge of #66497 - Nadrieril:fix-53820, r=varkor
Fix #53820

This fixes ICE #53820 by being more clever when matching large arrays with slice patterns.
In particular, it avoids treating large arrays like large tuples, and instead reuses the `VarLenSlice` constructor behaviour to only consider as little values as needed.
As a side-effect, such matches also get improved diagnostics, by reporting `[true, ..]` missing instead of `[true, _, _, _, _, _, _, _]`.
2019-11-20 12:58:29 +01:00
Mazdak Farrokhzad
3ef2384e50
Rollup merge of #66478 - petrochenkov:rmplugin, r=davidtwco
rustc_plugin: Remove the compatibility shim

The compatibility crate was introduced in https://github.com/rust-lang/rust/pull/62727 to migrate Cargo and some other tools, but now it's no longer necessary.
2019-11-20 12:58:27 +01:00
Mazdak Farrokhzad
423137b779
Rollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics

Fixes #65502.

A few notes:
  * As stated in #65502, this does increase the download size.
  * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged.
  * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files ([Source Code Pro otf renders poorly on older Windows system apps](https://github.com/adobe-fonts/source-code-pro/issues/25#issuecomment-9019600)).
2019-11-20 12:58:26 +01:00
Guillaume Gomez
572133845a Change background-color of search input if disabled 2019-11-20 12:57:47 +01:00
bors
ea540b0892 Auto merge of #66392 - estebank:trait-alias-ice, r=eddyb
Do not ICE on trait aliases with missing obligations

Fix #65673.
2019-11-20 10:51:26 +00:00
Maxime “pep” Buquet
5cbd406a14 rustdoc: fixes #64305: disable search field instead of hidding it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 11:32:58 +01:00
bors
f50d6ea348 Auto merge of #66104 - yodaldevoid:generic-arg-disambiguation, r=petrochenkov
Generic arg disambiguation

Using the tactic suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/60804#issuecomment-516769465 and on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation), this change checks type arguments to see if they are really incorrectly-parsed const arguments.

it should be noted that `segments.len() == 1 && segments[0].arg.is_none()` was reduced to `segments.len() == 1` as suggested by @petrochenkov in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation/near/177848002). This change allowed a few more existing tests to have their braces removed.

There are a couple of "problems" with these changes that I should note. First, there was a regression in the error messages found in "src/test/ui/privacy-ns1.rs" and "src/test/ui/privacy-ns1.rs". Second, some braces were unable to be removed from "src/test/ui/const-generics/fn-const-param-infer.rs". Those on line 24 caused the statement to stop equating when removed, and those on line 20 cause a statement that should not equate to produce no error when removed.

I have not looked further into any of these issues yet, though I would be willing to look into them before landing this. I simply wanted to get some other eyes on this before going further.

Fixes #60804

cc @varkor @jplatte
2019-11-20 03:07:39 +00:00
Mark Rousskov
39c0fa847e Move syntax_expand::config to rustc_parse::config 2019-11-19 21:35:11 -05:00
Aaron Hill
778bb7116f
Bump Miri for panic unwinding support 2019-11-19 16:40:59 -05:00
Camille GILLOT
579625b9e7 Revert expansion of impl HashStable for Frame. 2019-11-19 20:48:11 +01:00
Camille GILLOT
4da5fe7fdb Fix derive syntax. 2019-11-19 20:48:08 +01:00
Camille GILLOT
7db84e8504 Fix project syntax. 2019-11-19 20:48:06 +01:00
Camille GILLOT
d9eaaf5973 Derive HashStable in librustc_mir. 2019-11-19 20:48:02 +01:00
Camille GILLOT
e1522fa183 Derive HashStable more. 2019-11-19 20:47:57 +01:00
Camille GILLOT
781866f3a9 More HashStable. 2019-11-19 20:47:31 +01:00
Stefan Lankes
ab6cb01971 HermitCore support is moved to sys/hermit, remove obsolete statement in sys/unix 2019-11-19 20:43:06 +01:00
Camille GILLOT
c4bc3f05f5 More HashStable. 2019-11-19 20:40:28 +01:00
Camille GILLOT
e00ebd725f Derive HashStable in librustc. 2019-11-19 20:32:35 +01:00
Esteban Kuber
a079159c64
Remove desugared async-trait example 2019-11-19 11:29:20 -08:00
Jeremy Fitzhardinge
6dee1a5a9f Add unix::process::CommandExt::arg0
This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].

Does Fuchsia have the same semantics?

Addresses: #66510
2019-11-19 11:01:52 -08:00
Josh Stone
4c2f1c802c Mark -Zgenerate-arange-section as TRACKED 2019-11-19 09:13:10 -08:00
Dylan DPC
846f5e6bb9
Update E0706.md 2019-11-19 17:09:39 +01:00
Sam Elliott
ca42c25598 [RISCV] Disable Atomics on all Non-A RISC-V targets 2019-11-19 15:29:43 +00:00
bors
618b01f9fa Auto merge of #66454 - cjgillot:lift, r=Zoxc
Derive Lift using a proc-macro

Based on #66384

r? @Zoxc
2019-11-19 15:24:09 +00:00
Aliaksandr Radzivanovich
303d2f2e87 Remove duplicate function
Function source_name declared in file

  src/librustc_driver/lib.rs

is a duplicate of a function by the same name declared in file

  src/librustc/session/config.rs
2019-11-19 14:22:07 +01:00
bors
9d6ff1553b Auto merge of #66545 - Centril:rollup-xv2rx7v, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #66090 (Misc CI improvements)
 - #66155 (Add long error explanation for E0594)
 - #66239 (Suggest calling async closure when needed)
 - #66430 ([doc] Fix the source code highlighting on source comments)
 - #66431 (Fix 'type annotations needed' error with opaque types)
 - #66461 (Add explanation message for E0641)
 - #66493 (Add JohnTitor to rustc-guide toolstate notification list)
 - #66511 (std::error::Chain: remove Copy)
 - #66529 (resolve: Give derive helpers highest priority during resolution)
 - #66536 (Move the definition of `QueryResult` into `plumbing.rs`.)
 - #66538 (Remove compiler_builtins_lib feature from libstd)

Failed merges:

r? @ghost
2019-11-19 12:11:09 +00:00
Mazdak Farrokhzad
e1a32faf88
Rollup merge of #66538 - dingelish:master, r=Centril
Remove compiler_builtins_lib feature from libstd

Test if we can close #66368 by this patch.
2019-11-19 13:10:26 +01:00
Mazdak Farrokhzad
0ddd298a45
Rollup merge of #66536 - nnethercote:mv-QueryResult, r=Centril
Move the definition of `QueryResult` into `plumbing.rs`.

Because it's the only file that uses it, and removes the need for importing it.

r? @Centril
2019-11-19 13:10:24 +01:00
Mazdak Farrokhzad
1f0f0adbf4
Rollup merge of #66529 - petrochenkov:reshelp2, r=davidtwco
resolve: Give derive helpers highest priority during resolution

So they just shadow everything else and don't create ambiguity errors.
This matches the old pre-#64694 behavior most closely.

---
The change doesn't apply to this "compatibility" case
```rust
#[trait_helper] // The helper attribute is used before it introduced.
                        // Sadly, compiles on stable, supported via hacks.
                        // I plan to make a compatibility warning for this.
#[derive(Trait)]
struct S;
```
, such attributes still create ambiguities, but #64694 didn't change anything for this case.

Fixes https://github.com/rust-lang/rust/issues/66508
Fixes https://github.com/rust-lang/rust/issues/66525
2019-11-19 13:10:23 +01:00
Mazdak Farrokhzad
42e3b86045
Rollup merge of #66511 - haraldh:error_chain_nocopy, r=dtolnay
std::error::Chain: remove Copy

remove Copy from Iterator as per comment
https://github.com/rust-lang/rust/issues/58520#issuecomment-553682166

Tracker: #58520
2019-11-19 13:10:22 +01:00
Mazdak Farrokhzad
e99e5fb67d
Rollup merge of #66493 - JohnTitor:ping-me-rustc-guide, r=spastorino
Add JohnTitor to rustc-guide toolstate notification list

Add JohnTitor to rustc-guide toolstate notification list
Also, update org names of some books

r? @spastorino
2019-11-19 13:10:20 +01:00
Mazdak Farrokhzad
b5166b1e85
Rollup merge of #66461 - clemencetbk:master, r=GuillaumeGomez
Add explanation message for E0641

Part of #61137
2019-11-19 13:10:19 +01:00
Mazdak Farrokhzad
ee535a0f95
Rollup merge of #66431 - Aaron1011:fix/opaque-type-infer, r=varkor
Fix 'type annotations needed' error with opaque types

Related: #66426

This commit adds handling for opaque types during inference variable
fallback. Type variables generated from the instantiation of opaque
types now fallback to the opaque type itself.

Normally, the type variable for an instantiated opaque type is either
unified with the concrete type, or with the opaque type itself (e.g when
a function returns an opaque type by calling another function).

However, it's possible for the type variable to be left completely
unconstrained. This can occur in code like this:

```rust
pub type Foo = impl Copy;
fn produce() -> Option<Foo> {
    None
}
```

Here, we'll instantatiate the `Foo` in `Option<Foo>` to a fresh type
variable, but we will never unify it with anything due to the fact
that we return a `None`.

This results in the error message:
```
type annotations needed: cannot resolve `_: std::marker::Copy
```

pointing at `pub type Foo = impl Copy`.

This message is not only confusing, it's incorrect. When an opaque type
inference variable is completely unconstrained, we can always fall back
to using the opaque type itself. This effectively turns that particular
use of the opaque type into a non-defining use, even if it appears in a
defining scope.
2019-11-19 13:10:17 +01:00
Mazdak Farrokhzad
95b9766e0a
Rollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez
[doc] Fix the source code highlighting on source comments

The code would always forget the previous selection.

r? @GuillaumeGomez
2019-11-19 13:10:15 +01:00
Mazdak Farrokhzad
0b0d683805
Rollup merge of #66239 - estebank:suggest-async-closure-call, r=Centril
Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
2019-11-19 13:10:14 +01:00
Mazdak Farrokhzad
40deec82bc
Rollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPC
Add long error explanation for E0594

Part of #61137.

r? @Dylan-DPC
2019-11-19 13:10:12 +01:00