Commit Graph

32771 Commits

Author SHA1 Message Date
Niko Matsakis 537139ee00 Convert the TODO into a FIXME. 2015-01-04 12:01:19 -05:00
Niko Matsakis 71cdf76240 Fix ICE in WF checker when we encounter bound regions in object types. 2015-01-04 12:01:19 -05:00
Eduard Burtescu 9a90d436f6 rustc: allow paths in constants to refer to polymorphic items. 2015-01-04 18:47:58 +02:00
bors 260e46115b auto merge of #20443 : nikomatsakis/rust/autoderef-overloaded-calls, r=pcwalton
Use autoderef for call notation. This is consistent in that we now autoderef all postfix operators (`.`, `[]`, and `()`). It also means you can call closures without writing `(*f)()`. Note that this is rebased atop the rollup, so only the final commit is relevant.

r? @pcwalton
2015-01-04 16:36:41 +00:00
Eduard Burtescu a0c07dabd1 rustc: check_const: avoid recursing into a block's tail expression twice. 2015-01-04 17:59:00 +02:00
Eduard Burtescu eb0b76a603 rustc: check_const: cleanup/simplify the code. 2015-01-04 17:58:56 +02:00
Eduard Burtescu b5df03285e rustc: check_const: remove ~str support in patterns. 2015-01-04 17:55:01 +02:00
Nick Howell 36bed41c1f doc: Add missing `$`s in the Installing Rust guide 2015-01-04 10:23:00 -05:00
Robin Gloster 5cc17382d1 fix range sugar 2015-01-04 12:13:21 +01:00
bors 856b90c400 auto merge of #20393 : japaric/rust/impl-any, r=aturon
Needs a snapshot that contains PR #20385

r? @aturon
2015-01-04 11:01:04 +00:00
Tshepang Lekhonkhobe f863e82b32 bench: remove warnings from rt-messaging-ping-pong.rs 2015-01-04 11:45:22 +02:00
Alex Crichton 7d8d06f86b Remove deprecated functionality
This removes a large array of deprecated functionality, regardless of how
recently it was deprecated. The purpose of this commit is to clean out the
standard libraries and compiler for the upcoming alpha release.

Some notable compiler changes were to enable warnings for all now-deprecated
command line arguments (previously the deprecated versions were silently
accepted) as well as removing deriving(Zero) entirely (the trait was removed).

The distribution no longer contains the libtime or libregex_macros crates. Both
of these have been deprecated for some time and are available externally.
2015-01-03 23:43:57 -08:00
Brendan Zabarauskas afdddefc10 Allow rustdoc to accept vector pattern arguments 2015-01-04 17:52:08 +11:00
Tshepang Lekhonkhobe d5d6de99b1 doc: remove incomplete sentence 2015-01-04 08:44:31 +02:00
Earl St Sauver 21617ad620 Update guide index to point to the task page
When the "threads" guides were renamed to be "tasks" guides, it looks
like this link was missed.

Here's the other relevant commit.
2015-01-03 20:16:04 -08:00
Jorge Aparicio 5172b8046a remove `Any[Mut]RefExt` traits in favor of `impl Any` 2015-01-03 23:01:33 -05:00
Jorge Aparicio 351409a622 sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs 2015-01-03 22:54:18 -05:00
Jorge Aparicio 8c5bb80d9b sed -i -s 's/\bmod}/self}/g' **/*.rs 2015-01-03 22:42:37 -05:00
Jorge Aparicio 56dcbd17fd sed -i -s 's/\bmod,/self,/g' **/*.rs 2015-01-03 22:42:21 -05:00
bors c6c786671d auto merge of #20490 : japaric/rust/assoc-types, r=aturon
closes #20486 
closes #20474 
closes #20441

[breaking-change]

The `Index[Mut]` traits now have one less input parameter, as the return type of the indexing operation is an associated type. This breaks all existing implementations.

---

binop traits (`Add`, `Sub`, etc) now have an associated type for their return type. Also, the RHS input parameter now defaults to `Self` (except for the `Shl` and `Shr` traits). For example, the `Add` trait now looks like this:

``` rust
trait Add<Rhs=Self> {
    type Output;

    fn add(self, Rhs) -> Self::Output;
}
```

The `Neg` and `Not` traits now also have an associated type for their return type.

This breaks all existing implementations of these traits.

---
Affected traits:

- `Iterator { type Item }`
- `IteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods
- `DoubleEndedIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods
- `DoubleEndedIteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods
- `RandomAccessIterator` no input/output types
- `ExactSizeIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods

