]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #20373 - huonw:self-call-lint, r=luqmana
bors [Sun, 25 Jan 2015 08:24:47 +0000 (08:24 +0000)]
Auto merge of #20373 - huonw:self-call-lint, r=luqmana

E.g. `fn foo() { foo() }`, or, more subtlely

    impl Foo for Box<Foo+'static> {
        fn bar(&self) {
            self.bar();
        }
    }

The compiler will warn and point out the points where recursion occurs,
if it determines that the function cannot return without calling itself.

Closes #17899.

---

This is highly non-perfect, in particular, my wording above is quite precise, and I have some unresolved questions: This currently will warn about

```rust
fn foo() {
    if bar { loop {} }

    foo()
}
```

even though `foo` may never be called (i.e. our apparent "unconditional" recursion is actually conditional). I don't know if we should handle this case, and ones like it with `panic!()` instead of `loop` (or anything else that "returns" `!`).

However, strictly speaking, it seems to me that changing the above to not warn will require changing

```rust
fn foo() {
    while bar {}
    foo()
}
```

to also not warn since it could be that the `while` is an infinite loop and doesn't ever hit the `foo`.

I'm inclined to think we let these cases warn since true edge cases like the first one seem rare, and if they do occur they seem like they would usually be typos in the function call. (I could imagine someone accidentally having code like `fn foo() { assert!(bar()); foo() /* meant to be boo() */ }` which won't warn if the `loop` case is "fixed".)

