Commit Graph

38124 Commits

Author SHA1 Message Date
Keegan McAllister
ea85d43903 Make std::fmt a simple re-export from collections 2015-02-07 10:49:58 -08:00
Keegan McAllister
a246b6542a Fake up #![no_std] on pretty-printing; keep it out of AST 2015-02-07 10:49:58 -08:00
Keegan McAllister
d788588dce Feature-gate #![no_std]
Fixes #21833.

[breaking-change]
2015-02-07 10:49:58 -08:00
Keegan McAllister
67350bc868 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.
2015-02-07 10:49:57 -08:00
Keegan McAllister
74eef05e7d Use path helper macros in deriving 2015-02-07 10:49:57 -08:00
bors
ce5aad2f10 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.
2015-02-07 16:14:20 +00:00
bors
8661b3dc0f 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]
2015-02-07 14:08:38 +00:00
Felix S. Klock II
4583272bf5 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.)
2015-02-07 13:44:06 +01:00
Felix S. Klock II
128ac9dfcb Add tests of move-into-dead-array restriction. 2015-02-07 13:44:06 +01:00
Felix S. Klock II
ce341f79b4 Add tests of move-out-of-array restriction. 2015-02-07 13:44:06 +01:00
Felix S. Klock II
cc8f35f874 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]
2015-02-07 13:44:00 +01:00
Felix S. Klock II
c0a874472a Fix libsyntax so we can bootstrap even with move out of array restriction. 2015-02-07 13:19:30 +01:00
Felix S. Klock II
7610feb82a remove closure &mut:/&: annotations. 2015-02-07 13:16:09 +01:00
bors
80627cd3cc 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.
2015-02-07 12:01:31 +00:00
bors
a08504bb35 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!
2015-02-07 09:55:14 +00:00
bors
e62fec36b9 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
2015-02-07 06:34:37 +00:00
bors
0b6dbbc9cf 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
2015-02-07 04:14:22 +00:00
Jorge Aparicio
724bf7bce2 make IndexMut a super trait over Index
closes #21630
2015-02-06 21:11:59 -05:00
bors
7ebf9bc5c2 Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichton
It's in order to make the code more homogeneous.
2015-02-07 02:04:47 +00:00
bors
d3732a12e8 Auto merge of #21997 - Manishearth:rollup, r=alexcrichton
None
2015-02-06 23:30:17 +00:00
GuillaumeGomez
a2e01c62d5 librustdoc has been updated
Fixes run build error

Fix test failure

Fix tests' errors
2015-02-06 22:54:41 +01:00
Alex Crichton
48b6aef660 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.
2015-02-06 13:53:39 -08:00
bors
b75b21cb9b 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.
2015-02-06 19:49:31 +00:00
Manish Goregaokar
df7db970dc 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.
2015-02-07 00:44:31 +05:30
Manish Goregaokar
fc1e045d83 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 (:).
2015-02-07 00:44:14 +05:30
Manish Goregaokar
0346bcf44d 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
2015-02-07 00:43:54 +05:30
Alexis
e15538d7ac fix outdated docs
Conflicts:
	src/libstd/collections/mod.rs
2015-02-07 00:42:29 +05:30
Alexis
3a9b4e5f8d fix outdated docs
Conflicts:
	src/libstd/collections/mod.rs
2015-02-07 00:31:20 +05:30
Manish Goregaokar
e5f25244f1 More libcollections fixes 2015-02-06 23:36:02 +05:30
bors
7884eb8e2f 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
2015-02-06 17:45:19 +00:00
Jorge Aparicio
67ee26d94e remove the deprecated MaybeOwnedVector 2015-02-06 10:00:17 -05:00
Simonas Kazlauskas
1589dcf944 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 (:).
2015-02-06 16:25:39 +02:00
Manish Goregaokar
1a2b602675 Rollup merge of #21991 - steveklabnik:gh21915, r=huonw
Fixes #21915
2015-02-06 19:42:34 +05:30
Manish Goregaokar
40d1b23fdd rm unused feature 2015-02-06 19:42:33 +05:30
Manish Goregaokar
f7aac937f5 libcollections: unit test fixes 2015-02-06 19:42:33 +05:30
Alexis
73b9aeb429 remove int_uint feature from libcollections 2015-02-06 19:42:33 +05:30
Manish Goregaokar
c4e12c1536 Rollup merge of #21989 - steveklabnik:gh21491, r=Gankro
Fixes #21491

r? @kmcallister @Gankro
2015-02-06 19:42:32 +05:30
bors
0b56e9b1cb Auto merge of #21962 - vrinek:printable-book, r=steveklabnik
Tested on:

* Safari on OSX
* Firefox on OSX
2015-02-06 13:57:11 +00:00
GuillaumeGomez
9e20035e33 Fix infinite loop error 2015-02-06 12:03:48 +01:00
GuillaumeGomez
b0b4136d45 Remove getenv warning 2015-02-06 12:03:48 +01:00
GuillaumeGomez
7b973ba827 Update to last version, remove "[]" as much as possible 2015-02-06 12:03:46 +01:00
GuillaumeGomez
93fe5c82bf librustc_driver has been updated 2015-02-06 12:01:58 +01:00
GuillaumeGomez
b0097783b9 librustc_trans has been updated 2015-02-06 12:01:57 +01:00
GuillaumeGomez
1ff6e5356c librustc_resolve has been updated 2015-02-06 12:01:14 +01:00
GuillaumeGomez
4b6632d82d librustc_typeck has been updated 2015-02-06 12:00:27 +01:00
GuillaumeGomez
0f09021b37 librustc_borrowck has been updated 2015-02-06 11:59:11 +01:00
GuillaumeGomez
664c41b427 librustc has been updated 2015-02-06 11:59:10 +01:00
GuillaumeGomez
8b12d3ddf9 Libsyntax has been updated 2015-02-06 11:59:10 +01:00
GuillaumeGomez
12f1f4c546 Update HEAD:master 2015-02-06 11:59:10 +01:00
GuillaumeGomez
d58c0a7597 Replace the get method by the deref one on InternedString 2015-02-06 11:59:10 +01:00