This breaks all the implementations of these traits.
2015-01-04 00:50:59 +00:00
Brian Anderson e8078c3fed Update guide for Cargo installation 2015-01-03 16:04:04 -08:00
Brian Anderson ebdf331133 Download from the combined installer 2015-01-03 15:54:37 -08:00
Jorge Aparicio ce8f748b4c add feature gate to some benchmarks 2015-01-03 17:29:27 -05:00
Tobias Bucher 5de78040a2 Make all integers in the guide `i32`, implicitely
The guide still needs to talk about integer suffixes.
2015-01-03 23:19:14 +01:00
Jorge Aparicio 9aadbadb93 fix rpass/cfail tests 2015-01-03 16:30:49 -05:00
Jorge Aparicio 6fc92578fe serialize: fix fallout 2015-01-03 16:30:49 -05:00
Jorge Aparicio 4bfaa93978 std: fix fallout 2015-01-03 16:30:49 -05:00
Jorge Aparicio 32dd592d36 collections: fix fallout 2015-01-03 16:30:49 -05:00
Jorge Aparicio 234dc4d4dd core: use assoc types in `Index[Mut]` 2015-01-03 16:30:48 -05:00
Jorge Aparicio fc343304af typeck: Index[Mut] traits now have *one* input parameter (not two) 2015-01-03 16:30:48 -05:00
Jorge Aparicio 7d3c5f020e use assoc types in unop traits 2015-01-03 16:29:22 -05:00
Jorge Aparicio 99017f82b6 use assoc types in binop traits 2015-01-03 16:29:19 -05:00
Timon Rapp 15dedb22f6 Fix typo in documentation. 2015-01-03 22:10:53 +01:00
Brian Anderson 149833d4b4 Update rust-installer. Fixes #20479 2015-01-03 12:34:48 -08:00
bors 496dc4eae7 auto merge of #19790 : akiss77/rust/aarch64-configure, r=alexcrichton
Preparing AArch64 support, starting work at the build system.
2015-01-03 20:20:48 +00:00
Ivan Petkov eebe7360de Man page/--help dialog fix
* Running rustc with the --print option will accept "file-names" but
  not "output-file-names"
2015-01-03 11:34:01 -08:00
Brian Anderson a7a57ca92d rustup: Long lines 2015-01-03 08:29:33 -08:00
Akos Kiss 6e5fb8bd1b Initial version of AArch64 support.
Adds AArch64 knowledge to:
* configure,
* make files,
* sources,
* tests, and
* documentation.
2015-01-03 15:16:10 +00:00
Jorge Aparicio 7095dd0070 core: merge IteratorPairExt into IteratorExt 2015-01-03 09:34:05 -05:00
Jorge Aparicio 6002c13f9b Register new snapshots 2015-01-03 09:34:05 -05:00
Jorge Aparicio de1446680c core: merge DoubleEndedIteratorExt into IteratorExt 2015-01-03 09:34:05 -05:00
Jorge Aparicio 6c0ad5b564 bench: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 91eeb641cd coretest: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 4f4ae538ae fix rpass/cfail tests 2015-01-03 09:34:05 -05:00
Jorge Aparicio 3bf24d6b63 test: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio ab6b651403 regex_macros: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 9dd65dd624 rustc_driver: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 964ff83cbc rustc_trans: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 274146d650 rustc_typeck: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 62ee3f1622 rustc: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 6b19a02080 syntax: fix fallout 2015-01-03 09:34:05 -05:00
Jorge Aparicio 6bff9de8ea serialize: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio f3333d5e10 regex: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 17cf5e8104 fmt_macros: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 9d36a2d593 graphviz: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 1971a24441 std: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 6b116bedaf collections: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 8c59ec0488 unicode: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 3fdd4b366a rand: fix fallout 2015-01-03 09:34:04 -05:00
Jorge Aparicio 41df05dd0e core: use assoc types in Iterator et al 2015-01-03 09:34:04 -05:00
Niko Matsakis cbeff8b8b3 "Fallout": Slightly different errors are generated in this edge case. 2015-01-03 07:01:21 -05:00
Niko Matsakis 09a7bc55db Running EUV requires the Copy lang item, so adjust privacy tests. 2015-01-03 07:01:21 -05:00
Niko Matsakis ecd9c10e1a Move upvar checking into its own pre-pass that occurs before regionck
and which uses EUV. For now, upvar inference is not any smarter than
it ever was, but regionck is simpler because it doesn't have to do as
many things at once.
2015-01-03 07:01:21 -05:00
Niko Matsakis 7474be0660 Make `ty::ParameterEnvironment`, not `ty::ctxt`, implement `Typer` and
`UnboxedClosureTyper`. This requires adding a `tcx` field to
`ParameterEnvironment` but generally simplifies everything since we
only need to pass along an `UnboxedClosureTyper` or `Typer`.
2015-01-03 07:01:21 -05:00
Niko Matsakis 83ef3042de Modify `type_known_to_meet_builtin_bound` so that it doesn't suppress overflow,
which should always result in an error.

