]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #22051: nagisa/main-emission
Alex Crichton [Tue, 10 Feb 2015 16:41:44 +0000 (08:41 -0800)]
rollup merge of #22051: nagisa/main-emission

Fixes #21813

9 years agorollup merge of #22049: caspark/fix-link-to-rustdoc
Alex Crichton [Tue, 10 Feb 2015 16:41:43 +0000 (08:41 -0800)]
rollup merge of #22049: caspark/fix-link-to-rustdoc

No point sending people to a page which just says "this is now part of
the Rust book" (that page being http://doc.rust-lang.org/rustdoc.html).

9 years agorollup merge of #22012: pnkfelix/propagate-container-across-object-cast
Alex Crichton [Tue, 10 Feb 2015 16:41:41 +0000 (08:41 -0800)]
rollup merge of #22012: pnkfelix/propagate-container-across-object-cast

Given `<expr> as Box<Trait>`, infer that `Box<_>` is expected type for `<expr>`.

This is useful for addressing fallout from newly proposed box protocol; see #22006 for examples of such fallout, much of which will be unnecessary with this fix.

9 years agorollup merge of #22007: thiagooak/master
Alex Crichton [Tue, 10 Feb 2015 16:41:38 +0000 (08:41 -0800)]
rollup merge of #22007: thiagooak/master

From #21829 clarify equivalency of tuples

9 years agorollup merge of #21943: hugwijst/extctxt_ufcs
Alex Crichton [Tue, 10 Feb 2015 16:41:36 +0000 (08:41 -0800)]
rollup merge of #21943: hugwijst/extctxt_ufcs

Add `QPath` construction support to `ExtCtxt`. Allows compiler plugins to generate calls with UFCS.

9 years agorollup merge of #21920: vojtechkral/main-thread-name
Alex Crichton [Tue, 10 Feb 2015 16:41:34 +0000 (08:41 -0800)]
rollup merge of #21920: vojtechkral/main-thread-name

Fixes #21911

9 years agorollup merge of #21918: ranma42/replace-be
Alex Crichton [Tue, 10 Feb 2015 16:41:30 +0000 (08:41 -0800)]
rollup merge of #21918: ranma42/replace-be

Conflicts:
src/test/compile-fail/reserved-be.rs
src/test/compile-fail/reserved-become.rs
src/test/parse-fail/reserved-be.rs

9 years agorollup merge of #21862: iKevinY/libstd-ascii-tests
Alex Crichton [Tue, 10 Feb 2015 16:40:58 +0000 (08:40 -0800)]
rollup merge of #21862: iKevinY/libstd-ascii-tests

9 years agorollup merge of #21353: sanxiyn/upvar
Alex Crichton [Tue, 10 Feb 2015 16:39:51 +0000 (08:39 -0800)]
rollup merge of #21353: sanxiyn/upvar

Fix #20558.

9 years agoMove native thread name setting from thread_info to Thread, fixes #21911
Vojtech Kral [Tue, 10 Feb 2015 14:06:45 +0000 (15:06 +0100)]
Move native thread name setting from thread_info to Thread, fixes #21911

9 years agoAuto merge of #22028 - nikomatsakis:issue-22019-caching, r=aturon
bors [Tue, 10 Feb 2015 13:23:29 +0000 (13:23 +0000)]
Auto merge of #22028 - nikomatsakis:issue-22019-caching, r=aturon

Simplify cache selection by just using the local cache whenever there
are any where-clauses at all. This seems to be the simplest possible
rule and will (hopefully!) put an end to these annoying "cache leak"
bugs. Fixes #22019.

r? @aturon

9 years agoAuto merge of #22026 - kmcallister:plugin, r=sfackler
bors [Tue, 10 Feb 2015 11:15:52 +0000 (11:15 +0000)]
Auto merge of #22026 - kmcallister:plugin, r=sfackler

```rust
#[plugin] #[no_link] extern crate bleh;
```

becomes a crate attribute

```rust
#![plugin(bleh)]
```

The feature gate is still required.

It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute.

Fixes #21043.
Fixes #20769.

[breaking-change]

9 years agoAuto merge of #21961 - nick29581:hrl-syntax, r=nmatsakis
bors [Tue, 10 Feb 2015 09:10:37 +0000 (09:10 +0000)]
Auto merge of #21961 - nick29581:hrl-syntax, r=nmatsakis

