Commit Graph

106570 Commits

Author SHA1 Message Date
Josh White
409146673c Removed trailing white spaces 2020-02-08 00:22:15 -05:00
Josh White
69075f065c Merge branch 'master' of https://github.com/jwhite927/rust into E0637 2020-02-07 23:56:44 -05:00
Eduard-Mihai Burtescu
d69b3b16e5 test: address comments and pacify the merciless tidy. 2020-02-08 06:52:09 +02:00
Eduard-Mihai Burtescu
da33935c26 rustc_target: treat enum variants like union members, in call ABIs. 2020-02-08 06:50:59 +02:00
Eduard-Mihai Burtescu
8f81593d6c rustc_target: switch homogeneous_aggregate to returning Result. 2020-02-08 06:50:59 +02:00
John VanEnk
1d28952631 Add non-C-like enumeration tests on Rust->C calls to the abi-sysv64-arg-passing test. 2020-02-08 06:50:59 +02:00
John VanEnk
3b23b9864c Two test cases where Rust calls C using enums by value
One calls into C functions passing non-c-like enumerations by
value. The other calls into C expecting non-C-like enumerations as
returns.

These test cases are based on the tests provided by @bitwalker on
issue #68190. The original tests were provided at:
2688d5c672
2020-02-08 06:50:59 +02:00
Josh White
92fc98c695 Cleaned up long error description 2020-02-07 23:40:16 -05:00
John VanEnk
26bb0f15e7 Add similar examples that work to each test. 2020-02-08 06:17:03 +02:00
John VanEnk
f1b52b34f2 Add a test that demonstrates an incorrect return value when calling into rust with non-c-like-enums. 2020-02-08 06:17:03 +02:00
John VanEnk
cd5ad993d0 Add a test that demonstrates a segfault when calling into rust with non-c-like-enum. 2020-02-08 06:17:02 +02:00
bors
6cad7542da Auto merge of #68358 - matthewjasper:spec-fix, r=nikomatsakis
Remove some unsound specializations

This removes the unsound and exploitable specializations in the standard library

* The `PartialEq` and `Hash` implementations for  `RangeInclusive` are changed to avoid specialization.
* The `PartialOrd` specialization for slices now specializes on a limited set of concrete types.
* Added some tests for the soundness problems.
2020-02-08 03:46:56 +00:00
bors
8498c5f5b0 Auto merge of #65232 - nikomatsakis:lazy-norm-anon-const-push-2, r=matthewjasper
replace the leak check with universes, take 2

This PR is an attempt to revive the "universe-based region check", which is an important step towards lazy normalization. Unlike before, we also modify the definition of `'empty` so that it is indexed by a universe. This sidesteps some of the surprising effects we saw before -- at the core, we no longer think that `exists<'a> { forall<'b> { 'b: 'a } }` is solveable. The new region lattice looks like this:

```
static ----------+-----...------+       (greatest)
|                |              |
early-bound and  |              |
free regions     |              |
|                |              |
scope regions    |              |
|                |              |
empty(root)   placeholder(U1)   |
|            /                  |
|           /         placeholder(Un)
empty(U1) --         /
|                   /
...                /
|                 /
empty(Un) --------                      (smallest)
```
This PR has three effects:

* It changes a fair number of error messages, I think for the better.
* It fixes a number of bugs. The old algorithm was too conservative and caused us to reject legal subtypings.
* It also causes two regressions (things that used to compile, but now do not).
    * `coherence-subtyping.rs` gets an additional error. This is expected.
    * `issue-57639.rs` regresses as before, for the reasons covered in #57639.

Both of the regressions stem from the same underlying property: without the leak check, the instantaneous "subtype" check is not able to tell whether higher-ranked subtyping will succeed or not. In both cases, we might be able to fix the problem by doing a 'leak-check like change' at some later point (e.g., as part of coherence).

This is a draft PR because:

* I didn't finish ripping out the leak-check completely.
* We might want to consider a crater run before landing this.
* We might want some kind of design meeting to cover the overall strategy.
* I just remembered I never finished 100% integrating this into the canonicalization code.
* I should also review what happens in NLL region checking -- it probably still has a notion of bottom (empty set).

