Commit Graph

106645 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
d6ccbf6ff8 rustc_codegen_llvm: remove unnecessary special-casing of root scopes' children. 2020-02-08 17:58:00 +02:00
Guillaume Gomez
1177d0669a Clean up E0277 and E0282 explanations 2020-02-08 15:47:29 +01:00
Jonas Schievink
58a9284bff Add missing import 2020-02-08 14:44:32 +01:00
Jonas Schievink
e0cb1ae24a Make provided_trait_methods use impl Iterator 2020-02-08 14:37:40 +01:00
Jonas Schievink
52f77110d4 Add a fast path to inherent impl overlap check
Quickly skip impls that do not define any items with the same name
2020-02-08 14:37:40 +01:00
Jonas Schievink
f4165731ad Use associated_items query in impl overlap check
This reduces the number of `associated_item` queries done here.
2020-02-08 14:37:03 +01:00
Jonas Schievink
66fd4e6ed8 Make associated_items query return a slice 2020-02-08 14:29:18 +01:00
Josh White
a804d476a6 Corrected E0637.md based on test failure 2020-02-08 08:14:28 -05:00
Chris Simpkins
77d158d401 shorten comment blocks to < 100 characters 2020-02-08 08:13:01 -05:00
bors
85ffd44d3d Auto merge of #68443 - eddyb:abi-compat-enum, r=nagisa
rustc_target: treat enum variants like union members, in call ABIs.

Fixes #68190, by handling non-C-like `enum`s as-if they were an `union` of `struct`s, in call ABIs.
Tests were provided by @sw17ch, from theirs and @bitwalker's original examples.

cc @nagisa @rkruppe
2020-02-08 13:02:21 +00:00
Eduard-Mihai Burtescu
d20e4aa8e3 test: use all: $(call NATIVE_STATICLIB,test) to build a C lib. 2020-02-08 13:40:50 +02:00
Josh White
58d0e67f50 Added compiler flags to example code, removed unexpected curly 2020-02-08 06:18:42 -05:00
Chris Simpkins
9b10fc4205 remove unnecessary import statement, PEP8 format spacing 2020-02-08 00:38:20 -05:00
Chris Simpkins
814aa0667b PEP8 format spacing 2020-02-08 00:31:12 -05:00
Josh White
409146673c Removed trailing white spaces 2020-02-08 00:22:15 -05:00
Chris Simpkins
85e3661214 PEP8 format spacing, remove unnecessary local variable assignment 2020-02-08 00:12:25 -05:00
Chris Simpkins
8d04b95188 remove unnecessary import statement 2020-02-08 00:03:51 -05:00
Chris Simpkins
a53f45fe90 PEP8 format spacing, split import statements 2020-02-08 00:02:11 -05:00
Chris Simpkins
d36634315a PEP8 format spacing 2020-02-08 00:01:32 -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
Chris Simpkins
f38e2701d8 remove unnecessary sys import 2020-02-07 23:49:40 -05:00
Chris Simpkins
e30dd86c61 PEP8 format spacing 2020-02-07 23:47:29 -05:00
Josh White
92fc98c695 Cleaned up long error description 2020-02-07 23:40:16 -05:00
Chris Simpkins
60889d418e remove unnecessary semicolons 2020-02-07 23:35:27 -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
Chris Simpkins
adde3d443d PEP8 format spacing 2020-02-07 22:30:11 -05:00
Chris Simpkins
6ce8d2b000 PEP8 format spacing 2020-02-07 22:09:55 -05:00
Chris Simpkins
19aaf63945 PEP8 format spacing 2020-02-07 22:04:44 -05:00
Chris Simpkins
3998249ae7 remove unnecessary local variable assignment in context manager 2020-02-07 22:00:25 -05: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