Commit Graph

35985 Commits

Author SHA1 Message Date
Alex Crichton
fa130ae6ff rollup merge of #20330: fhahn/issue-15877-model-lexer-range-2
This patch resolves the second problem mentioned in #15877: function calls to integers, e.g. `3.b()`.

 It does so, by checking whether the character following the first dot of a FLOAT_LIT is a character or an underscore (these should denote a valid identifier). This does not look like a particularly, but it seems like a lookahead of 1 is needed for this distinction.

Another interesting aspect are ranges that start with a integer constant, but end with a function call, e.g. `1..b()`. Rust treats this as a range from 1 to `b()`, but given that `1.` is a valid FLOAT_LIT, `1..b()` could be a function call to a float as well.

cc @cmr
2014-12-30 16:26:18 -08:00
Alex Crichton
ecf48fb469 rollup merge of #20329: vhbit/ios-rand-fix 2014-12-30 16:26:16 -08:00
Alex Crichton
a8820f7a2d rollup merge of #20328: huonw/attack-of-the-clones
It's useful to be able to save state.
2014-12-30 16:26:15 -08:00
Alex Crichton
899eb65b29 rollup merge of #20326: rohitjoshi/master
fixes #20322
2014-12-30 16:26:13 -08:00
Alex Crichton
d058520f06 rollup merge of #20325: nick29581/obj-safety-static
Closes #19949 and rust-lang/rfcs#428

[breaking change]

If you have traits used with objects with static methods, you'll need to move
the static methods to a different trait.

r? @cmr
2014-12-30 16:26:11 -08:00
Alex Crichton
a239d71729 rollup merge of #20323: brson/beta
Adds a new 'beta cycle' variable that can be appended to the '-beta' version label, e.g. '-beta1'. Changes the version label for the beta channel temporarily to 'alpha'. Changes the artifact name of the beta channel to contain the version number instead of just being called 'beta'. The beta cycle number is currently set to 1.

The impact of this is that the first alphas will be called '1.0.0-alpha1' and the artifacts will also be called '1.0.0-alpha1-*.tar.gz'. We could alternately leave out the cycle number if we are confident there will be only one alpha cycle.

r? @alexcrichton cc @nikomatsakis @huonw
2014-12-30 16:26:09 -08:00
Alex Crichton
d1a19e8303 rollup merge of #20321: epall/patch-1
In f436f9ca2, the Send and Sync traits became `unsafe`. They were updated for `target_arch = x86` and others, but `mips` was missed.
2014-12-30 16:26:08 -08:00
Alex Crichton
360c3cf558 rollup merge of #20316: seanmonstar/patch-1
Adds back Send and Sync to BTreeMap and Set.
2014-12-30 16:26:06 -08:00
Alex Crichton
b936fb3d16 rollup merge of #20286: murarth/get-address-name 2014-12-30 16:26:02 -08:00
Alex Crichton
2dd519230f rollup merge of #20247: steveklabnik/gh20088
Fixes #20088
2014-12-30 16:26:00 -08:00
Alex Crichton
520cdcb79a rollup merge of #20217: luqmana/pc 2014-12-30 16:25:58 -08:00
Alex Crichton
0362b40e44 rollup merge of #20115: gereeter/split-module-building
This also gets rid of a bunch of unnecessary `.clone`s.

cc @eddyb
2014-12-30 16:25:48 -08:00
Alex Crichton
836bcb6ef4 rollup merge of #20065: aturon/stab-2-cmp
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439).

In the future, many of the impls should be generalized; see #20063.
However, there is no problem stabilizing the less general impls, since
generalizing later is not a breaking change.

r? @alexcrichton
2014-12-30 16:25:47 -08:00
Alex Crichton
3c5fd402cf rollup merge of #20045: alexcrichton/issue-20012
The new semantics of this function are that the callbacks are run when the *main
thread* exits, not when all threads have exited. This implies that other threads
may still be running when the `at_exit` callbacks are invoked and users need to
be prepared for this situation.