r? @matthewjasper
2020-02-07 23:08:52 +00:00
bors
a29424a226 Auto merge of #68933 - Dylan-DPC:rollup-akz13kj, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #68164 (Selectively disable sanitizer instrumentation)
 - #68413 (Add GitHub issue templates)
 - #68889 (Move the `hir().krate()` method to a query and remove the `Krate` dep node)
 - #68909 (Respect --nocapture in panic=abort test mode)
 - #68910 (Add myself to .mailmap)
 - #68919 (Remove HashStable impl for ast::Lifetime)
 - #68928 (clean up E0276 explanation)

Failed merges:

r? @ghost
2020-02-07 17:47:11 +00:00
Josh White
8b77f8688e performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
Dylan DPC
9681544f38
Rollup merge of #68928 - GuillaumeGomez:cleanup-e0276, r=Dylan-DPC
clean up E0276 explanation

r? @Dylan-DPC
2020-02-07 17:00:27 +01:00
Dylan DPC
88573a7f61
Rollup merge of #68919 - Zoxc:ast-lifetime, r=nikomatsakis
Remove HashStable impl for ast::Lifetime
2020-02-07 17:00:25 +01:00
Dylan DPC
9047c57e9f
Rollup merge of #68910 - hanna-kruppe:master, r=Mark-Simulacrum
Add myself to .mailmap
2020-02-07 17:00:23 +01:00
Dylan DPC
f734e47516
Rollup merge of #68909 - tmandry:panic-abort-nocapture, r=alexcrichton
Respect --nocapture in panic=abort test mode

r? @alexcrichton
2020-02-07 17:00:21 +01:00
Dylan DPC
90f6267dea
Rollup merge of #68889 - Zoxc:hir-krate, r=eddyb
Move the `hir().krate()` method to a query and remove the `Krate` dep node

r? @eddyb cc @michaelwoerister
2020-02-07 17:00:19 +01:00
Dylan DPC
f9ebad33a2
Rollup merge of #68413 - XAMPPRocky:master, r=Mark-Simulacrum
Add GitHub issue templates

