]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoThread native name setting, fix #10302
Vojtech Kral [Wed, 28 Jan 2015 13:01:14 +0000 (14:01 +0100)]
Thread native name setting, fix #10302

9 years agoThread native name setting, fix #10302
Vojtech Kral [Wed, 28 Jan 2015 12:48:27 +0000 (13:48 +0100)]
Thread native name setting, fix #10302

9 years agoThread native name setting, fix #10302
Vojtech Kral [Tue, 27 Jan 2015 15:00:26 +0000 (16:00 +0100)]
Thread native name setting, fix #10302

9 years agoThread native name setting, fix #10302
Vojtech Kral [Tue, 27 Jan 2015 02:38:07 +0000 (03:38 +0100)]
Thread native name setting, fix #10302

9 years agoAuto merge of #21606 - arielb1:clean-cast, r=huonw
bors [Mon, 26 Jan 2015 22:19:44 +0000 (22:19 +0000)]
Auto merge of #21606 - arielb1:clean-cast, r=huonw

This also makes the cast error messages somewhat more uniform.

9 years agoAuto merge of #21617 - alexcrichton:less-quotes, r=nikomatsakis
bors [Mon, 26 Jan 2015 19:44:12 +0000 (19:44 +0000)]
Auto merge of #21617 - alexcrichton:less-quotes, r=nikomatsakis

This ends up propagating all the way out to the output of dep-info which then
makes Cargo think that files are not existent (it thinks the files have quotes
in their name) when they in fact do.

9 years agoAuto merge of #21614 - kvark:typedef, r=huonw
bors [Mon, 26 Jan 2015 15:39:13 +0000 (15:39 +0000)]
Auto merge of #21614 - kvark:typedef, r=huonw

Fixes #21497

I don't know if this can be tested with built-in tests.

9 years agoAuto merge of #21401 - kballard:optimize-shrink-to-fit, r=nikomatsakis
bors [Mon, 26 Jan 2015 13:01:00 +0000 (13:01 +0000)]
Auto merge of #21401 - kballard:optimize-shrink-to-fit, r=nikomatsakis

Don't reallocate when capacity is already equal to length

`Vec::shrink_to_fit()` may be called on vectors that are already the
correct length. Calling out to `reallocate()` in this case is a bad idea
because there is no guarantee that `reallocate()` won't allocate a new
buffer anyway, and based on performance seen in external benchmarks, it
seems likely that it is in fact reallocating a new buffer.

Before:

    test string::tests::bench_exact_size_shrink_to_fit         ... bench:        45 ns/iter (+/- 2)

After:

    test string::tests::bench_exact_size_shrink_to_fit         ... bench:        26 ns/iter (+/- 1)

9 years agoAuto merge of #21610 - sfackler:debug-lint, r=alexcrichton
bors [Mon, 26 Jan 2015 10:26:54 +0000 (10:26 +0000)]
Auto merge of #21610 - sfackler:debug-lint, r=alexcrichton

Closes #20855

r? @alexcrichton

9 years agoAuto merge of #21605 - huonw:omg-muscle-memory, r=eddyb
bors [Mon, 26 Jan 2015 07:49:01 +0000 (07:49 +0000)]
Auto merge of #21605 - huonw:omg-muscle-memory, r=eddyb

I'm beginning to suspect it's impossible to avoid accidentally writing
`#[deriving]` at least once in every program, and it results in
non-intuitive error messages: "Foo doesn't have any method in scope
`clone`" despite there being a `#[deriv...(Clone)]` attribute!

Also, lots of documentation around the internet uses `#[deriving]` so
providing this guidance is very helpful (lots of people ask in #rust
about this error).

9 years agoAuto merge of #21598 - eddyb:there-are-no-boxed-closures, r=brson
bors [Mon, 26 Jan 2015 04:49:37 +0000 (04:49 +0000)]
Auto merge of #21598 - eddyb:there-are-no-boxed-closures, r=brson

9 years agoAdjust most comments and messages to not use "unboxed".
Eduard Burtescu [Sat, 24 Jan 2015 20:15:08 +0000 (22:15 +0200)]
Adjust most comments and messages to not use "unboxed".

9 years agoRemove every mention of "onceness".
Eduard Burtescu [Sat, 24 Jan 2015 20:13:24 +0000 (22:13 +0200)]
Remove every mention of "onceness".

9 years agoRemove dead code related to old closures.
Eduard Burtescu [Sat, 24 Jan 2015 20:06:31 +0000 (22:06 +0200)]
Remove dead code related to old closures.