(Part of the reason this is unresolved is wanting feedback, part of the reason is I couldn't devise a strategy that worked in all cases.)

---

The name `unconditional_self_calls` is kinda clunky; and this reconstructs the CFG for each function that is linted which may or may not be very expensive, I don't know.

9 years agoAuto merge of #21558 - alexcrichton:result-debug, r=aturon
bors [Sun, 25 Jan 2015 05:50:30 +0000 (05:50 +0000)]
Auto merge of #21558 - alexcrichton:result-debug, r=aturon

This commit relaxes the bound on `Result::unwrap` and `Result::unwrap_err` from
the `Display` trait to the `Debug` trait for generating an error message about
the unwrapping operation.

This commit is a breaking change and any breakage should be mitigated by
ensuring that `Debug` is implemented on the relevant type.

[breaking-change]

9 years agoAuto merge of #21511 - alfie:suffix-cleanup, r=huonw
bors [Sun, 25 Jan 2015 00:49:41 +0000 (00:49 +0000)]
Auto merge of #21511 - alfie:suffix-cleanup, r=huonw

9 years agoMoving away from deprecated i/u suffixes in libcore
Alfie John [Thu, 22 Jan 2015 14:08:56 +0000 (14:08 +0000)]
Moving away from deprecated i/u suffixes in libcore

9 years agoAuto merge of #21452 - bleibig:bison-grammar, r=nikomatsakis
bors [Sat, 24 Jan 2015 22:14:14 +0000 (22:14 +0000)]
Auto merge of #21452 - bleibig:bison-grammar, r=nikomatsakis

This adds a new lexer/parser combo for the entire Rust language can be generated with with flex and bison, taken from my project at https://github.com/bleibig/rust-grammar. There is also a testing script that runs the generated parser with all *.rs files in the repository (except for tests in compile-fail or ones that marked as "ignore-test" or "ignore-lexer-test"). If you have flex and bison installed, you can run these tests using the new "check-grammar" make target.

This does not depend on or interact with the existing testing code in the grammar, which only provides and tests a lexer specification.

OS X users should take note that the version of bison that comes with the Xcode toolchain (2.3) is too old to work with this grammar, they need to download and install version 3.0 or later.

The parser builds up an S-expression-based AST, which can be displayed by giving the "-v" argument to parser-lalr (normally it only gives output on error). It is only a rough approximation of what is parsed and doesn't capture every detail and nuance of the program.

Hopefully this should be sufficient for issue #2234, or at least a good starting point.

9 years agoAuto merge of #21488 - aturon:os-str, r=alexcrichton
bors [Sat, 24 Jan 2015 19:39:52 +0000 (19:39 +0000)]
Auto merge of #21488 - aturon:os-str, r=alexcrichton

Per [RFC 517](https://github.com/rust-lang/rfcs/pull/575/), this commit introduces platform-native strings. The API is essentially as described in the RFC.

The WTF-8 implementation is adapted from @SimonSapin's [implementation](https://github.com/SimonSapin/rust-wtf8). To make this work, some encodign and decoding functionality in `libcore` is now exported in a "raw" fashion reusable for WTF-8. These exports are *not* reexported in `std`, nor are they stable.

9 years agoAdd ffi::OsString and OsStr
Aaron Turon [Wed, 21 Jan 2015 23:55:31 +0000 (15:55 -0800)]
Add ffi::OsString and OsStr

Per [RFC 517](https://github.com/rust-lang/rfcs/pull/575/), this commit
introduces platform-native strings. The API is essentially as described
in the RFC.

The WTF-8 implementation is adapted from @SimonSapin's
[implementation](https://github.com/SimonSapin/rust-wtf8). To make this
work, some encodign and decoding functionality in `libcore` is now
exported in a "raw" fashion reusable for WTF-8. These exports are *not*
reexported in `std`, nor are they stable.

9 years agoAuto merge of #21079 - huonw:chained-cmp-tweaks, r=pnkfelix
bors [Sat, 24 Jan 2015 17:07:43 +0000 (17:07 +0000)]
Auto merge of #21079 - huonw:chained-cmp-tweaks, r=pnkfelix

First commit is mindless groundwork for the second one, to make the spans (arguably) nicer.

### before

```
require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                               ^~
require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                           ^
require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^
require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments.
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^
```

### after

```
require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                      ^~~~~~~~~~~
require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                      ^~~~~~
require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~
require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~
```

9 years agoTweak chained comparison errors.
Huon Wilson [Tue, 13 Jan 2015 04:18:55 +0000 (15:18 +1100)]
Tweak chained comparison errors.

Lower case and give a more precise span: from operator to operator, not
just the last one.

9 years agoAdd the span of the operator itself to ast::BinOp.
Huon Wilson [Tue, 13 Jan 2015 03:24:37 +0000 (14:24 +1100)]
Add the span of the operator itself to ast::BinOp.

9 years agoFix infinite recursion in the compiler.
Huon Wilson [Sat, 24 Jan 2015 13:05:42 +0000 (00:05 +1100)]
Fix infinite recursion in the compiler.

This was detected by the unconditional_recursion lint.

9 years agoAdd a lint to detect unconditional recursion.
Huon Wilson [Wed, 31 Dec 2014 16:06:38 +0000 (03:06 +1100)]
Add a lint to detect unconditional recursion.

E.g. `fn foo() { foo() }`, or, more subtlely

    impl Foo for Box<Foo+'static> {
        fn bar(&self) {
            self.bar();
        }
    }

The compiler will warn and point out the points where recursion occurs,
if it determines that the function cannot return without calling itself.

Closes #17899.

9 years agoAuto merge of #21542 - vadimcn:fix-exported-macro-paths, r=alexcrichton
bors [Sat, 24 Jan 2015 13:04:39 +0000 (13:04 +0000)]
Auto merge of #21542 - vadimcn:fix-exported-macro-paths, r=alexcrichton

... so that `super::foo` gets serialized as `super:: foo`, rather than `super :: foo`.

9 years agoAuto merge of #21537 - tbu-:pr_coretest_fmt, r=alexcrichton
bors [Sat, 24 Jan 2015 07:45:55 +0000 (07:45 +0000)]
Auto merge of #21537 - tbu-:pr_coretest_fmt, r=alexcrichton

r? @alexcrichton

Part of #20792 that wasn't done in your commit.

9 years agoAuto merge of #21458 - alexcrichton:remove-some-code, r=brson
bors [Sat, 24 Jan 2015 05:12:15 +0000 (05:12 +0000)]
Auto merge of #21458 - alexcrichton:remove-some-code, r=brson

The base64 support can be trivially removed (there are no in-tree users) and the regex support is a whopping 4k lines of code to maintain for a few non-critical uses in-tree. This commit migrates all current users in-tree away from regexes to custom matching code.

The most critical application affected by this migration is that the testing framework no longer considers filter arguments as regexes, but rather just a substring matching. It is expected that more featureful testing frameworks can evolve outside of the in-tree libtest version over time which can properly depend on libregex from crates.io.

[breaking-change]

9 years agoregex: Remove in-tree version
Alex Crichton [Tue, 20 Jan 2015 18:45:29 +0000 (10:45 -0800)]
regex: Remove in-tree version

The regex library was largely used for non-critical aspects of the compiler and
various external tooling. The library at this point is duplicated with its
out-of-tree counterpart and as such imposes a bit of a maintenance overhead as
well as compile time hit for the compiler itself.

The last major user of the regex library is the libtest library, using regexes
for filters when running tests. This removal means that the filtering has gone
back to substring matching rather than using regexes.

9 years agoserialize: Remove base64 support
Alex Crichton [Tue, 20 Jan 2015 23:38:50 +0000 (15:38 -0800)]
serialize: Remove base64 support

This is not used in-tree and is available out-of-tree

9 years agoFix tidy.
Vadim Chugunov [Fri, 23 Jan 2015 19:27:16 +0000 (11:27 -0800)]
Fix tidy.

9 years agoStore a method-from-trait's impl in some cases when it is known.
Huon Wilson [Wed, 31 Dec 2014 16:03:14 +0000 (03:03 +1100)]
Store a method-from-trait's impl in some cases when it is known.

This allows one to look at an `ExprMethodCall` `foo.bar()` where `bar`
is a method in some trait and (sometimes) extract the `impl` that `bar`
is defined in, e.g.

    trait Foo {
        fn bar(&self);
    }

    impl Foo for uint { // <A>
        fn bar(&self) {}
    }

    fn main() {
        1u.bar(); // impl_def_id == Some(<A>)
    }

This definitely doesn't handle all cases, but is correct when it is
known, meaning it should only be used for certain linting/heuristic
purposes; no safety analysis.

9 years agostd: Relax Result::unwrap() to Debug
Alex Crichton [Fri, 23 Jan 2015 18:38:50 +0000 (10:38 -0800)]
std: Relax Result::unwrap() to Debug

This commit relaxes the bound on `Result::unwrap` and `Result::unwrap_err` from
the `Display` trait to the `Debug` trait for generating an error message about
the unwrapping operation.

This commit is a breaking change and any breakage should be mitigated by
ensuring that `Debug` is implemented on the relevant type.

[breaking-change]

9 years agoAuto merge of #21503 - ahmedcharles:remove-test-features, r=alexcrichton
bors [Fri, 23 Jan 2015 16:08:14 +0000 (16:08 +0000)]
Auto merge of #21503 - ahmedcharles:remove-test-features, r=alexcrichton

I think this is all of the remaining code to be removed. Let me know if I've missed anything.

Closes #19145

9 years agoAuto merge of #21453 - Stebalien:exactsize, r=alexcrichton
bors [Fri, 23 Jan 2015 12:02:27 +0000 (12:02 +0000)]
Auto merge of #21453 - Stebalien:exactsize, r=alexcrichton

Specifically:
 * Peekable
 * ByRef
 * Skip
 * Take
 * Fuse

Fixes  #20547

9 years agoClean up `isize`, `usize`. Don't bench allocation but formatting.
Tobias Bucher [Fri, 23 Jan 2015 01:08:21 +0000 (02:08 +0100)]
Clean up `isize`, `usize`. Don't bench allocation but formatting.

9 years agoAuto merge of #21382 - tshepang:improve-iter-docs, r=alexcrichton
bors [Fri, 23 Jan 2015 09:26:34 +0000 (09:26 +0000)]
Auto merge of #21382 - tshepang:improve-iter-docs, r=alexcrichton

9 years agoAdded test.
Vadim Chugunov [Fri, 23 Jan 2015 07:05:02 +0000 (23:05 -0800)]
Added test.

9 years agoAuto merge of #21374 - dgrunwald:range-notation-fixes, r=nikomatsakis
bors [Fri, 23 Jan 2015 06:53:09 +0000 (06:53 +0000)]
Auto merge of #21374 - dgrunwald:range-notation-fixes, r=nikomatsakis

This PR is intended as alternative to #20958. It fixes the same grammar inconsistencies, but does not increase the operator precedence of `..`, leaving it at the same level as the assignment operator.
For previous discussion, see #20811 and #20958.

Grammar changes:
* allow `for _ in 1..i {}` (fixes #20241)
* allow `for _ in 1.. {}` as infinite loop
* prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811)

Parser code cleanup:
* remove `RESTRICTION_NO_DOTS`
* make `AS_PREC` const and follow naming convention
* make `min_prec` inclusive

r? nikomatsakis

9 years agoAuto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichton
bors [Fri, 23 Jan 2015 02:53:50 +0000 (02:53 +0000)]
Auto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichton

This pull request add tooltips to most links of sidebar.
The tooltips display "summary line" of items' document.

Some lengthy/annoying raw markdown code are eliminated, such as links and headers.
- `[Rust](http://rust-lang.org)` displays as `Rust` (no URLs)
- `# header` displays as `header` (no `#`s)

Some inline spans, e.g. ``` `code` ``` and ```*emphasis*```, are kept as they are, for better readable.

I've make sure `&` `'` `"` `<` and `>` are properly displayed in tooltips, for example, `&'a Option<T>`.

Online preview: http://liigo.com/tmp/tooltips/std/index.html

@alexcrichton @steveklabnik since you have reviewed my previous ([v1](https://github.com/rust-lang/rust/pull/13014),[v2](https://github.com/rust-lang/rust/pull/16448)) PRs of this serise, which have been closed for technical reasons. Thank you.

9 years agoSuppress space after idents with "ModName" style in serialization of exported macros.
Vadim Chugunov [Fri, 23 Jan 2015 01:34:31 +0000 (17:34 -0800)]
Suppress space after idents with "ModName" style in serialization of exported macros.
Fixes issue #20701

9 years agoAuto merge of #21530 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 23 Jan 2015 00:18:57 +0000 (00:18 +0000)]
Auto merge of #21530 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #21056, #21091, #21217, #21325, #21373, #21450, #21471, #21472, #21477, #21479, #21484, #21496, #21500, #21516, #21517
- Failed merges:

9 years agoiter: miscellaneous improvements
Tshepang Lekhonkhobe [Mon, 19 Jan 2015 00:37:21 +0000 (02:37 +0200)]
iter: miscellaneous improvements

There are doc improvements as well as these conversions:

- int/uint -> isize/usize
- u/i -> us/is

9 years agoRollup merge of #21517 - SeanTAllen:master, r=steveklabnik
Steve Klabnik [Thu, 22 Jan 2015 23:10:01 +0000 (18:10 -0500)]
Rollup merge of #21517 - SeanTAllen:master, r=steveklabnik

Lifetime elision documentation was reference a previously existing function
that doesn't exist. After talking with Steve Klabnik, I confirmed the correct
function to be referenced and updated documentation accordingly.

9 years agoRollup merge of #21516 - steveklabnik:document_box, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:10:00 +0000 (18:10 -0500)]
Rollup merge of #21516 - steveklabnik:document_box, r=alexcrichton

9 years agoRollup merge of #21500 - richo:power-fixups, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:10:00 +0000 (18:10 -0500)]
Rollup merge of #21500 - richo:power-fixups, r=alexcrichton

When I wrote this code, my janky shim to verify the constants didn't
work as intended.

This fixes everything I've run into since merge, which is hopefully
everything.

9 years agoRollup merge of #21496 - ColonelJ:paatch, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:10:00 +0000 (18:10 -0500)]
Rollup merge of #21496 - ColonelJ:paatch, r=alexcrichton

Make compiletest set an environment variable so that on Windows 32-bit test executables containing certain substrings (e.g. 'install', 'setup', 'update', 'patch') are not blocked by UAC's Installer Detection Technology.

9 years agoRollup merge of #21484 - steveklabnik:connect_docs, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:10:00 +0000 (18:10 -0500)]
Rollup merge of #21484 - steveklabnik:connect_docs, r=alexcrichton

9 years agoRollup merge of #21479 - steveklabnik:rustdoc_to_book, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:09:59 +0000 (18:09 -0500)]
Rollup merge of #21479 - steveklabnik:rustdoc_to_book, r=alexcrichton

Fixes #21430

9 years agoRollup merge of #21477 - steveklabnik:gh21440, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:09:59 +0000 (18:09 -0500)]
Rollup merge of #21477 - steveklabnik:gh21440, r=alexcrichton

Fixes #21440"

9 years agoRollup merge of #21472 - steveklabnik:gh21469, r=huonw
Steve Klabnik [Thu, 22 Jan 2015 23:09:59 +0000 (18:09 -0500)]
Rollup merge of #21472 - steveklabnik:gh21469, r=huonw

Fixes #21469.

9 years agoRollup merge of #21471 - michaelwoerister:associated-types, r=alexcrichton
Steve Klabnik [Thu, 22 Jan 2015 23:09:59 +0000 (18:09 -0500)]
Rollup merge of #21471 - michaelwoerister:associated-types, r=alexcrichton

This should fix issue #20797 (but I don't want to close it automatically).
As the actual fix is very small this would be a perfect candidate for a rollup.

9 years agoRollup merge of #21450 - alfie:book2, r=steveklabnik
Steve Klabnik [Thu, 22 Jan 2015 23:09:58 +0000 (18:09 -0500)]
Rollup merge of #21450 - alfie:book2, r=steveklabnik

Compiling won't produce an executable just yet because (as stated in the next
paragraph) there are errors. By removing this sentance, the reader won't get
confused when they expect a successful compile i.e. if they don't read ahead one
paragraph, they are going to be checking their code and wondering why it's not
compiling.

9 years agoRollup merge of #21373 - angst7:pointer_doc_1, r=steveklabnik
Steve Klabnik [Thu, 22 Jan 2015 23:09:58 +0000 (18:09 -0500)]
Rollup merge of #21373 - angst7:pointer_doc_1, r=steveklabnik

Updated incorrect error messages, and removed explicit return statements from example code.

9 years agoRollup merge of #21325 - nagisa:thread-panicking, r=steveklabnik
Steve Klabnik [Thu, 22 Jan 2015 23:09:58 +0000 (18:09 -0500)]
Rollup merge of #21325 - nagisa:thread-panicking, r=steveklabnik

Previous wording wasn’t clear about its actual behaviour. It could be
interpreted as answering either:

* Can current thread panic?
* Is current thread unwinding because of panic?

r? @steveklabnik

9 years agoRollup merge of #21217 - Gankro:docadoca, r=steveklabnik
Steve Klabnik [Thu, 22 Jan 2015 23:09:58 +0000 (18:09 -0500)]
Rollup merge of #21217 - Gankro:docadoca, r=steveklabnik

Not sure on what *exactly* should be said here, but I think this is the most important bit. This PR also establishes conventions for describing performance minimally.

I suggest to describe preformance for individual methods we use a `# Performance` heading. Not sure if we should have

```
# Performance: O(1)
details details
```
or

```
# Performance:
O(1)
details details
```

Since I think most methods don't need discussion, the former seems more resonable. But it's kind of weird to have info "in" the heading.

r? @steveklabnik

9 years agoRollup merge of #21091 - steveklabnik:add_attribute_docs, r=huonw
Steve Klabnik [Thu, 22 Jan 2015 23:09:57 +0000 (18:09 -0500)]
Rollup merge of #21091 - steveklabnik:add_attribute_docs, r=huonw

Fixes #6444

I need some help with the macro docs here, as I couldn't figure it out. @kmcallister @eddyb  or someone else?

9 years agoRollup merge of #21056 - steveklabnik:return_strings, r=sfackler
Steve Klabnik [Thu, 22 Jan 2015 23:09:57 +0000 (18:09 -0500)]
Rollup merge of #21056 - steveklabnik:return_strings, r=sfackler

When we moved over to the book, we lost this.

9 years agoDocument remaining attributes and macros
Steve Klabnik [Tue, 13 Jan 2015 14:38:07 +0000 (09:38 -0500)]
Document remaining attributes and macros

Fixes #6444

9 years agoBeef up docs for Box<T>
Steve Klabnik [Thu, 22 Jan 2015 17:07:23 +0000 (12:07 -0500)]
Beef up docs for Box<T>

9 years agoFix some grammar inconsistencies for the '..' range notation.
Daniel Grunwald [Sun, 18 Jan 2015 20:43:03 +0000 (21:43 +0100)]
Fix some grammar inconsistencies for the '..' range notation.

Grammar changes:
* allow 'for _ in 1..i {}' (fixes #20241)
* allow 'for _ in 1.. {}' as infinite loop
* prevent use of range notation in contexts where only operators of high
  precedence are expected (fixes #20811)

Parser code cleanup:
* remove RESTRICTION_NO_DOTS
* make AS_PREC const and follow naming convention
* make min_prec inclusive

9 years agoReturn the String guide to its former glory.
Steve Klabnik [Mon, 12 Jan 2015 22:36:05 +0000 (17:36 -0500)]
Return the String guide to its former glory.

When we moved over to the book, we lost this.

9 years agoReference correct fn during lifetime ellision
Sean T Allen [Thu, 22 Jan 2015 18:00:15 +0000 (13:00 -0500)]
Reference correct fn during lifetime ellision

9 years agoAuto merge of #21078 - js-ojus:master, r=steveklabnik
bors [Thu, 22 Jan 2015 16:50:17 +0000 (16:50 +0000)]
Auto merge of #21078 - js-ojus:master, r=steveklabnik

* Include an illustration of a function that accepts two closures.

9 years agoAuto merge of #21187 - oli-obk:feature/hint_struct_field_access, r=alexcrichton
bors [Thu, 22 Jan 2015 12:09:02 +0000 (12:09 +0000)]
Auto merge of #21187 - oli-obk:feature/hint_struct_field_access, r=alexcrichton

rebase and fix of #19267

9 years agoRemove remaining stats and boxplot code.
Ahmed Charles [Wed, 21 Jan 2015 12:39:27 +0000 (04:39 -0800)]
Remove remaining stats and boxplot code.

9 years agoMake fmt_metrics() part of the impl.
Ahmed Charles [Wed, 21 Jan 2015 11:09:44 +0000 (03:09 -0800)]
Make fmt_metrics() part of the impl.

9 years agoRemove save() and load().
Ahmed Charles [Wed, 21 Jan 2015 10:31:15 +0000 (02:31 -0800)]
Remove save() and load().

9 years agoCleanup write_run_finish().
Ahmed Charles [Wed, 21 Jan 2015 09:45:24 +0000 (01:45 -0800)]
Cleanup write_run_finish().

9 years agopowerpc: Fix liblibc
Richo Healey [Thu, 22 Jan 2015 04:56:08 +0000 (20:56 -0800)]
powerpc: Fix liblibc

When I wrote this code, my janky shim to verify the constants didn't
work as intended.

This fixes everything I've run into since merge, which is hopefully
everything.

9 years agoAuto merge of #21473 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 22 Jan 2015 06:12:46 +0000 (06:12 +0000)]
Auto merge of #21473 - alexcrichton:rollup, r=alexcrichton

9 years agoMake diagnostic ordering deterministic
Alex Crichton [Wed, 21 Jan 2015 22:32:54 +0000 (14:32 -0800)]
Make diagnostic ordering deterministic

9 years agoMake compiletest set an environment variable so that on Windows 32-bit test executabl...
KernelJ [Thu, 22 Jan 2015 03:41:32 +0000 (03:41 +0000)]
Make compiletest set an environment variable so that on Windows 32-bit test executables containing certain substrings (e.g. 'install', 'setup', 'update', 'patch') are not blocked by UAC's Installer Detection Technology.

9 years agoAdd test cases for ExactSizeIterator impls
Steven Allen [Wed, 21 Jan 2015 21:38:50 +0000 (16:38 -0500)]
Add test cases for ExactSizeIterator impls

ByRef is not tested included because it is a trivial pass through.

9 years agoadd doc examples for connect/concat
Steve Klabnik [Wed, 21 Jan 2015 22:56:33 +0000 (17:56 -0500)]
add doc examples for connect/concat

9 years agoRevert "Use assume to inform the optimiser about refcount invariants"
Alex Crichton [Wed, 21 Jan 2015 21:55:14 +0000 (13:55 -0800)]
Revert "Use assume to inform the optimiser about refcount invariants"

This reverts commit a729a404945de10f99e2530a5c28952996532b29.

9 years agoRevert "Add assumptions that the pointer is non-null"
Alex Crichton [Wed, 21 Jan 2015 21:55:11 +0000 (13:55 -0800)]
Revert "Add assumptions that the pointer is non-null"

This reverts commit 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7.

9 years agoRevert "Add more explanation for why the assumes are there"
Alex Crichton [Wed, 21 Jan 2015 21:55:04 +0000 (13:55 -0800)]
Revert "Add more explanation for why the assumes are there"

This reverts commit a7525bc4c8eb8507a5c248d29286e77133217cf3.

9 years agoMore test fixes and rebase conflicts
Alex Crichton [Wed, 21 Jan 2015 19:56:52 +0000 (11:56 -0800)]
More test fixes and rebase conflicts

9 years agoMove rustdoc.md into the book
Steve Klabnik [Wed, 21 Jan 2015 19:59:25 +0000 (14:59 -0500)]
Move rustdoc.md into the book

Fixes #21430

9 years agorollup merge of #20179: eddyb/blind-items
Alex Crichton [Wed, 21 Jan 2015 19:56:00 +0000 (11:56 -0800)]
rollup merge of #20179: eddyb/blind-items

Conflicts:
src/librustc/diagnostics.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs
src/libsyntax/parse/parser.rs

9 years agoImprove RwLock::new's docs
Steve Klabnik [Wed, 21 Jan 2015 19:54:17 +0000 (14:54 -0500)]
Improve RwLock::new's docs

Fixes #21440"

9 years agorollup merge of #21258: aturon/stab-3-index
Alex Crichton [Wed, 21 Jan 2015 19:53:49 +0000 (11:53 -0800)]
rollup merge of #21258: aturon/stab-3-index

Conflicts:
src/libcore/ops.rs
src/librustc_typeck/astconv.rs
src/libstd/io/mem.rs
src/libsyntax/parse/lexer/mod.rs

9 years agorollup merge of #21252: nikomatsakis/assoc-type-ice-hunt-take-2
Alex Crichton [Wed, 21 Jan 2015 19:51:10 +0000 (11:51 -0800)]
rollup merge of #21252: nikomatsakis/assoc-type-ice-hunt-take-2

Project region bounds out of the trait when deciding whether a projection type outlives a given regions.

Fixes #20890.
Fixes #21150.

9 years agorollup merge of #20642: michaelwoerister/sane-source-locations-pt1
Alex Crichton [Wed, 21 Jan 2015 19:50:34 +0000 (11:50 -0800)]
rollup merge of #20642: michaelwoerister/sane-source-locations-pt1

Conflicts:
src/librustc_trans/trans/debuginfo.rs

9 years agoMove regression test for #20971 into run-fail, since it panics.
Niko Matsakis [Wed, 21 Jan 2015 19:35:41 +0000 (14:35 -0500)]
Move regression test for #20971 into run-fail, since it panics.

9 years agoFix type inference problems in tests and docs
Aaron Turon [Wed, 21 Jan 2015 19:16:00 +0000 (11:16 -0800)]
Fix type inference problems in tests and docs

9 years agoTest fixes and rebase conflicts
Alex Crichton [Wed, 21 Jan 2015 17:23:27 +0000 (09:23 -0800)]
Test fixes and rebase conflicts

9 years agoDeny imports after non-item statements.
Eduard Burtescu [Tue, 13 Jan 2015 09:39:05 +0000 (11:39 +0200)]
Deny imports after non-item statements.

9 years agoAdded another test with success local-item shadowing
Eduard Burtescu [Tue, 13 Jan 2015 08:11:34 +0000 (10:11 +0200)]
Added another test with success local-item shadowing

9 years agoAdded some tests for arbitrary ordered view items
Marvin Löbel [Fri, 2 Jan 2015 00:13:57 +0000 (01:13 +0100)]
Added some tests for arbitrary ordered view items

9 years agotests: fix fallout of merging ast::ViewItem into ast::Item.
Eduard Burtescu [Fri, 26 Dec 2014 21:36:21 +0000 (23:36 +0200)]
tests: fix fallout of merging ast::ViewItem into ast::Item.

9 years agoExplain that RefCell is single-threaded.
Steve Klabnik [Wed, 21 Jan 2015 17:43:34 +0000 (12:43 -0500)]
Explain that RefCell is single-threaded.

Fixes #21469.

9 years agodebuginfo: Fix issue with associated types and struct fields
Michael Woerister [Wed, 21 Jan 2015 16:10:02 +0000 (17:10 +0100)]
debuginfo: Fix issue with associated types and struct fields

9 years agorollup merge of #21463: sanxiyn/demut
Alex Crichton [Wed, 21 Jan 2015 17:21:09 +0000 (09:21 -0800)]
rollup merge of #21463: sanxiyn/demut

9 years agorollup merge of #21462: ahmedcharles/remove-ratchet
Alex Crichton [Wed, 21 Jan 2015 17:21:06 +0000 (09:21 -0800)]
rollup merge of #21462: ahmedcharles/remove-ratchet

Conflicts:
src/libtest/lib.rs

9 years agorollup merge of #21457: alexcrichton/issue-21436
Alex Crichton [Wed, 21 Jan 2015 17:20:35 +0000 (09:20 -0800)]
rollup merge of #21457: alexcrichton/issue-21436

Conflicts:
src/liballoc/boxed.rs
src/librustc/middle/traits/error_reporting.rs
src/libstd/sync/mpsc/mod.rs

9 years agorollup merge of #21447: cmr/master
Alex Crichton [Wed, 21 Jan 2015 17:19:03 +0000 (09:19 -0800)]
rollup merge of #21447: cmr/master

Closes #13971

9 years agorollup merge of #21446: stepancheg/boxed-test
Alex Crichton [Wed, 21 Jan 2015 17:18:56 +0000 (09:18 -0800)]
rollup merge of #21446: stepancheg/boxed-test

Conflicts:
src/liballoc/boxed.rs

9 years agorollup merge of #21444: petrochenkov/null
Alex Crichton [Wed, 21 Jan 2015 17:18:07 +0000 (09:18 -0800)]
rollup merge of #21444: petrochenkov/null

Conflicts:
src/libstd/sync/mpsc/select.rs

9 years agorollup merge of #21441: alexcrichton/rustc-opts
Alex Crichton [Wed, 21 Jan 2015 17:17:43 +0000 (09:17 -0800)]
rollup merge of #21441: alexcrichton/rustc-opts

This is a bit of cleanup work to clean out some old deprecated flags and deprecated lint names from the compiler (they've been deprecated for quite awhile now).

This also notably puts `--pretty` behind the `-Z unstable-options` flag (where it was supposed to be previously).

9 years agorollup merge of #21438: taralx/kill-racycell
Alex Crichton [Wed, 21 Jan 2015 17:17:40 +0000 (09:17 -0800)]
rollup merge of #21438: taralx/kill-racycell

Conflicts:
src/libstd/sync/mpsc/mod.rs

9 years agorollup merge of #21437: FlaPer87/snapshot
Alex Crichton [Wed, 21 Jan 2015 17:16:40 +0000 (09:16 -0800)]
rollup merge of #21437: FlaPer87/snapshot

r? @alexcrichton

9 years agorollup merge of #21433: alfie/typobook
Alex Crichton [Wed, 21 Jan 2015 17:16:38 +0000 (09:16 -0800)]
rollup merge of #21433: alfie/typobook

Tiny fix

9 years agorollup merge of #21429: GuillaumeGomez/macro-fix
Alex Crichton [Wed, 21 Jan 2015 17:16:37 +0000 (09:16 -0800)]
rollup merge of #21429: GuillaumeGomez/macro-fix

This is little clean code of this PR: #21366. I patched the same thing as aochagavia but too slowly obviously. This is a merge of our two codes, more "rust-like".

9 years agorollup merge of #21423: oli-obk/prettier_read_until
Alex Crichton [Wed, 21 Jan 2015 17:16:33 +0000 (09:16 -0800)]
rollup merge of #21423: oli-obk/prettier_read_until

Conflicts:
src/libstd/io/mod.rs

9 years agorollup merge of #21421: huonw/one-suggestion-per-trait
Alex Crichton [Wed, 21 Jan 2015 17:16:05 +0000 (09:16 -0800)]
rollup merge of #21421: huonw/one-suggestion-per-trait

This is clearly useless, the user doesn't need to know that they could
implement/import `foo::bar::Baz` 4 times.

Fixes #21405.

9 years agorollup merge of #21419: Toby-S/patch-1
Alex Crichton [Wed, 21 Jan 2015 17:16:03 +0000 (09:16 -0800)]
rollup merge of #21419: Toby-S/patch-1

This just corrects a couple of typos in doc comments, and changes some to conform to the Rust guidelines.

9 years agorollup merge of #21418: Aatch/assume-refcount
Alex Crichton [Wed, 21 Jan 2015 17:16:01 +0000 (09:16 -0800)]
rollup merge of #21418: Aatch/assume-refcount

The reference count can never be 0, unless we're about to drop the data
completely. Using the `assume` intrinsic allows us to inform LLVM about
that invariant, meaning it can avoid unnecessary drops.

---

Before and after IR: https://gist.github.com/Aatch/3786d20df2edaad6a0e8

Generated from the example in #13018

Fixes #13018

9 years agorollup merge of #21414: ejjeong/aarch64-linux-android
Alex Crichton [Wed, 21 Jan 2015 17:15:59 +0000 (09:15 -0800)]
rollup merge of #21414: ejjeong/aarch64-linux-android

Initial support for aarch64-linux-android (#18920)
- Add new configuration files
- Modify some options to compile & link succesfully.
  (PIE, disable tls on jemalloc, modify some external function linkage, ..)
- To build, refer to https://github.com/rust-lang/rust/wiki/Doc-building-for-android.
   (tested with platform=21 and toolchain=aarch64-linux-android-4.9)

9 years agorollup merge of #21413: ahmedcharles/remove-test-features
Alex Crichton [Wed, 21 Jan 2015 17:15:57 +0000 (09:15 -0800)]
rollup merge of #21413: ahmedcharles/remove-test-features

This isn't the entire set of changes, there are more coming. #19145

9 years agorollup merge of #21411: P1start/help-tweaks
Alex Crichton [Wed, 21 Jan 2015 17:15:54 +0000 (09:15 -0800)]
rollup merge of #21411: P1start/help-tweaks

Conflicts:
src/librustc_typeck/check/closure.rs

9 years agorollup merge of #21396: japaric/no-parens-in-range
Alex Crichton [Wed, 21 Jan 2015 17:15:15 +0000 (09:15 -0800)]
rollup merge of #21396: japaric/no-parens-in-range

Conflicts:
src/libsyntax/parse/lexer/comments.rs