Commit Graph

7844 Commits

Author SHA1 Message Date
Niko Matsakis
afba69461a move def-id to rustc crate 2015-08-24 05:34:58 -04:00
bors
54b2eced63 Auto merge of #27927 - DiamondLovesYou:no-asm, r=alexcrichton 2015-08-23 07:50:06 +00:00
bors
4a1fda807e Auto merge of #27565 - TimNN:dead-visit-type-in-path, r=nrc
Fixes #23808, passes `make check-stage1` `run-pass` and `run-fail` locally.
2015-08-22 17:56:26 +00:00
Richard Diamond
8b70e1e008 Add a allow_asm option so virtual ISA based targets (JS/PNaCl/WAsm) can disallow the asm! macro. 2015-08-21 17:50:39 -05:00
Niko Matsakis
81eab1cab6 completely aborted comment 2015-08-21 15:34:10 -04:00
Niko Matsakis
1630c7912f rename best_upper_bound to postdom_upper_bound 2015-08-21 14:44:52 -04:00
Niko Matsakis
b247402666 nits from pnkfelix 2015-08-21 14:40:07 -04:00
Niko Matsakis
10b8941bce fix accidental reversal of 'static, and add a test 2015-08-21 11:44:20 -04:00
Niko Matsakis
dcf6f08138 kill the old funky can_reach fn 2015-08-18 17:41:46 -04:00
Niko Matsakis
4b1d3b7036 rewrite free_region/region_inference to use newly minted
`TransitiveRelation`
2015-08-18 17:41:20 -04:00
bors
16cacbe258 Auto merge of #27866 - arielb1:really-fast-reject, r=nikomatsakis
also, use the right caching logic for type_moves_by_default (this was
broken by @jroesch).

```
before:
593.10user 5.21system 7:51.41elapsed 126%CPU (0avgtext+0avgdata 1150016maxresident)k

after:
567.03user 4.00system 7:28.23elapsed 127%CPU (0avgtext+0avgdata 1133112maxresident)k
```

A nice 4.5% improvement. For reference, on the last run LLVM takes 429.267s, which is 75% - hopefully this can be reduced.

I think the regression since #27751 is because of the wf patch - need to investigate it through.

r? @nikomatsakis
2015-08-18 07:16:10 +00:00
Huon Wilson
717da9513f Create "platform-intrinsic" ABI for SIMD/platform intrinsics.
This is purposely separate to the "rust-intrinsic" ABI, because these
intrinsics are theoretically going to become stable, and should be fine
to be independent of the compiler/language internals since they're
intimately to the platform.
2015-08-17 14:41:38 -07:00
Ariel Ben-Yehuda
13809ffff7 don't iterate over all impls when none match
before:
573.01user 4.04system 7:33.86elapsed 127%CPU (0avgtext+0avgdata 1141656maxresident)k
after:
567.03user 4.00system 7:28.23elapsed 127%CPU (0avgtext+0avgdata 1133112maxresident)k

an additional 1% improvement
2015-08-18 00:25:29 +03:00
Ariel Ben-Yehuda
8aeaaac654 add a fast-path to resolve_type_vars_if_possible
this avoids needless substituting

before:
577.76user 4.27system 7:36.13elapsed 127%CPU (0avgtext+0avgdata 1141608maxresident)k

after:
573.01user 4.04system 7:33.86elapsed 127%CPU (0avgtext+0avgdata 1141656maxresident)k
2015-08-18 00:24:16 +03:00
Ariel Ben-Yehuda
96e6b2fef8 use an FnvHashSet instead of an HashSet in fulfill
this doesn't cause a measurable perf increase, but it makes callgrind output
cleaner. Anyway, rustc should be using FNV everywhere.
2015-08-17 21:53:46 +03:00
Ariel Ben-Yehuda
9b75a2bcd1 make trait matching smarter with projections
also, use the right caching logic for type_moves_by_default (this was
broken by @jroesch).