Closes # 20022

r? @nikomatsakis

9 years agoAuto merge of #21937 - alexcrichton:issue-21929, r=aturon
bors [Tue, 10 Feb 2015 06:39:31 +0000 (06:39 +0000)]
Auto merge of #21937 - alexcrichton:issue-21929, r=aturon

These were forgotten reexports from #21718

Closes #21929

9 years agoAuto merge of #21936 - alexcrichton:fsv2, r=aturon
bors [Tue, 10 Feb 2015 04:07:03 +0000 (04:07 +0000)]
Auto merge of #21936 - alexcrichton:fsv2, r=aturon

This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs`
module to the standard library. This module provides much of the same
functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses
the new `std::path` module.

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

9 years agoTests
Nick Cameron [Mon, 9 Feb 2015 03:49:27 +0000 (16:49 +1300)]
Tests

9 years agostd: Add a new `fs` module
Alex Crichton [Tue, 3 Feb 2015 05:39:14 +0000 (21:39 -0800)]
std: Add a new `fs` module

This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs`
module to the standard library. This module provides much of the same
functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses
the new `std::path` module.

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

9 years agoAdd a help message for deprecated #[plugin] extern crate
Keegan McAllister [Mon, 9 Feb 2015 22:25:47 +0000 (14:25 -0800)]
Add a help message for deprecated #[plugin] extern crate

9 years agoUse a crate attribute to load plugins
Keegan McAllister [Fri, 6 Feb 2015 21:56:38 +0000 (13:56 -0800)]
Use a crate attribute to load plugins

    #[plugin] #[no_link] extern crate bleh;

becomes a crate attribute

    #![plugin(bleh)]

The feature gate is still required.

It's almost never correct to link a plugin into the resulting library /
executable, because it will bring all of libsyntax and librustc with it.
However if you really want this behavior, you can get it with a separate
`extern crate` item in addition to the `plugin` attribute.

Fixes #21043.
Fixes #20769.

[breaking-change]

9 years agoAuto merge of #21876 - nick29581:driver-args, r=huonw
bors [Mon, 9 Feb 2015 19:01:37 +0000 (19:01 +0000)]
Auto merge of #21876 - nick29581:driver-args, r=huonw

This allows people to write tools which are drop-in replacements for rustc by implementing `CompilerCalls` and three lines of code, rather than having to copy+paste a bunch of args parsing code.

r? @alexcrichton

9 years agoadd test illustrating the feature.
Felix S. Klock II [Fri, 6 Feb 2015 17:05:32 +0000 (18:05 +0100)]
add test illustrating the feature.

(with multiple impls to further exercise correct trait-matching.)

9 years agoGiven `<expr> as Box<Trait>`, infer that `Box<_>` is expected type for `<expr>`.
Felix S. Klock II [Fri, 6 Feb 2015 16:59:56 +0000 (17:59 +0100)]
Given `<expr> as Box<Trait>`, infer that `Box<_>` is expected type for `<expr>`.

9 years agoReview changes
Nick Cameron [Tue, 3 Feb 2015 00:40:52 +0000 (13:40 +1300)]
Review changes

9 years agoRefactor compilation to make it easier to use for tools
Nick Cameron [Fri, 30 Jan 2015 08:44:27 +0000 (21:44 +1300)]
Refactor compilation to make it easier to use for tools

9 years agoAuto merge of #22059 - Gankro:vec-split, r=alexcrichton
bors [Mon, 9 Feb 2015 01:29:19 +0000 (01:29 +0000)]
Auto merge of #22059 - Gankro:vec-split, r=alexcrichton

9 years agoAuto merge of #21992 - steveklabnik:gh17220, r=alexcrichton
bors [Sun, 8 Feb 2015 23:24:33 +0000 (23:24 +0000)]
Auto merge of #21992 - steveklabnik:gh17220, r=alexcrichton

None of the others work, so let's remove them.

Fixes #17220.

r? @brson

9 years agoAccept quantification of lifetimes outside the self type in where clauses.
Nick Cameron [Thu, 5 Feb 2015 08:46:01 +0000 (21:46 +1300)]
Accept quantification of lifetimes outside the self type in where clauses.