NB. Some of the hunks in this commit rely on a later commit which adds
`tcx` into `param_env` and modifies `ParameterEnvironment` to
implement `Typer`.
2015-01-03 07:01:21 -05:00
Niko Matsakis 429d9cce1b Be more tolerant of errors in EUV so we can run it during typeck. 2015-01-03 07:00:51 -05:00
Niko Matsakis 9c54d862b8 Stop calling `bug()` in various weird cases and instead generate `Err()`. 2015-01-03 07:00:51 -05:00
Niko Matsakis f7abf47058 Re-introduce `McResult<>` as a way of aborting mem-categorization (and
expr-use-visitor) early.  Turns out I was wrong to remove this; it
causes a lot of pain trying to run EUV etc during typeck without
ICEing on erroneous programs.
2015-01-03 07:00:51 -05:00
Andrea Canciani 28cca28e62 Improve `make_hash` function
The `make_hash` function is used to prevent hashes of non-empty
buckets to collide with `EMPTY_HASH = 0u64`. Ideally this function
also preserve the uniform distribution of hashes and is cheap to
compute.

The new implementation reduces the input hash size by one bit, simply
by setting the most significant bit. This obviously prevent output
hashes to collide with `EMPTY_HASH` and guarantees that the uniform
distribution is preserved. Moreover, the new function is simpler (no
comparisons, just an OR) and (under the same assumptions as the old
function, i.e. only the least significant bit will contribute to the
bucket index) no additional collisions are caused.
2015-01-03 10:51:37 +01:00
bors fc2ba13939 auto merge of #20456 : brson/rust/packaging2, r=alexcrichton 2015-01-03 05:35:17 +00:00
Brian Anderson d30353c1d2 Remove .pkg and .exe installers 2015-01-02 20:44:07 -08:00
Corey Farwell f031285c3a Remove graphviz::LabelText::* public reexport
Part of #19253

[breaking-change]
2015-01-02 19:35:56 -08:00
bors 9c3e6082e7 auto merge of #20154 : P1start/rust/qualified-assoc-type-generics, r=nikomatsakis
This modifies `Parser::eat_lt` to always split up `<<`s, instead of doing so only when a lifetime name followed or the `force` parameter (now removed) was `true`. This is because `Foo<<TYPE` is now a valid start to a type, whereas previously only `Foo<<LIFETIME` was valid.

This is a [breaking-change]. Change code that looks like this:

```rust
let x = foo as bar << 13;
```

to use parentheses, like this:

```rust
let x = (foo as bar) << 13;
```

Closes #17362.
2015-01-03 03:25:21 +00:00
Niko Matsakis dc97247d11 Make call notation use autoderef. Fixes #18742. 2015-01-02 20:59:11 -05:00
bors a6b109723a auto merge of #19835 : pythonesque/rust/add-unordered-intrinsic, r=thestinger
This corresponds to the JMM memory model's non-volatile reads and writes to shared variables.  It provides fairly weak guarantees, but prevents UB (specifically, you will never see a value that was not written _at some point_ to the provided location).  It is not part of the C++ memory model and is only legal to provide to LLVM for loads and stores (not fences, atomicrmw, etc.).

Valid uses of this ordering are things like racy counters where you don't care about the operation actually being atomic, just want to avoid UB.  It cannot be used for synchronization without additional memory barriers since unordered loads and stores may be reordered freely by the optimizer (this is the main way it differs from relaxed).

Because it is new to Rust and it provides so few guarantees, for now only the intrinsic is provided--this patch doesn't add it to any of the higher-level atomic wrappers.
2015-01-03 01:10:40 +00:00
Brian Anderson 51a2feec7b rustup: Don't do verbose tarball extraction 2015-01-02 17:08:03 -08:00
Brian Anderson 83270ed546 rustup: Install from the combined installer 2015-01-02 15:15:15 -08:00
Alex Crichton 340f3fd7a9 rollup merge of #20410: japaric/assoc-types
Conflicts:
	src/liballoc/lib.rs
	src/libcollections/lib.rs
	src/libcollections/slice.rs
	src/libcore/ops.rs
	src/libcore/prelude.rs
	src/libcore/ptr.rs
	src/librustc/middle/traits/project.rs
	src/libstd/c_str.rs
	src/libstd/io/mem.rs
	src/libstd/io/mod.rs
	src/libstd/lib.rs
	src/libstd/path/posix.rs
	src/libstd/path/windows.rs
	src/libstd/prelude.rs
	src/libstd/rt/exclusive.rs
	src/libsyntax/lib.rs
	src/test/compile-fail/issue-18566.rs
	src/test/run-pass/deref-mut-on-ref.rs
	src/test/run-pass/deref-on-ref.rs
	src/test/run-pass/dst-deref-mut.rs
	src/test/run-pass/dst-deref.rs
	src/test/run-pass/fixup-deref-mut.rs
	src/test/run-pass/issue-13264.rs
	src/test/run-pass/overloaded-autoderef-indexing.rs