Users in the standard library have been audited in accordance to these new rules
as well.

Closes #20012
2014-12-30 16:25:45 -08:00
Alex Crichton
fe64ff1104 rollup merge of #19954: michaelwoerister/rust-gdb
This pull request adds the `rust-gdb` shell script which starts GDB with Rust pretty printers enabled. The PR also makes `rustc` add a special `.debug_gdb_scripts` ELF section on Linux which tells GDB that the produced binary should use the Rust pretty printers.

Note that at the moment this script will only work and be installed on Linux. On Mac OS X there's `rust-lldb` which works much better there. On Windows I had too many problems making this stable. I'll give it another try soonish.

You can use this script just like you would use GDB from the command line. It will use the pretty printers from the Rust "installation" found first in PATH. E.g. if you have `~/rust/x86_64-linux-gnu/stage1/bin` in your path, it will use the pretty printer scripts in `~/rust/x86_64-linux-gnu/stage1/lib/rustlib/etc`.
2014-12-30 16:25:44 -08:00
Aaron Turon
b94bcbf56e Stabilize cmp
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform
RFC](https://github.com/rust-lang/rfcs/pull/439).

Along the way, two changes are made:

* The recently-added type parameters for `Ord` and `Eq` are
  removed. These were mistakenly added while adding them to `PartialOrd`
  and `PartialEq`, but they don't make sense given the laws that are
  required for (and use cases for) `Ord` and `Eq`.

* More explicit laws are added for `PartialEq` and `PartialOrd`,
  connecting them to their associated mathematical concepts.

In the future, many of the impls should be generalized; see
since generalizing later is not a breaking change.

[breaking-change]
2014-12-30 14:44:26 -08:00
Alex Crichton
9e224c2bf1 std: Re-enable at_exit()
The new semantics of this function are that the callbacks are run when the *main
thread* exits, not when all threads have exited. This implies that other threads
may still be running when the `at_exit` callbacks are invoked and users need to
be prepared for this situation.

Users in the standard library have been audited in accordance to these new rules
as well.

Closes #20012
2014-12-30 14:33:59 -08:00
Jonathan S
c7a8240f02 Removed a bunch of unnecessary .clone()s from build_reduced_graph 2014-12-30 12:52:51 -06:00
Jonathan S
096df4e134 Purged ReducedGraphParent 2014-12-30 12:30:42 -06:00
Jonathan S
28659cf804 Cleanup unused imports resulting from move of reduced graph building 2014-12-30 12:19:24 -06:00
Brian Anderson
20fcece88b mk: The alpha will not have a cycle number 2014-12-30 10:18:54 -08:00
Jonathan S
be00b9dc40 Moved ReducedGraphParent building to a new module 2014-12-30 12:16:42 -06:00
bors
84f5ad8679 auto merge of #20307 : nikomatsakis/rust/assoc-types-normalization-extend-bound, r=nrc
Rewrite associated types to use projection rather than dummy type parameters. This closes almost every (major) open issue, but I'm holding off on that until the code has landed and baked a bit. Probably it should have more tests, as well, but I wanted to get this landed as fast as possible so that we can collaborate on improving it.

The commit history is a little messy, particularly the merge commit at the end. If I get some time, I might just "reset" to the beginning and try to carve up the final state into logical pieces. Let me know if it seems hard to follow. By far the most crucial commit is "Implement associated type projection and normalization."

r? @nick29581
2014-12-30 17:51:21 +00:00
Niko Matsakis
e186accbc4 Fix rebase conflicts 2014-12-30 12:09:21 -05:00
Michael Woerister
91a0e18866 debuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers enabled. 2014-12-30 17:26:13 +01:00
Florian Hahn
1e278c1cd1 Update src/grammar/README.md 2014-12-30 16:49:27 +01:00
Florian Hahn
f066acf645 src/grammar/check.sh now prints test summary 2014-12-30 16:46:07 +01:00
Niko Matsakis
919975d0a5 Address nits. 2014-12-30 09:36:23 -05:00
Niko Matsakis
518ec1259a Normalize associated types in bounds too. Also, make the workaround
for lack of impl-trait-for-trait just a bit more targeted (don't
substitute err, just drop the troublesome bound for now) -- otherwise
substituting false types leads us into trouble when we normalize etc.
2014-12-30 09:36:23 -05:00
Niko Matsakis
cdd5ff842d Add a test case using associated types cross crate. Fixes #18048. 2014-12-30 09:36:23 -05:00
Niko Matsakis
208d32d192 Encode the TypeScheme for associated types 2014-12-30 09:36:23 -05:00
Niko Matsakis
de8e0ae22c Remove the AssocSpace 2014-12-30 09:36:23 -05:00
Niko Matsakis
42e645ca9a Patch more metadata decoding problems. 2014-12-30 09:36:23 -05:00
Niko Matsakis
30e8ab0182 Encode the name for associated items on a trait. Fixes #18048. 2014-12-30 09:36:23 -05:00
Niko Matsakis
c1bc150bc4 Correct licenses. 2014-12-30 09:36:23 -05:00
Niko Matsakis
7ed0e23209 Resolve merge conflicts. This changes should really be integrated back to their respective
commits but oh dear what a pain.
2014-12-30 09:36:23 -05:00
Niko Matsakis
05eb2eeb61 Adjust tests for inferenceGet more conservative about inference for now. Seems better to err on the side of being more correct rather than less. Fix a bug in typing index expressions that was exposed as a result, and add one type annotation that is not required. Delete some random tests that were relying on old behavior and don't seem to add anything anymore. 2014-12-30 09:36:23 -05:00
Niko Matsakis
c197911c60 Add a FIXME relating to these type-testing traits 2014-12-30 09:36:23 -05:00
Niko Matsakis
f1c041a54d Patch long line. 2014-12-30 09:36:23 -05:00
Niko Matsakis
00cf176a5e Add FIXMEs relating to caching of projection results 2014-12-30 09:36:22 -05:00
Niko Matsakis
97d8a668f6 Add a FIXME relating to regions and projection types 2014-12-30 09:36:22 -05:00
Niko Matsakis
d62d4953d2 Add a FIXME to patch up rustdoc 2014-12-30 09:36:22 -05:00
Niko Matsakis
58467fab0f File a FIXME relating to using where clauses, not bounds 2014-12-30 09:36:22 -05:00
Niko Matsakis
df967306e3 Add a FIXME relating to Copy<T> not being checked 2014-12-30 09:36:22 -05:00
Niko Matsakis
adca15a151 Add a FIXME relating to using ast::Name 2014-12-30 09:36:22 -05:00
Niko Matsakis
7836c72eba Patch tests and create new tests related to projection from a HRTB. 2014-12-30 09:36:22 -05:00
Niko Matsakis
3657ae13f5 Don't normalize associated types when in region binders, wait until we instantiate
them. Also fix some assertions and handling of builtin bounds.
2014-12-30 09:36:22 -05:00
Niko Matsakis
2bbd2f9cea Remove the def-id from type parameters. Having this def-id was bad for several reasons:
1. Produced more unique types than is necessary. This increases memory consumption.
2. Linking the type parameter to its definition *seems* like a good idea, but it
   encourages reliance on the bounds listing.
3. It made pretty-printing harder and in particular was causing bad error messages
   when errors occurred before the `TypeParameterDef` entries were fully stored.
2014-12-30 09:36:22 -05:00
Niko Matsakis
964a5fabb7 Update error messages in various compile-fail tests 2014-12-30 09:36:22 -05:00
Niko Matsakis
b7c6e317b0 Make projected types select out of the trait bounds. 2014-12-30 09:36:22 -05:00