9 years agolibrustc: remove unused DefUpvar field.
Eduard Burtescu [Sat, 24 Jan 2015 20:04:41 +0000 (22:04 +0200)]
librustc: remove unused DefUpvar field.

9 years agoRemove "unboxed" attribute in code referring to new closures.
Eduard Burtescu [Sat, 24 Jan 2015 20:00:03 +0000 (22:00 +0200)]
Remove "unboxed" attribute in code referring to new closures.

9 years agoAuto merge of #21574 - japaric:walk-projections, r=nikomatsakis
bors [Sun, 25 Jan 2015 23:55:55 +0000 (23:55 +0000)]
Auto merge of #21574 - japaric:walk-projections, r=nikomatsakis

closes #21363

r? @nikomatsakis

9 years agoAuto merge of #21561 - edwardw:deref, r=nikomatsakis
bors [Sun, 25 Jan 2015 21:20:37 +0000 (21:20 +0000)]
Auto merge of #21561 - edwardw:deref, r=nikomatsakis

As part of #20432, upvar checking is now moved out of regionck to its
own pass and before regionck. But regionck has some type resolution of
its own. Without them, now separated upvar checking may be tripped over
by residue `ty_infer`.

Closes #21306

9 years agoAdd a missing fmt::Debug impl lint
Steven Fackler [Sun, 25 Jan 2015 03:23:53 +0000 (19:23 -0800)]
Add a missing fmt::Debug impl lint

Closes #20855

9 years agoAuto merge of #21519 - michaelwoerister:misc, r=eddyb
bors [Sun, 25 Jan 2015 18:46:33 +0000 (18:46 +0000)]
Auto merge of #21519 - michaelwoerister:misc, r=eddyb

Two minor improvements that have been on my TODO list for a while:
* Clang uses a size of `-1` for arrays of unknown size and we should do that too as it will tell LLVM to omit the size information in debuginfo.
* There was no LLDB test case for handling the optimized enum representation introduced by @luqmana. This PR finally adds one.

9 years agoAuto merge of #21518 - Zoxc:asm-err, r=luqmana
bors [Sun, 25 Jan 2015 16:09:48 +0000 (16:09 +0000)]
Auto merge of #21518 - Zoxc:asm-err, r=luqmana

Before:
```
error: invalid operand for inline asm constraint 'i' at line 11
```
Note that 11 is not the line the inline assembly appears in.

After:
```
src/arch/x64/multiboot/bootstrap.rs:203:5: 209:9 error: invalid operand for inline asm constraint 'i'
src/arch/x64/multiboot/bootstrap.rs:203     asm! {
src/arch/x64/multiboot/bootstrap.rs:204         [multiboot => %ecx, mod attsyntax]
src/arch/x64/multiboot/bootstrap.rs:205
src/arch/x64/multiboot/bootstrap.rs:206         ljmp {size_of::<Descriptor>() => %i}, $bootstrap.64
src/arch/x64/multiboot/bootstrap.rs:207     }
src/arch/x64/multiboot/bootstrap.rs:208
                                        ...
error: aborting due to previous error
```

9 years agoAuto merge of #21582 - FlaPer87:rollup, r=brson
bors [Sun, 25 Jan 2015 13:33:18 +0000 (13:33 +0000)]
Auto merge of #21582 - FlaPer87:rollup, r=brson

- Successful merges: #21108, #21445, #21498, #21504, #21532, #21535, #21539, #21540, #21541, #21550, #21560, #21573, #21579
- Failed merges:

9 years agoassert path ends with executable. On Windows the process executable contains the...
Flavio Percoco [Sun, 25 Jan 2015 09:52:55 +0000 (10:52 +0100)]
assert path ends with executable. On Windows the process executable contains the full path

9 years agoAuto merge of #20613 - dgriffen:master, r=alexcrichton
bors [Sun, 25 Jan 2015 10:59:28 +0000 (10:59 +0000)]
Auto merge of #20613 - dgriffen:master, r=alexcrichton

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 agosyntax: Don't put quotes around filenames in codemap
Alex Crichton [Sun, 25 Jan 2015 06:43:11 +0000 (22:43 -0800)]
syntax: Don't put quotes around filenames in codemap

This ends up propagating all the way out to the output of dep-info which then
makes Cargo think that files are not existent (it thinks the files have quotes
in their name) when they in fact do.

9 years agoAssociated types support for deriving::generic::TraitDef
Dzmitry Malyshau [Sun, 25 Jan 2015 05:29:24 +0000 (00:29 -0500)]
Associated types support for deriving::generic::TraitDef

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 agoTell the compiler to tell us that `deriving` is dead.
Huon Wilson [Sat, 24 Jan 2015 23:28:58 +0000 (10:28 +1100)]
Tell the compiler to tell us that `deriving` is dead.