before:
593.10user 5.21system 7:51.41elapsed 126%CPU (0avgtext+0avgdata 1150016maxresident)k
llvm: 427.045

after:
577.76user 4.27system 7:36.13elapsed 127%CPU (0avgtext+0avgdata 1141608maxresident)k
llvm: 431.001
2015-08-17 21:53:44 +03:00
Huon Wilson
c8b6d5b23c Implement repr(simd) as an alias for #[simd]. 2015-08-17 10:57:18 -07:00
bors
a49d9bab1e Auto merge of #27643 - mitaa:get_item_, r=arielb1
(this incidentally fixes an error message where the paths separator is " " instead of "::")
2015-08-16 12:14:29 +00:00
bors
9165a4e2dc Auto merge of #27818 - alexcrichton:tag-all-the-issues, r=aturon
This commit turns `#[unstable]` attributes missing an `issue` annotation into a hard error. This will require the libs team to ensure that there's a tracking issue for all unstable features in the standard library.

All existing unstable features have had issues created and they've all been updated. Yay!

Closes #26868
2015-08-16 05:10:23 +00:00
bors
fc7efab3ab Auto merge of #27851 - nikomatsakis:cleanup-ty-decoder, r=eddyb
Just a little code cleanup I was doing as part of another refactoring (which may turn out not to be needed). The main thrust of this is to cleanup the interface to `tydecode.rs` to be less ridiculously repetitive. I also purged the generic "def-id conversion" parameter in favor of a trait object, just to reduce code duplication a bit and make the signatures a bit less messy. I measured the bootstrapping time to build stage2 with these changes, it was identical. (But it'd be easy enough to restore the unboxed closure if we wanted it.)
2015-08-16 02:25:36 +00:00
Niko Matsakis
7a3a1be5e4 remove the last remnants of old interface 2015-08-15 21:35:49 -04:00
Alex Crichton
2972b77134 Add issue for the rustc_private feature everywhere 2015-08-15 18:09:17 -07:00
Niko Matsakis
b09cf1293a astencode: convert code to use TyDecoder directly 2015-08-15 05:01:47 -04:00
Niko Matsakis
38e6b5780e s/PState/TyDecoder/ 2015-08-15 05:01:47 -04:00
Niko Matsakis
70e2df5b1b tydecode: tighten privacy 2015-08-15 05:01:47 -04:00
Niko Matsakis
2a53744aaa convert tydecode to use an impl, eliminating a lot of boilerplate 2015-08-15 05:01:47 -04:00
Niko Matsakis
c9bb5a68f8 convert tydecode to use a closure for def-id conversion and
to store the closure in the PSState struct
2015-08-14 20:16:31 -04:00
Niko Matsakis
8a6118b748 move InlinedItem into librustc, where it belongs 2015-08-14 20:07:55 -04:00
Alex Crichton
45bf1ed1a1 rustc: Allow changing the default allocator
This commit is an implementation of [RFC 1183][rfc] which allows swapping out
the default allocator on nightly Rust. No new stable surface area should be
added as a part of this commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1183

Two new attributes have been added to the compiler:

* `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to
  indicate that it requires an allocator crate to be in scope.
* `#![allocator]` - this is a indicator that the crate is an allocator which can
  satisfy the `needs_allocator` attribute above.

The ABI of the allocator crate is defined to be a set of symbols that implement
the standard Rust allocation/deallocation functions. The symbols are not
currently checked for exhaustiveness or typechecked. There are also a number of
restrictions on these crates:

* An allocator crate cannot transitively depend on a crate that is flagged as
  needing an allocator (e.g. allocator crates can't depend on liballoc).
* There can only be one explicitly linked allocator in a final image.
* If no allocator is explicitly requested one will be injected on behalf of the
  compiler. Binaries and Rust dylibs will use jemalloc by default where
  available and staticlibs/other dylibs will use the system allocator by
  default.

Two allocators are provided by the distribution by default, `alloc_system` and
`alloc_jemalloc` which operate as advertised.

Closes #27389
2015-08-14 15:13:10 -07:00
bors
e7261f3ab6 Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc
This PR implements the majority of RFC 1214. In particular, it implements:

- the new outlives relation
- comprehensive WF checking

For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. 

There are some deviations from RFC 1214. Most notably:

- we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing).
- object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent.

Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests.

r? @nrc (or perhaps someone else?)
2015-08-14 15:26:09 +00:00
Niko Matsakis
7f8942c18d Correct nits from @nrc 2015-08-14 09:26:19 -04:00
Niko Matsakis
33200a369a expr_use_visitor: Remove FIXME that is no longer needed (and in fact
causes errors, post rebase). Issue #27592 is still alive and well,
whatever it is.
2015-08-12 20:59:01 -04:00
Niko Matsakis
ad700abea4 ty.rs: document/cleanup required_region_bounds a bit 2015-08-12 17:58:58 -04:00
Niko Matsakis
213326cddd outlives.rs: correct typo 2015-08-12 17:58:58 -04:00
Niko Matsakis
c106dd449c traits/error_reporting.rs: always note obligation cause 2015-08-12 17:58:58 -04:00
Niko Matsakis
a7c9a15e0e outlives.rs: remove use of ty.walk and replace with recursive of
ty.walk_shallow, add add'l comments.
2015-08-12 17:58:58 -04:00
Niko Matsakis
a264440ab0 outlives: convert outlives to use an exhaustive match, for better
reliability.
2015-08-12 17:58:57 -04:00
Niko Matsakis
9c5cfea43d traits: consider whether origin is RFC1214 when caching, ensuring
that the test rfc1214-warn-and-error.rs reports an error
2015-08-12 17:58:57 -04:00
Niko Matsakis
9c3a8664b6 middle/outlives.rs: s/temp/subcomponents/ 2015-08-12 17:58:57 -04:00
Niko Matsakis
0582fed63f middle/outlives.rs: fix typo 2015-08-12 17:58:57 -04:00
Niko Matsakis
b7e849bf6a infer/mod.rs: add doc comment to RFC1214 variant 2015-08-12 17:58:57 -04:00
Niko Matsakis
d15d743fa8 Add FIXME for apparent stage0 regression 2015-08-12 17:58:56 -04:00
Niko Matsakis
91b3e9cac0 Fallout in libs -- misc missing bounds uncovered by WF checks. 2015-08-12 17:58:56 -04:00
Niko Matsakis
d159977502 Generalize the outlives rule for projections to handle the new cases;
also, generalize VerifyBounds to include OR conditions.
2015-08-12 17:58:22 -04:00
Niko Matsakis
75ee8f1562 Introduce a "origin/cause" for new requirements (or bugfixes...) introduced by RFC 1214,
and issue a warning (and explanatory note) when we encounter such a
thing.
2015-08-12 17:58:22 -04:00
Niko Matsakis
ad47bd8a0f Extend ParameterEnvironment to remember the free_id, and to be usable
on more kind of items
2015-08-12 17:57:57 -04:00
Niko Matsakis
b1963154a1 Add two new kinds of predicates, WellFormed and ObjectSafe. 2015-08-12 17:57:57 -04:00
Niko Matsakis
928955296e Define the wf and outlives relation separately, unlike the existing
`implicator`. These definitions are also in accordance with RFC 1214 (or
more so), and hence somewhat different from the implicator. This commit
also modifies the implicator to remove the older rules for projections,
which can easily trigger infinite loops.
2015-08-12 17:57:57 -04:00
Alex Crichton
8d90d3f368 Remove all unstable deprecated functionality
This commit removes all unstable and deprecated functions in the standard
library. A release was recently cut (1.3) which makes this a good time for some
spring cleaning of the deprecated functions.
2015-08-12 14:55:17 -07:00
mitaa
d81feb85f7 Remove duplicated path_to_string conversion 2015-08-12 20:22:52 +02:00