Commit Graph

35721 Commits

Author SHA1 Message Date
Jorge Aparicio
b98c3bd4d2 Tell expr_use_visitor that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
9a962a7bdc Tell trans that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
c5b6d9412d Tell typeck that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
7efaf3fa34 syntax/ast_util: add is_by_value_unop() 2014-12-18 14:56:00 -05:00
th0114nd
15d54549d7 Put quotes around "as", because it's a keyword. 2014-12-18 14:47:43 -05:00
bors
f9a48492a8 auto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

---

Rebased version of #18958
r? @alexcrichton 
cc @pcwalton
2014-12-18 17:32:07 +00:00
Patrick Walton
ddb2466f6a librustc: Always parse macro!()/macro![] as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]
2014-12-18 12:09:07 -05:00
Andrew Paseltiner
01aa4ca7d8 Clean up collections::binary_heap 2014-12-18 10:58:56 -05:00
Philip Munksgaard
3d6babee9d Use -perm /a+x instead of -perm +a+x in calls to find
The use of `+a+x` is deprecated.

Fixes #19981.
2014-12-18 16:22:10 +01:00
Erick Tryzelaar
d729c966bb serialize: silence some warnings 2014-12-18 07:02:25 -08:00
Erick Tryzelaar
11d9175a90 serialize: keep libserialize in sync with rustc-serialize to simplify merging 2014-12-18 06:56:34 -08:00
bors
c4d58ce15b auto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton
Windows dbghelp strips leading underscores from symbols, and I could not find a way to turn this off.  So let's accept  "ZN...E" form too.
Also, print PC displacement from symbols.  This is helpful in gauging whether the PC was indeed within the function displayed in the backtrace, or whether it just happened to be the closest public symbol in the module.
2014-12-18 14:42:06 +00:00
bors
2a231594c4 auto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton
Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.
2014-12-18 12:21:57 +00:00
Felix S. Klock II
0e9b12b9cc Add regression test for Issue 19811.
Fix #19811.
2014-12-18 12:37:29 +01:00
Valerii Hiora
85196bfca8 Fixed deprecation warnings on Unicode literals 2014-12-18 11:10:34 +02:00
Valerii Hiora
6746b94f78 iOS: fallout of marker::NoCopy removal 2014-12-18 11:09:43 +02:00
bors
c0b2885ee1 auto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis
r? @nikomatsakis 

We discussed coercions for `if` and `match` expressions. `if` seems to work already, was there some specific behaviour which wasn't working?
2014-12-18 06:41:59 +00:00
James Miller
5722410f72 Fix logic error and add unreachable after returns 2014-12-18 17:43:50 +13:00
Aaron Turon
9bb5380d80 Stability: tweak rules for trait impls
There is currently no way to specify the stability level for a trait
impl produced by `deriving`. This patch is a stopgap solution that:

* Turns of stability inheritance for trait impls, and
* Uses the stability level of the *trait* if no level is directly
  specified.

That is, manual trait impls may still provide a directly stability
level, but `deriving` will use the level of the trait. While not a
perfect solution, it should be good enough for 1.0 API stabilization, as
we will like *remove* any unwanted impls outright.
2014-12-17 20:40:15 -08:00
James Miller
b4f54f96df Minor fixes 2014-12-18 15:28:34 +13:00
James Miller
9115b319c3 Fix formatting issues 2014-12-18 15:28:34 +13:00
James Miller
fb3e871734 Add some documentation 2014-12-18 15:28:33 +13:00
James Miller
eee209d9e2 Only count nested returns when the outer return is reachable
This narrows the definition of nested returns such that only when the
outer return has a chance of being executed (due to the inner return
being conditional) do we mark the function as having nested returns.

Fixes #19684
2014-12-18 15:28:33 +13:00
Steve Klabnik
11a94f2ac7 remove l10n 2014-12-17 21:00:04 -05:00
bluss
5806519bd4 doc: Small changes to ownership guide.
Disambiguate maximally by using 'and' instead of '&' next to discussion
about references.