Closes #20022

9 years agoMove native thread name setting from thread_info to Thread, fixes #21911
Vojtech Kral [Wed, 4 Feb 2015 01:26:00 +0000 (02:26 +0100)]
Move native thread name setting from thread_info to Thread, fixes #21911

9 years agoAuto merge of #22046 - mneumann:dragonfly-libstd-fixes, r=huonw
bors [Sun, 8 Feb 2015 16:47:12 +0000 (16:47 +0000)]
Auto merge of #22046 - mneumann:dragonfly-libstd-fixes, r=huonw

9 years agoAuto merge of #22054 - LeoTestard:include-parse-errors, r=alexcrichton
bors [Sun, 8 Feb 2015 14:41:02 +0000 (14:41 +0000)]
Auto merge of #22054 - LeoTestard:include-parse-errors, r=alexcrichton

Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.

9 years agoAdd a test for mainless emit targets
Simonas Kazlauskas [Sun, 8 Feb 2015 08:51:46 +0000 (10:51 +0200)]
Add a test for mainless emit targets

9 years agoAuto merge of #22011 - fhahn:separate-parse-fail-tests, r=nikomatsakis
bors [Sun, 8 Feb 2015 12:35:03 +0000 (12:35 +0000)]
Auto merge of #22011 - fhahn:separate-parse-fail-tests, r=nikomatsakis

This PR moves all `compile-fail` tests that fail at the parsing stage to a `parse-fail` directory, in order to use the tests in the `parse-fail` directory to test if the new LALR parser rejects the same files as the Rust parser. I also adjusted the `testparser.py` script to handle the tests in `parse-fail` differently.

However during working on this, I discovered, that Rust's parser sometimes fails during parsing, but does not return a nonzero return code, e.g. compiling `/test/compile-fail/doc-before-semi.rs` with `-Z parse-only` prints an error message, but returns status code 0. Compiling the same file without `-Z parse-only`, the same error message is displayed, but error code 101 returned. I'll look into that over the next week.

9 years agoAuto merge of #21970 - michaelwoerister:lang-item-call-debug-locs, r=brson
bors [Sun, 8 Feb 2015 10:27:58 +0000 (10:27 +0000)]
Auto merge of #21970 - michaelwoerister:lang-item-call-debug-locs, r=brson

Resolves some issues caused by the recent LLVM update (which itself solved some issues).

Closes #19848
Closes #20798

9 years agoAuto merge of #21565 - kmcallister:poison, r=alexcrichton
bors [Sun, 8 Feb 2015 08:21:44 +0000 (08:21 +0000)]
Auto merge of #21565 - kmcallister:poison, r=alexcrichton