I'm beginning to suspect it's impossible to avoid accidentally writing
`#[deriving]` at least once in every program, and it results in
non-intuitive error messages: "Foo doesn't have any method in scope
`clone`" despite there being a `#[deriv...(Clone)]` attribute!

Also, lots of documentation around the internet uses `#[deriving]` so
providing this guidance is very helpful (lots of people ask in #rust
about this error).

Fixes #21166.

9 years agoCleanup check_cast. Fixes #21554
Ariel Ben-Yehuda [Sat, 24 Jan 2015 23:44:49 +0000 (01:44 +0200)]
Cleanup check_cast. Fixes #21554

This also makes the cast error messages somewhat more uniform.

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 agodon't run pretty-rpass for tests using #![main]
Flavio Percoco [Sat, 24 Jan 2015 14:10:37 +0000 (15:10 +0100)]
don't run pretty-rpass for tests using #![main]

9 years agodebuginfo: Improve DWARF representation of unsized vecs and strings.
Michael Woerister [Thu, 8 Jan 2015 15:50:45 +0000 (16:50 +0100)]
debuginfo: Improve DWARF representation of unsized vecs and strings.

9 years agodebuginfo: Extend option-like-enum test case to contain nested discriminants.
Michael Woerister [Thu, 8 Jan 2015 13:55:13 +0000 (14:55 +0100)]
debuginfo: Extend option-like-enum test case to contain nested discriminants.

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 agoImplement winsize() for unix.
Daniel Griffen [Tue, 6 Jan 2015 05:30:58 +0000 (23:30 -0600)]
Implement winsize() for unix.

9 years agoRollup merge of #21579 - brson:beta, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:42 +0000 (10:42 +0100)]
Rollup merge of #21579 - brson:beta, r=alexcrichton

9 years agoRollup merge of #21573 - japaric:gh19660, r=huonw
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:42 +0000 (10:42 +0100)]
Rollup merge of #21573 - japaric:gh19660, r=huonw

closes #19660

9 years agoRollup merge of #21560 - steveklabnik:remove_discuss_link, r=sanxiyn
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:42 +0000 (10:42 +0100)]
Rollup merge of #21560 - steveklabnik:remove_discuss_link, r=sanxiyn

We've had some new people post questions to Discuss, so this should be removed for now. http://discuss.rust-lang.org/t/did-you-mean-to-point-to-discuss-rust-lang-org-as-a-user-forum/1381

9 years agoRollup merge of #21550 - FlaPer87:fix-compiletest, r=huonw
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:41 +0000 (10:42 +0100)]
Rollup merge of #21550 - FlaPer87:fix-compiletest, r=huonw

9 years agoRollup merge of #21541 - steveklabnik:gh13179, r=huonw
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:41 +0000 (10:42 +0100)]
Rollup merge of #21541 - steveklabnik:gh13179, r=huonw

Fixes #13179

9 years agoRollup merge of #21540 - steveklabnik:gh13082, r=brson
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:41 +0000 (10:42 +0100)]
Rollup merge of #21540 - steveklabnik:gh13082, r=brson

Fixes #13082

r? @brson

9 years agoRollup merge of #21539 - iKevinY:pythonic, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:41 +0000 (10:42 +0100)]
Rollup merge of #21539 - iKevinY:pythonic, r=alexcrichton

Also makes `errorck.py` and `tidy.py` compatible with Python 3.

9 years agoRollup merge of #21535 - steveklabnik:gh19759, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:40 +0000 (10:42 +0100)]
Rollup merge of #21535 - steveklabnik:gh19759, r=alexcrichton

Fixes #19759

I'm not going to bother to do more than this, as it'll end up getting re-done as part of the reference work, but at least it's correct now.

9 years agoRollup merge of #21532 - steveklabnik:gh21531, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:40 +0000 (10:42 +0100)]
Rollup merge of #21532 - steveklabnik:gh21531, r=alexcrichton

Fixes #21531

9 years agoRollup merge of #21504 - blackbeam:has_test_signature_fix, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:40 +0000 (10:42 +0100)]
Rollup merge of #21504 - blackbeam:has_test_signature_fix, r=alexcrichton