As a bonus, fix the spelling of the car too.
2014-12-18 02:01:37 +01:00
Nick Cameron
46eb72453f Propagate coercions through match expressions. 2014-12-18 13:48:05 +13:00
Ken Tossell
cbf80f3a68 Only try to install the doc directory if it exists.
If you configure with `--disable-docs`, the `doc` directory does not get generated, so
`cp -r doc dist/` fails when you `make dist{,-tar-bins,-doc}` or `make install`
2014-12-17 19:24:40 -05:00
Jorge Aparicio
1a996f93c3 Remove wrong &str + String and &[T] + Vec<T> implementations 2014-12-17 19:14:59 -05:00
Jake Goulding
1afa8acca8 Use #[deriving(Copy)] for InvariantLifetime 2014-12-17 19:04:15 -05:00
Jakub Bukaj
62d80df0c9 Add tests for E-needstest issues 2014-12-17 23:00:32 +01:00
bors
22a9f250b5 auto merge of #19958 : alexcrichton/rust/rollup, r=alexcrichton 2014-12-17 21:33:15 +00:00
Alex Crichton
5c98952409 Test fixes and rebase conflicts 2014-12-17 11:50:32 -08:00
Alex Crichton
76fbb5d527 rollup merge of #19947: csouth3/arc-borrowfrom
Closes #19937.
2014-12-17 11:50:31 -08:00
Alex Crichton
7ffbd8bad5 rollup merge of #19943: steveklabnik/doc_std_vec
Random improvements to the `std::vec` docs.
2014-12-17 11:50:31 -08:00
Alex Crichton
cbc3cf7a9e rollup merge of #19942: steveklabnik/doc_std_mem 2014-12-17 11:50:31 -08:00
Alex Crichton
1b9b647b07 rollup merge of #19940: phi-gamma/canonical-master
Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
2014-12-17 11:50:31 -08:00
Alex Crichton
a7bb4795d3 rollup merge of #19935: cgaebel/hashmap-tuple-indexing
r? @Gankro @pczarn
2014-12-17 11:50:31 -08:00
Alex Crichton
42dbee098b rollup merge of #19930: cllns/lowercase-if
On the [guide site](http://doc.rust-lang.org/guide.html#if) I was confused when I got to "5 If". It looked like "5 LF" in lowercase.

Changing the if to lowercase solves this problem. I know titles are all capitalized, but I think it makes sense in this case to keep it lowercase, since `if` is a reserved word. I'd also be open to making it ```    `if`   ``` but I'm not sure how that would look on the site.

Before:
![screen shot 2014-12-16 at 12 58 01](https://cloud.githubusercontent.com/assets/632942/5458866/cb34c006-8523-11e4-89ef-3a3964bcedfc.png)
After:
![screen shot 2014-12-16 at 12 58 14](https://cloud.githubusercontent.com/assets/632942/5458865/cb33c444-8523-11e4-8d95-d377ed583ed6.png)
2014-12-17 11:50:30 -08:00
Alex Crichton
b56d4bf916 rollup merge of #19923: pnkfelix/fix-make-tags.emacs
Fix `make TAGS.emacs`.

@nikomatsakis has been complaining to me about this.  (I had not noticed since I drive `ctags` with a separate script.)

(Suitable for a rollup build.)
2014-12-17 11:50:30 -08:00
Alex Crichton
a02885e167 rollup merge of #19918: pnkfelix/ast-refactor-make-place-in-exprbox-an-option
This is to allow us to migrate away from UnUniq in a followup commit,
and thus unify the code paths related to all forms of `box`.
2014-12-17 11:50:30 -08:00
Alex Crichton
b496adaefb rollup merge of #19912: P1start/fn-formatting
This is to encourage the use of the sugary syntax instead of the `<>` syntax, which will not be usable post-1.0. Rustdoc [still uses the `<>` syntax](https://github.com/rust-lang/rust/issues/19909), so if a rustdoc wizard is looking for something to do, it would be nice to use the parenthetical syntax there as well. (I tried to patch rustdoc as well, but failed…)
2014-12-17 11:50:30 -08:00
Alex Crichton
1b929090ac rollup merge of #19911: mdinger/tuple_tests2
Fixes some tuple indexing deprecation warnings. Didn't test. Don't see how it could fail unless I need to modify a makefile somewhere...

r? @alexcrichton
2014-12-17 11:50:30 -08:00
Alex Crichton
cce3fc043e rollup merge of #19905: AaronFriel/patch-1
Was testing rustup on a very minimal Debian installation and got errors during the install process (error occurred in `install.sh` of the Rust nightly.)

Noticed that Rustup was downloading the i686 nightly instead of x86-64. Installing `file` fixed the problem, and this patch adds the probe to ensure file is installed before attempting to use it.

There may still be an issue with the i686 installation, I did not investigate further.
2014-12-17 11:50:30 -08:00
Alex Crichton
3369b33a20 rollup merge of #19902: alexcrichton/second-pass-mem
This commit stabilizes the `mem` and `default` modules of std.
2014-12-17 11:50:29 -08:00
Alex Crichton
cada943f14 rollup merge of #19895: jbranchaud/add-string-add-doctest 2014-12-17 11:50:29 -08:00
Alex Crichton
1f2a18c7a6 rollup merge of #19893: JacobEdelman/patch-1
FIxed the spelling of the word "specific".
2014-12-17 11:50:29 -08:00
Alex Crichton
4a7757038a rollup merge of #19892: pnkfelix/region-graphviz
Added -Z print-region-graph debugging option; produces graphviz visualization of region inference constraint graph.

Optionally uses environment variables `RUST_REGION_GRAPH=<path_template>` and `RUST_REGION_GRAPH_NODE=<node-id>` to select which file to output to and which AST node to print.
2014-12-17 11:50:29 -08:00
Alex Crichton
56fb9bc7ac rollup merge of #19889: FlaPer87/unboxed-closure
The fix just checks if the bound is `Copy` and returns an `Err` if so.

Closes: #19817

@nikomatsakis r?
2014-12-17 11:50:29 -08:00
Alex Crichton
1a05f956f8 rollup merge of #19887: alexcrichton/serialize-fn-mut
Relax some of the bounds on the decoder methods back to FnMut to help accomodate
some more flavorful variants of decoders which may need to run the closure more
than once when it, for example, attempts to find the first successful enum to
decode.
2014-12-17 11:50:28 -08:00
Alex Crichton
31e21613ee rollup merge of #19885: alexcrichton/char-escape
This changes the `escape_unicode` method on a `char` to use the new style of
unicode escapes in the language.

Closes #19811
Closes #19879
2014-12-17 11:50:28 -08:00