I needed these to implement efficient poisoning in [seqloq](https://github.com/kmcallister/seqloq/tree/poison).

9 years agoAuto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichton
bors [Sun, 8 Feb 2015 06:15:52 +0000 (06:15 +0000)]
Auto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichton

r? @alexcrichton

9 years agoAuto merge of #22044 - caspark:fix-rc-doc-links, r=nikomatsakis
bors [Sun, 8 Feb 2015 02:30:09 +0000 (02:30 +0000)]
Auto merge of #22044 - caspark:fix-rc-doc-links, r=nikomatsakis

Current link structure is /std/rc/struct.Rc.html so ../index.html ends
up linking to /std/ rather than /std/rc/

9 years agoAuto merge of #21988 - kmcallister:no-std, r=sfackler
bors [Sun, 8 Feb 2015 00:24:03 +0000 (00:24 +0000)]
Auto merge of #21988 - kmcallister:no-std, r=sfackler

Fixes #21833.

[breaking-change]

r? @alexcrichton

The tests in #21912 will also need `#[feature(no_std)]`. If you're okay with both PRs, I can merge and test them.

9 years agoAuto merge of #21874 - nagisa:reference-is-removal, r=steveklabnik
bors [Sat, 7 Feb 2015 21:48:33 +0000 (21:48 +0000)]
Auto merge of #21874 - nagisa:reference-is-removal, r=steveklabnik

r? @steveklabnik

9 years agominor fixes to Vec docs and bounds check
Alexis [Sat, 7 Feb 2015 19:58:58 +0000 (14:58 -0500)]
minor fixes to Vec docs and bounds check

9 years agoFix new test
Keegan McAllister [Sat, 7 Feb 2015 18:51:25 +0000 (10:51 -0800)]
Fix new test

9 years agoMake std::fmt a simple re-export from collections
Keegan McAllister [Fri, 6 Feb 2015 05:08:02 +0000 (21:08 -0800)]
Make std::fmt a simple re-export from collections

9 years agoFake up #![no_std] on pretty-printing; keep it out of AST
Keegan McAllister [Fri, 6 Feb 2015 01:04:11 +0000 (17:04 -0800)]
Fake up #![no_std] on pretty-printing; keep it out of AST

9 years agoFeature-gate #![no_std]
Keegan McAllister [Fri, 6 Feb 2015 00:14:42 +0000 (16:14 -0800)]
Feature-gate #![no_std]

Fixes #21833.

[breaking-change]

9 years agoDon't use std:: paths in syntax extensions when compiling a #![no_std] crate
Keegan McAllister [Sun, 7 Sep 2014 21:57:26 +0000 (14:57 -0700)]
Don't use std:: paths in syntax extensions when compiling a #![no_std] crate

Fixes #16803.
Fixes #14342.
Fixes half of #21827 -- slice syntax is still broken.

9 years agoUse path helper macros in deriving
Keegan McAllister [Sun, 7 Sep 2014 20:58:41 +0000 (13:58 -0700)]
Use path helper macros in deriving

9 years agoAuto merge of #21984 - pnkfelix:make-for-loops-a-terminating-scope, r=nikomatsakis
bors [Sat, 7 Feb 2015 18:20:55 +0000 (18:20 +0000)]
Auto merge of #21984 - pnkfelix:make-for-loops-a-terminating-scope, r=nikomatsakis

make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR.

In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer.

----

There is one case I know of that this breaks, demonstrated to me by @nikomatsakis  (but it is also a corner-case that is useless in practice).  Here is that case:

```
fn main() {
    let mut foo: Vec<&i8> = Vec::new();
    for i in &[1, 2, 3] { foo.push(i) }
}
```

Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.)

(The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.)

----

So, technically this is a:

[breaking-change]

9 years agoFix handling of parse errors when using `include!()`.
Leo Testard [Sat, 7 Feb 2015 16:23:33 +0000 (17:23 +0100)]
Fix handling of parse errors when using `include!()`.

Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.

9 years agoAuto merge of #21982 - pnkfelix:extend-Z-print-region-graph, r=nikomatsakis
bors [Sat, 7 Feb 2015 16:14:20 +0000 (16:14 +0000)]
Auto merge of #21982 - pnkfelix:extend-Z-print-region-graph, r=nikomatsakis

Extend region-inference graphviz rendering with enclosing relationship as well as the constraint edges.

9 years agoAuto merge of #21971 - pnkfelix:fsk-restrict-fixdsz-array-moves, r=nikomatsakis
bors [Sat, 7 Feb 2015 14:08:38 +0000 (14:08 +0000)]
Auto merge of #21971 - pnkfelix:fsk-restrict-fixdsz-array-moves, r=nikomatsakis

Revised version of PR #21930.

Restrictions on moves into and out-from fixed-length arrays.

(There was only one use of this "feature" in the compiler source.)

Note 1: the change to the error message in tests/compile-fail/borrowck-use-in-index-lvalue.rs, where we now report that *w is uninitialized (rather than w), was unintended fallout from the implementation strategy used here. The change appears harmless to me, but I welcome advice on how to bring back the old message, which was slightly cleaner (i.e. less unintelligible) since that the syntactic form *w does not actually appear in the source text.

Note 2: the move out-from restriction to only apply to expr[i], and not destructuring bind (e.g. f([a, b, c]: Array) { ... }) since the latter is compatible with nonzeroing drop, AFAICT.

[breaking-change]

9 years agoDo not fail if --emit≠link and there’s no main fn
Simonas Kazlauskas [Sat, 7 Feb 2015 13:41:21 +0000 (15:41 +0200)]
Do not fail if --emit≠link and there’s no main fn

Fixes #21813

9 years agoUpdates to tests reflecting array-move restrictions.
Felix S. Klock II [Wed, 4 Feb 2015 11:25:25 +0000 (12:25 +0100)]
Updates to tests reflecting array-move restrictions.