2015-01-02 13:51:50 -08:00
Brian Anderson b32e0098ef Merge remote-tracking branch 'erickt/rustup' 2015-01-02 13:15:09 -08:00
Chase Southwood c8fcbe7561 Fix vim syntax highlighting for `derive` 2015-01-02 15:06:13 -06:00
Alex Crichton 8cf9929a9a Rebase test fixes v2 2015-01-02 12:09:47 -08:00
Jorge Aparicio 1abee08cbd fix rpass test with s/Output/Target/g 2015-01-02 14:23:46 -05:00
Niko Matsakis fc7d8faba8 Handle recursive obligations without exiting the inference probe
Conflicts:
	src/librustc/middle/traits/select.rs
2015-01-02 14:22:00 -05:00
Niko Matsakis 45468f37c8 Temporarily do not evaluate subobligations. 2015-01-02 14:21:49 -05:00
Niko Matsakis ea1ad792f9 Evaluate projection predicates during trait selection. Fixes #20296. 2015-01-02 14:21:37 -05:00
Alex Crichton 4459b1dced rollup merge of #20341: nikomatsakis/impl-trait-for-trait-2
Conflicts:
	src/librustc/middle/traits/mod.rs
	src/libstd/io/mod.rs
	src/test/run-pass/builtin-superkinds-self-type.rs
2015-01-02 11:13:05 -08:00
Alex Crichton e921e3f045 Rollup test fixes and rebase conflicts 2015-01-02 10:50:13 -08:00
Alex Crichton 1f2ead1629 Merge remote-tracking branch 'origin/master' into rollup
Conflicts:
	src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
2015-01-02 10:50:07 -08:00
Alex Crichton 6f567e0c29 rollup merge of #20425: sanxiyn/opt-local-ty
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-02 09:23:47 -08:00
Alex Crichton 735c308aed rollup merge of #20416: nikomatsakis/coherence
Conflicts:
	src/test/run-pass/issue-15734.rs
	src/test/run-pass/issue-3743.rs
2015-01-02 09:23:42 -08:00
Alex Crichton 4dab96758a rollup merge of #20407: michaelwoerister/unreachable-locals
Fixes #20312
2015-01-02 09:22:50 -08:00
Alex Crichton b51ff9f06a rollup merge of #20404: japaric/at-tests
Closes #17732
Closes #18819
Closes #19479
Closes #19631
Closes #19632
Closes #19850
Closes #19883
Closes #20005
Closes #20009
Closes #20389

---

cc @nikomatsakis @sfackler
2015-01-02 09:22:47 -08:00
Alex Crichton c5b9ffdee6 rollup merge of #20391: daramos/utf8_lossy
Prior to 9bae6ec828 from_utf8_lossy had a minor optimization in place that avoided having to loop from the beginning of the input slice.
Recently 4908017d59 implemented Utf8Error::InvalidByte which makes this possible again.
2015-01-02 09:22:42 -08:00
Alex Crichton 9ca8076cb7 rollup merge of #20386: frewsxcv/rm-reexports
Part of #19253

[breaking-change]
2015-01-02 09:22:37 -08:00
Alex Crichton 073fd5beab rollup merge of #20385: nick29581/x-object
Closes #19056
2015-01-02 09:22:35 -08:00
Alex Crichton b9a26bf4b1 rollup merge of #20334: nagisa/ffi-llvm
Fixes #20313

r? @huonw
2015-01-02 09:22:18 -08:00
Alex Crichton 656d5bbb92 rollup merge of #20227: FlashYoshi/patch-1 2015-01-02 09:22:15 -08:00
Alex Crichton 5bd7a78f66 rollup merge of #19625: mrhota/guide_traits
Nothing major. Clarification, copy-editing, typographical and grammatical consistency
2015-01-02 09:22:10 -08:00
Niko Matsakis cddb41dd1f Do not ICE when projecting out of a value with type `ty::ty_err` 2015-01-02 12:20:29 -05:00
Jorge Aparicio 64b7c22c46 core: use assoc types in `Deref[Mut]` 2015-01-02 12:19:59 -05:00