This PR adds GitHub's issue templates to the repository. Adding templates for two of the most common issues we create on the repository. We could add more specific templates (e.g. ICEs) depending on the response to initial templates. I've included a screenshot of what it looks like, and people can also try out the UI and specific templates, by going to [`XAMPPRocky/rust`](https://github.com/XAMPPRocky/rust/issues/new/choose).

<img width="1115" alt="Screenshot 2020-01-21 at 13 57 46" src="https://user-images.githubusercontent.com/4464295/72807027-c51baa00-3c56-11ea-8a4c-98238489b345.png">
2020-02-07 17:00:18 +01:00
Dylan DPC
2f1eaeea77
Rollup merge of #68164 - tmiasko:no-sanitize, r=nikomatsakis
Selectively disable sanitizer instrumentation

Add `no_sanitize` attribute that allows to opt out from sanitizer
instrumentation in an annotated function.
2020-02-07 17:00:16 +01:00
Mikhail Babenko
bf82582d6f add hir printing 2020-02-07 18:27:12 +03:00
Mikhail Babenko
ab6ea2bba7 add regression test 2020-02-07 18:18:07 +03:00
Mikhail Babenko
73936ab57a print generic bounds on associated types 2020-02-07 18:18:07 +03:00
bors
fb29dfcc9a Auto merge of #68930 - RalfJung:miri, r=RalfJung
update miri

Cc @oli-obk r? @ghost

Fixes https://github.com/rust-lang/rust/issues/68878
2020-02-07 14:41:17 +00:00
Ralf Jung
4eeaa92366 update miri 2020-02-07 15:04:44 +01:00
bjorn3
5827d78f18 Fix test 2020-02-07 14:00:08 +01:00
bjorn3
e38665676b Rustfmt 2020-02-07 13:59:31 +01:00
bjorn3
91d01e7c6b Remove unused feature gates from libsyntax_pos 2020-02-07 13:59:31 +01:00
bjorn3
9d6bdccd9e Remove unused feature gate from libserialize 2020-02-07 13:59:31 +01:00
bjorn3
b7599990d4 Remove unused feature gates from librustdoc 2020-02-07 13:59:23 +01:00
bjorn3
8f672cd7dd Remove unused feature gates from librustc_typeck 2020-02-07 13:58:57 +01:00
bjorn3
1a26c1c67a Remove unused feature gate from librustc_target 2020-02-07 13:58:57 +01:00
bjorn3
1bfba4fbce Remove unused feature gate from librustc_resolve 2020-02-07 13:58:57 +01:00
bjorn3
341594e196 Remove unused feature gates from librustc_mir 2020-02-07 13:58:57 +01:00
bjorn3
6305c683cb Remove unused feature gates from librustc_metadata 2020-02-07 13:58:57 +01:00
bjorn3
74994af266 Remove unused feature gate from librustc_lint 2020-02-07 13:58:57 +01:00
bjorn3
6638b86702 Remove unused feature gates from librustc_interface 2020-02-07 13:58:57 +01:00
bjorn3
d252791a93 Remove unused feature gate from librustc_incremental 2020-02-07 13:58:50 +01:00
Guillaume Gomez
26020f5063 clean up E0276 explanation 2020-02-07 13:23:33 +01:00
John Kåre Alsaker
44edbc0e90 Remove HashStable impl for ast::Lifetime 2020-02-07 08:07:06 +01:00
bors
b5e21dbb5c Auto merge of #68499 - ssomers:btree_search_tidying, r=Mark-Simulacrum
BtreeMap range_search spruced up

#39457 created a lower level entry point for `range_search` to operate on, but it's really not hard to move it up a level of abstraction, making it somewhat shorter and reusing existing unsafe code (`new_edge` is unsafe although it is currently not tagged as such).

Benchmark added. Comparison says there's no real difference:
```
>cargo benchcmp old3.txt new3.txt --threshold 5
 name                                           old3.txt ns/iter  new3.txt ns/iter  diff ns/iter   diff %  speedup
 btree::map::find_seq_100                       19                21                           2   10.53%   x 0.90
 btree::map::range_excluded_unbounded           3,117             2,838                     -279   -8.95%   x 1.10
 btree::map::range_included_unbounded           1,768             1,871                      103    5.83%   x 0.94
 btree::set::intersection_10k_neg_vs_10k_pos    35                37                           2    5.71%   x 0.95
 btree::set::intersection_staggered_100_vs_10k  2,488             2,314                     -174   -6.99%   x 1.08
 btree::set::is_subset_10k_vs_100               3                 2                           -1  -33.33%   x 1.50
```

r? @Mark-Simulacrum
2020-02-07 06:24:55 +00:00
Brian Anderson
8251e12950 Don't use the word 'unwrap' to describe core unwrapping functions
It's tautological, and Rust-specific Jargon.

This changes various Option/Result methods to consistently describe unwrapping
behavior using the words "return", "contain", "consume".

It also renames the closure argument of `Return::unwrap_or_else` to `default` to
be consistent with `Option`.
2020-02-07 14:08:24 +08:00
Stein Somers
ae03e16d08 Lift range_search up one level of abstraction 2020-02-07 02:41:28 +01:00
bors
f8fd462447 Auto merge of #68907 - Dylan-DPC:rollup-osm5e8o, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #67359 (Rename -Zexternal-macro-backtrace to -Zmacro-backtrace and clean up implementation.)
 - #68524 (Generator Resume Arguments)
 - #68791 (implement proper linkchecker hardening)
 - #68886 (Mark fn map_or() as eagerly evaluated.)
 - #68888 (error code examples: replace some more ignore with compile_fail)
 - #68894 (Update E0565 examples)

Failed merges:

r? @ghost
2020-02-07 00:06:35 +00:00
Stein Somers
be051adb57 Create benchmarks for BTreeMap::range 2020-02-07 00:57:54 +01:00
Hanna Kruppe
c39f2092f7 Add myself to .mailmap 2020-02-06 23:45:20 +01:00
Tyler Mandry
861b328f7d Respect --nocapture in panic=abort test mode 2020-02-06 14:43:53 -08:00
Josh White
78df44655a Tidied up the long error description 2020-02-06 17:28:03 -05:00