Note that the change to the error message in
borrowck-use-in-index-lvalue.rs, where we report that `*w` is
uninitialized rather than `w`, was unintended fallout from the
implementation strategy used here.

The change appears harmless to me, but I welcome advice on how to
bring back the old message, which was slightly cleaner (i.e. less
unintelligible).

----

drive-by: revise compile-fail/borrowck-vec-pattern-move-tail to make
it really clear that there is a conflict that must be signaled.

(A hypothetical future version of Rust might be able to accept the
prior version of the code, since the previously updated index was not
actually aliased.)

9 years agoAdd tests of move-into-dead-array restriction.
Felix S. Klock II [Tue, 3 Feb 2015 17:10:56 +0000 (18:10 +0100)]
Add tests of move-into-dead-array restriction.

9 years agoAdd tests of move-out-of-array restriction.
Felix S. Klock II [Tue, 3 Feb 2015 16:44:16 +0000 (17:44 +0100)]
Add tests of move-out-of-array restriction.

9 years agoRestrictions on moves out-from and into fixed-length arrays.
Felix S. Klock II [Tue, 3 Feb 2015 00:25:45 +0000 (01:25 +0100)]
Restrictions on moves out-from and into fixed-length arrays.

No longer legal: `fn foo(a: [D; 5]) { drop(a); a[2] = D::new(); }`;
one must first initialize the entirety of `a` before assigning to its
individual elements.

No longer legal: `fn foo(arr: [D; 5]) -> D { arr[2] }`, unless `D`
implements `Copy`. This "move out-from" restriction only affects
`expr[i]`, and not destructuring (e.g. `f([a, b, c]: Array) { ... }`).

uses mem_categorization to distinguish destructuring-bind from array
indexing.

See discussion on RFC PR 533.

[breaking-change]

9 years agoFix libsyntax so we can bootstrap even with move out of array restriction.
Felix S. Klock II [Tue, 3 Feb 2015 01:34:39 +0000 (02:34 +0100)]
Fix libsyntax so we can bootstrap even with move out of array restriction.

9 years agoremove closure `&mut:`/`&:` annotations.
Felix S. Klock II [Sat, 7 Feb 2015 12:16:09 +0000 (13:16 +0100)]
remove closure `&mut:`/`&:` annotations.

9 years agoAuto merge of #22023 - alexcrichton:oops-picked-the-wrong-plugin, r=nikomatsakis
bors [Sat, 7 Feb 2015 12:01:31 +0000 (12:01 +0000)]
Auto merge of #22023 - alexcrichton:oops-picked-the-wrong-plugin, r=nikomatsakis

The compiler would previously fall back to using `-L` and normal lookup paths if
a `--extern` path was specified but it did not match (wrong architecture, for
example). This commit removes this behavior and forces the hand of the crate
loader to *always* use the `--extern` path if specified, no matter whether it is
correct or not.

This fixes a bug today where the compiler's own libraries are favored in cross
compilation by accident. For example when a crate using the crates.io version of
`log` was cross compiled, Cargo would compile `log` for the target architecture.
When loading the macros, however, the compiler currently favors using the *host*
architecture (for plugins), and because the `--extern log=...` pointed at an
rlib for the target architecture, that lookup failed. The crate loader  then
fell back on `-L` paths to find the compiler-used `log` crate (the wrong one!)
and then a compile failure happened because the logging macros are slightly
different.

9 years agoLink to rustdoc page in the Rust book directly
Caspar Krieger [Sat, 7 Feb 2015 11:21:01 +0000 (22:21 +1100)]
Link to rustdoc page in the Rust book directly

No point sending people to a page which just says "this is now part of
the Rust book".

9 years agoFix struct passwd and _SC_GETPW_R_SIZE_MAX for DragonFly
Michael Neumann [Sat, 7 Feb 2015 11:04:36 +0000 (12:04 +0100)]
Fix struct passwd and _SC_GETPW_R_SIZE_MAX for DragonFly

9 years agoFix broken link to std::rc module docs
Caspar Krieger [Sat, 7 Feb 2015 10:45:13 +0000 (21:45 +1100)]
Fix broken link to std::rc module docs

Current link structure is /std/rc/struct.Rc.html so ../index.html ends
up linking to /std/ rather than /std/rc/