Fix for `error: functions used as tests must have signature fn() -> ()` and `error: functions used as benches must have signature `fn(&mut Bencher) -> ()` in case of explicit return type declaration.

9 years agoRollup merge of #21498 - quantheory:master, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:40 +0000 (10:42 +0100)]
Rollup merge of #21498 - quantheory:master, r=alexcrichton

While trying to experiment with changes for some other issues, I noticed that the test for #15149 was failing because I have `/tmp` mounted as `noexec` on my Linux box, and that test tries to run out of a temporary directory. This may not be the most common case, but it's not rare by any means, because executing from a world-writable directory is a security problem. (For this reason, some kernel options/mods such as grsecurity also can prevent this on Linux.) I instead copy the executable to a directory created in the build tree, following the example of the `process-spawn-with-unicode-params` test.

After I made that change, I noticed that I'd made a mistake, but the test was still passing, because the "parent" process was not actually checking the status of the "child" process, meaning that the assertion in the child could never cause the overall test to fail. (I don't know if this has always been the case, or if it has something to do with either Windows or a change in the semantics of `spawn`.) So I fixed the test so that it would fail correctly, then fixed my original mistake so that it would pass again.

The one big problem with this is that I haven't set up any machines of my own so that I can build on Windows, which is the platform this test was targeted at in the first place! That might take a while to address on my end. So I need someone else to check this on Windows.

9 years agoRollup merge of #21445 - P1start:no-implemented, r=nikomatsakis
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:40 +0000 (10:42 +0100)]
Rollup merge of #21445 - P1start:no-implemented, r=nikomatsakis

9 years agoRollup merge of #21108 - steveklabnik:gh16969, r=alexcrichton
Flavio Percoco Premoli [Sat, 24 Jan 2015 09:42:39 +0000 (10:42 +0100)]
Rollup merge of #21108 - steveklabnik:gh16969, r=alexcrichton

Fixes #16969

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 agoFix beta naming
Brian Anderson [Sat, 24 Jan 2015 05:13:35 +0000 (21:13 -0800)]
Fix beta naming

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 agomake `walk_ty` walk over a trait projections
Jorge Aparicio [Sat, 24 Jan 2015 01:05:04 +0000 (20:05 -0500)]
make `walk_ty` walk over a trait projections

closes #21363

9 years agoadd test for issue 19660
Jorge Aparicio [Sat, 24 Jan 2015 00:35:10 +0000 (19:35 -0500)]
add test for issue 19660

closes #19660

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 agoResolve type vars when inferring borrow kinds for upvars
Edward Wang [Fri, 23 Jan 2015 19:13:26 +0000 (03:13 +0800)]
Resolve type vars when inferring borrow kinds for upvars

As part of #20432, upvar checking is now moved out of regionck to its
own pass and before regionck. But regionck has some type resolution of
its own. Without them, now separated upvar checking may be tripped over
by residue `ty_infer`.

Closes #21306

9 years agoremove discuss link from the book
Steve Klabnik [Fri, 23 Jan 2015 18:53:19 +0000 (13:53 -0500)]
remove discuss link from the book

9 years agoRemove lang items from the reference.
Steve Klabnik [Fri, 23 Jan 2015 00:09:59 +0000 (19:09 -0500)]
Remove lang items from the reference.

Fixes #19759

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 agoSoup up 'method syntax' chapter of the Book
Steve Klabnik [Tue, 13 Jan 2015 20:00:49 +0000 (15:00 -0500)]
Soup up 'method syntax' chapter of the Book

Fixes #16969

9 years agoFix compile test for stage0
Flavio Percoco [Fri, 23 Jan 2015 14:21:11 +0000 (15:21 +0100)]
Fix compile test for stage0

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 agoUse a regex to perform license check
Kevin Yap [Fri, 23 Jan 2015 04:40:15 +0000 (20:40 -0800)]
Use a regex to perform license check

9 years agoMake `make tidy` Python scripts more idiomatic
Kevin Yap [Fri, 23 Jan 2015 01:54:49 +0000 (17:54 -0800)]
Make `make tidy` Python scripts more idiomatic

Also makes errorck.py and tidy.py compatible with Python 3.

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 agoCheck for make in configure
Steve Klabnik [Fri, 23 Jan 2015 03:44:43 +0000 (22:44 -0500)]
Check for make in configure

Fixes #13179

9 years agoLanguage tweak in configure
Steve Klabnik [Fri, 23 Jan 2015 03:35:28 +0000 (22:35 -0500)]
Language tweak in configure

Fixes #13082

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 agoAdd a random number string to the end of the issue-15149 test's child directory's...
Sean Patrick Santos [Fri, 23 Jan 2015 01:34:58 +0000 (18:34 -0700)]
Add a random number string to the end of the issue-15149 test's child directory's name, and remove the directory after a successful test.

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 agoremove weird sentence
Steve Klabnik [Thu, 22 Jan 2015 23:59:33 +0000 (18:59 -0500)]
remove weird sentence

Fixes #21531

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.