9 years agoAuto merge of #21995 - leejunseok:fix_invariant_ex, r=steveklabnik
bors [Sat, 7 Feb 2015 09:55:14 +0000 (09:55 +0000)]
Auto merge of #21995 - leejunseok:fix_invariant_ex, r=steveklabnik

Should fix #20147

This is my second PR in the history of ever (I botched my first one #21828). Any tips would be appreciated!

9 years agoAuto merge of #21978 - Potpourri:error-extern-crate-staticlib, r=alexcrichton
bors [Sat, 7 Feb 2015 06:34:37 +0000 (06:34 +0000)]
Auto merge of #21978 - Potpourri:error-extern-crate-staticlib, r=alexcrichton

Add special error for this case and help message `please recompile this crate using --crate-type lib`, also list found candidates.

See issue #14416

r? @alexcrichton

9 years agosync: Expose PoisonError::new
Keegan McAllister [Fri, 23 Jan 2015 19:58:49 +0000 (11:58 -0800)]
sync: Expose PoisonError::new

9 years agosync: Add is_poisoned to Mutex and RwLock
Keegan McAllister [Fri, 23 Jan 2015 19:47:04 +0000 (11:47 -0800)]
sync: Add is_poisoned to Mutex and RwLock

9 years agoAuto merge of #21949 - japaric:index, r=nikomatsakis
bors [Sat, 7 Feb 2015 04:14:22 +0000 (04:14 +0000)]
Auto merge of #21949 - japaric:index, r=nikomatsakis

closes #21630

Overloaded indexing (`&[mut] foo[bar]`) only works when `<Self as Index>::Output` is the same as `<Self as IndexMut>::Output` (see issue above). To restrict implementations of `IndexMut` that doesn't work, this PR makes `IndexMut` a supertrait over `Index`, i.e. `trait IndexMut<I>: Index<I>`, just like in the `trait DerefMut: Deref` case.

This breaks all downstream implementations of `IndexMut`, in most cases this simply means removing the `type Output = ..` bit, which is now redundant, from `IndexMut` implementations:

``` diff
 impl Index<Foo> for Bar {
     type Output = Baz;
     ..
 }

 impl IndexMut<Foo> for Bar {
-    type Output = Baz;
     ..
 }
```

[breaking-change]

---

r? @nikomatsakis

9 years agomake `IndexMut` a super trait over `Index`
Jorge Aparicio [Wed, 4 Feb 2015 23:00:12 +0000 (18:00 -0500)]
make `IndexMut` a super trait over `Index`

closes #21630

9 years agoAuto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichton
bors [Sat, 7 Feb 2015 02:04:47 +0000 (02:04 +0000)]
Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichton

It's in order to make the code more homogeneous.

9 years agoSimplify cache selection by just using the local cache whenever there
Niko Matsakis [Sat, 7 Feb 2015 00:11:50 +0000 (19:11 -0500)]
Simplify cache selection by just using the local cache whenever there
are any where-clauses at all. This seems to be the simplest possible
rule and will (hopefully!) put an end to these annoying "cache leak"
bugs. Fixes #22019.

9 years agoAuto merge of #21997 - Manishearth:rollup, r=alexcrichton
bors [Fri, 6 Feb 2015 23:30:17 +0000 (23:30 +0000)]
Auto merge of #21997 - Manishearth:rollup, r=alexcrichton

None

9 years agolibrustdoc has been updated
GuillaumeGomez [Thu, 5 Feb 2015 14:19:23 +0000 (15:19 +0100)]
librustdoc has been updated

Fixes run build error

Fix test failure

Fix tests' errors

9 years agorustc: Don't fall back to -L if using --extern
Alex Crichton [Fri, 6 Feb 2015 21:40:00 +0000 (13:40 -0800)]
rustc: Don't fall back to -L if using --extern

The compiler would previously fall back to using `-L` and normal lookup paths if
a `--extern` path was specified but it did not match (wrong architecture, for
example). This commit removes this behavior and forces the hand of the crate
loader to *always* use the `--extern` path if specified, no matter whether it is
correct or not.

This fixes a bug today where the compiler's own libraries are favored in cross
compilation by accident. For example when a crate using the crates.io version of
`log` was cross compiled, Cargo would compile `log` for the target architecture.
When loading the macros, however, the compiler currently favors using the *host*
architecture (for plugins), and because the `--extern log=...` pointed at an
rlib for the target architecture, that lookup failed. The crate loader  then
fell back on `-L` paths to find the compiler-used `log` crate (the wrong one!)
and then a compile failure happened because the logging macros are slightly
different.

9 years agoMove compile-fail tests that are rejected by the parser to parse-fail
Florian Hahn [Fri, 6 Feb 2015 15:51:47 +0000 (16:51 +0100)]
Move compile-fail tests that are rejected by the parser to parse-fail

9 years agodebuginfo: Fix problem with debug locations of constants in match patterns.
Michael Woerister [Thu, 5 Feb 2015 17:26:58 +0000 (18:26 +0100)]
debuginfo: Fix problem with debug locations of constants in match patterns.

9 years agodebuginfo: Implement direct debuginfo source location application for ICmp, FCmp...
Michael Woerister [Wed, 4 Feb 2015 16:42:32 +0000 (17:42 +0100)]
debuginfo: Implement direct debuginfo source location application for ICmp, FCmp, and CallWithConv.

9 years agodebuginfo: Assign debuginfo source locations to lang-item calls.
Michael Woerister [Wed, 4 Feb 2015 16:16:59 +0000 (17:16 +0100)]
debuginfo: Assign debuginfo source locations to lang-item calls.

9 years agoAuto merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichton
bors [Fri, 6 Feb 2015 19:49:31 +0000 (19:49 +0000)]
Auto merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichton

New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`,
are added to implement the lifetime convention as agreed in rust-lang/rfcs#556.
The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are
left deprecated for the time being.

Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions.

Contribution to #21923.

9 years agoRollup merge of #22009 - japaric:no-mov, r=alexcrichton
Manish Goregaokar [Fri, 6 Feb 2015 19:14:31 +0000 (00:44 +0530)]
Rollup merge of #22009 - japaric:no-mov, r=alexcrichton

 If you were still using `MaybeOwnedVector`, update your code to use `CowVec`.

[breaking-change]

---

We already removed `MaybeOwned` (the string equivalent) long time ago and with a much shorter deprecation period. It's time to let go.

9 years agoRollup merge of #22005 - nagisa:obsolete-ctx, r=alexcrichton
Manish Goregaokar [Fri, 6 Feb 2015 19:14:14 +0000 (00:44 +0530)]
Rollup merge of #22005 - nagisa:obsolete-ctx, r=alexcrichton

 The word is repeated twice in the message like:

    error: obsolete syntax: `:`, `&mut:`, or `&:` syntax

This removes the word syntax that appears in messages after the second colon (:).

9 years agoRollup merge of #21994 - iKevinY:featureck-fix, r=brson
Manish Goregaokar [Fri, 6 Feb 2015 19:13:54 +0000 (00:43 +0530)]
Rollup merge of #21994 - iKevinY:featureck-fix, r=brson

 It seems that `lang_feature_stats` was supposed to refer to `language_feature_stats` instead.

r? @brson

9 years agofix outdated docs
Alexis [Fri, 6 Feb 2015 18:57:13 +0000 (13:57 -0500)]
fix outdated docs

Conflicts:
src/libstd/collections/mod.rs

9 years agofix outdated docs
Alexis [Fri, 6 Feb 2015 18:57:13 +0000 (13:57 -0500)]
fix outdated docs

Conflicts:
src/libstd/collections/mod.rs

9 years agoMore libcollections fixes
Manish Goregaokar [Fri, 6 Feb 2015 18:06:02 +0000 (23:36 +0530)]
More libcollections fixes

9 years agoAuto merge of #21860 - mdinger:enum_rewording, r=steveklabnik
bors [Fri, 6 Feb 2015 17:45:19 +0000 (17:45 +0000)]
Auto merge of #21860 - mdinger:enum_rewording, r=steveklabnik

Second try to address https://github.com/rust-lang/rust/issues/21196 . A lot that was removed at the end basically seemed repetitive showing simple variations on the same type. It seems more effective to just show more variants at the beginning instead.

If you want to pack values into an example, better to use `i32` or some digit than `String` because you don't need the `to_string()` method.

I didn't mention `derive` because:
* I can't explain it (only use it)
* I don't have a link to a good description (maybe rustbyexample but you probably want links internal)
* Giving more detail especially stating that `==` won't work and why should help quite a bit

I didn't `make test` or check links but I will if this will be merged.

@steveklabnik

9 years agoremove the deprecated MaybeOwnedVector
Jorge Aparicio [Fri, 6 Feb 2015 13:50:17 +0000 (08:50 -0500)]
remove the deprecated MaybeOwnedVector

9 years agoBook Compound Data Types update
Thiago Carvalho [Fri, 6 Feb 2015 14:36:31 +0000 (15:36 +0100)]
Book Compound Data Types update

From Issue 21829 clarify equivalency of tuples

9 years agoRemove word syntax from obsolete syntax messages
Simonas Kazlauskas [Fri, 6 Feb 2015 14:24:13 +0000 (16:24 +0200)]
Remove word syntax from obsolete syntax messages

The word is repeated twice in the message like

    error: obsolete syntax: `:`, `&mut:`, or `&:` syntax

This removes the word syntax that appears in messages after the second colon (:).

9 years agoRollup merge of #21991 - steveklabnik:gh21915, r=huonw
Manish Goregaokar [Fri, 6 Feb 2015 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #21991 - steveklabnik:gh21915, r=huonw

 Fixes #21915

9 years agorm unused feature
Manish Goregaokar [Fri, 6 Feb 2015 10:49:30 +0000 (16:19 +0530)]
rm unused feature

9 years agolibcollections: unit test fixes
Manish Goregaokar [Fri, 6 Feb 2015 02:35:52 +0000 (08:05 +0530)]
libcollections: unit test fixes

9 years agoremove int_uint feature from libcollections
Alexis [Thu, 5 Feb 2015 20:08:33 +0000 (15:08 -0500)]
remove int_uint feature from libcollections

9 years agoRollup merge of #21989 - steveklabnik:gh21491, r=Gankro
Manish Goregaokar [Fri, 6 Feb 2015 01:37:04 +0000 (07:07 +0530)]
Rollup merge of #21989 - steveklabnik:gh21491, r=Gankro

 Fixes #21491

r? @kmcallister @Gankro

9 years agoAuto merge of #21962 - vrinek:printable-book, r=steveklabnik
bors [Fri, 6 Feb 2015 13:57:11 +0000 (13:57 +0000)]
Auto merge of #21962 - vrinek:printable-book, r=steveklabnik

Tested on:

* Safari on OSX
* Firefox on OSX

9 years agoEncode foreign function argument names
Tom Jakubowski [Fri, 6 Feb 2015 10:43:45 +0000 (02:43 -0800)]
Encode foreign function argument names

Fix #21917

9 years agoPrint full Type::ResolvedPaths starting with Self
Tom Jakubowski [Fri, 6 Feb 2015 10:02:59 +0000 (02:02 -0800)]
Print full Type::ResolvedPaths starting with Self

(e.g., `Self::Output`)

This doesn't actually "resugar" qualified paths like `<Self as
Foo>::Output`, it just doesn't elide the prefix segments when rendering
cleaned paths like `Self::Output`.

cc #21145

9 years agoFix infinite loop error
GuillaumeGomez [Thu, 5 Feb 2015 14:11:51 +0000 (15:11 +0100)]
Fix infinite loop error

9 years agoRemove getenv warning
GuillaumeGomez [Thu, 5 Feb 2015 00:03:12 +0000 (01:03 +0100)]
Remove getenv warning

9 years agoUpdate to last version, remove "[]" as much as possible
GuillaumeGomez [Wed, 4 Feb 2015 20:48:12 +0000 (21:48 +0100)]
Update to last version, remove "[]" as much as possible

9 years agolibrustc_driver has been updated
GuillaumeGomez [Wed, 4 Feb 2015 00:07:42 +0000 (01:07 +0100)]
librustc_driver has been updated

9 years agolibrustc_trans has been updated
GuillaumeGomez [Wed, 4 Feb 2015 00:04:50 +0000 (01:04 +0100)]
librustc_trans has been updated

9 years agolibrustc_resolve has been updated
GuillaumeGomez [Tue, 3 Feb 2015 23:48:39 +0000 (00:48 +0100)]
librustc_resolve has been updated