]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoreference: using periods here is unusual
Tshepang Lekhonkhobe [Thu, 10 Sep 2015 03:48:08 +0000 (05:48 +0200)]
reference: using periods here is unusual

8 years agoAuto merge of #28201 - apasel422:issue-26205, r=nikomatsakis
bors [Fri, 4 Sep 2015 14:16:54 +0000 (14:16 +0000)]
Auto merge of #28201 - apasel422:issue-26205, r=nikomatsakis

Closes #26205.

r? @eddyb

8 years agoAuto merge of #28119 - nagisa:bytesderef, r=alexcrichton
bors [Fri, 4 Sep 2015 12:34:03 +0000 (12:34 +0000)]
Auto merge of #28119 - nagisa:bytesderef, r=alexcrichton

8 years agoAuto merge of #28069 - alexcrichton:rt-atexit, r=brson
bors [Fri, 4 Sep 2015 10:33:42 +0000 (10:33 +0000)]
Auto merge of #28069 - alexcrichton:rt-atexit, r=brson

This adds a call to `rt::cleanup` on `process::exit` to make sure we clean up
after ourselves on the way out from Rust.

Closes #28065

8 years agoAuto merge of #28034 - alexcrichton:new-lines, r=aturon
bors [Fri, 4 Sep 2015 08:50:56 +0000 (08:50 +0000)]
Auto merge of #28034 - alexcrichton:new-lines, r=aturon

This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of
the `str::lines` and `BufRead::lines` iterators. Both iterators now account for
`\r\n` sequences in addition to `\n`, allowing for less surprising behavior
across platforms (especially in the `BufRead` case). Splitting *only* on the
`\n` character can still be achieved with `split('\n')` in both cases.

The `str::lines_any` function is also now deprecated as `str::lines` is a
drop-in replacement for it.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md

Closes #28032

8 years agoAuto merge of #28004 - Diggsey:win-backtrace, r=alexcrichton
bors [Fri, 4 Sep 2015 07:08:17 +0000 (07:08 +0000)]
Auto merge of #28004 - Diggsey:win-backtrace, r=alexcrichton

Technically this could also be used for `windows-msvc` targets, as I believe they have *both* dwarf and pdb debug information, but I haven't enabled it there as it should really use the native windows APIs for that, instead of libbacktrace.

I wasn't exactly sure where I should put "gnu" specific stuff, so tell me if I should structure things differently.

This is still a WIP, and I haven't tested properly to make sure I haven't broken msvc/linux builds yet.

8 years agostd: Account for CRLF in {str, BufRead}::lines
Alex Crichton [Thu, 27 Aug 2015 00:30:45 +0000 (17:30 -0700)]
std: Account for CRLF in {str, BufRead}::lines

This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of
the `str::lines` and `BufRead::lines` iterators. Both iterators now account for
`\r\n` sequences in addition to `\n`, allowing for less surprising behavior
across platforms (especially in the `BufRead` case). Splitting *only* on the
`\n` character can still be achieved with `split('\n')` in both cases.

The `str::lines_any` function is also now deprecated as `str::lines` is a
drop-in replacement for it.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md

Closes #28032

8 years agoAuto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichton
bors [Fri, 4 Sep 2015 05:15:22 +0000 (05:15 +0000)]
Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichton

r? @alexcrichton

8 years agoAuto merge of #28220 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 4 Sep 2015 02:33:44 +0000 (02:33 +0000)]
Auto merge of #28220 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #28167, #28202, #28203, #28204, #28205, #28207, #28208, #28209, #28210, #28212, #28213, #28214, #28215, #28216
- Failed merges:

8 years agoAdd line numbers to windows-gnu backtraces
Diggory Blake [Wed, 26 Aug 2015 00:44:55 +0000 (01:44 +0100)]
Add line numbers to windows-gnu backtraces
Fix formatting
Remove unused imports
Refactor
Fix msvc build
Fix line lengths
Formatting
Enable backtrace tests
Fix using directive on mac
pwd info
Work-around buildbot PWD bug, and fix libbacktrace configuration
Use alternative to `env -u` which is not supported on bitrig
Disable tests on 32-bit windows gnu

8 years agoReapply rust-specific changes to libbacktrace
Tim Cuthbertson [Sat, 11 Apr 2015 12:21:47 +0000 (22:21 +1000)]
Reapply rust-specific changes to libbacktrace

This includes the changes from commits:

 - cd8f31759fd04b9ce9c903fa00cae81dc5bba546
 - fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae

8 years agoUpdate libbacktrace to r227145
Diggory Blake [Tue, 25 Aug 2015 19:01:26 +0000 (20:01 +0100)]
Update libbacktrace to r227145

8 years agoRollup merge of #28216 - christopherdumas:fix_28196, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:10 +0000 (20:10 -0400)]
Rollup merge of #28216 - christopherdumas:fix_28196, r=steveklabnik

This is a docs change suggested in #28196.
r? @steveklabnik

8 years agoRollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:09 +0000 (20:10 -0400)]
Rollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnik

extern_block should be extern_block_item.

extern_block_item is `extern { bunch of fns }`, extern_block is just `bunch of fns`

r? @steveklabnik

8 years agoRollup merge of #28214 - tshepang:word-not-name, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:09 +0000 (20:10 -0400)]
Rollup merge of #28214 - tshepang:word-not-name, r=steveklabnik

Also, add missing comma

8 years agoRollup merge of #28213 - tshepang:replace-comma, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:09 +0000 (20:10 -0400)]
Rollup merge of #28213 - tshepang:replace-comma, r=steveklabnik

8 years agoRollup merge of #28212 - tshepang:rust-is-a-language, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:09 +0000 (20:10 -0400)]
Rollup merge of #28212 - tshepang:rust-is-a-language, r=steveklabnik

8 years agoRollup merge of #28210 - tshepang:typo, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:08 +0000 (20:10 -0400)]
Rollup merge of #28210 - tshepang:typo, r=steveklabnik

8 years agoRollup merge of #28209 - tshepang:must-be-four-spaces, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:08 +0000 (20:10 -0400)]
Rollup merge of #28209 - tshepang:must-be-four-spaces, r=steveklabnik

Also, add trailing commas

8 years agoRollup merge of #28208 - matklad:grammar-whitespace-cleanup, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:08 +0000 (20:10 -0400)]
Rollup merge of #28208 - matklad:grammar-whitespace-cleanup, r=steveklabnik

8 years agoRollup merge of #28207 - tshepang:flow, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:08 +0000 (20:10 -0400)]
Rollup merge of #28207 - tshepang:flow, r=steveklabnik

8 years agoRollup merge of #28205 - matklad:grammar-remove-proc, r=alexcrichton
Steve Klabnik [Fri, 4 Sep 2015 00:10:07 +0000 (20:10 -0400)]
Rollup merge of #28205 - matklad:grammar-remove-proc, r=alexcrichton

As I understand, there are no proc closures in Rust any more. So this pr removes `procedure_type` production. It isn't used anywhere. The `proc` is still a keyword.

r? @steveklabnik
@bors: r+ rollup

8 years agoRollup merge of #28204 - matklad:grammar-duplicate-else-tail, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:07 +0000 (20:10 -0400)]
Rollup merge of #28204 - matklad:grammar-duplicate-else-tail, r=steveklabnik

The rule `else_tail` was duplicated in `if` and `if_let` sections. I guess that this is a mistake.

r? @steveklabnik

8 years agoRollup merge of #28203 - benschulz:book-deref-coercion, r=brson
Steve Klabnik [Fri, 4 Sep 2015 00:10:07 +0000 (20:10 -0400)]
Rollup merge of #28203 - benschulz:book-deref-coercion, r=brson

I have two issues with the section "Deref and method calls" of the book's chapter "Deref coercions".

 - (Minor) It says "In other words, these are the same two things in Rust:", followed by a code block in which no two things seem similar, much less the same. Presumably this sentence made more sense in a previous revision.

 - The next paragraph conflates two concepts which, imho, should kept separate. They are
    - deref coercion, i.e. inserting as many `*` as necessary and
    - implicitly referencing the receiver, i.e. inserting a single `&` to satisfy the method's `self` parameter type.

I appreciate that with the proposed changes the example becomes very contrived, even for a foo-bar-baz one. However, the current exmplanation is just wrong.

8 years agoRollup merge of #28202 - matklad:grammar-loop-labels, r=steveklabnik
Steve Klabnik [Fri, 4 Sep 2015 00:10:07 +0000 (20:10 -0400)]
Rollup merge of #28202 - matklad:grammar-loop-labels, r=steveklabnik

This adds missing `?` marks to productions for loops and break/continue.

It also adds missing option label to while let loop.

Note that '[' foo ']' means grouping in BNF, and '?' is used for possible missing items.

r? @steveklabnik

8 years agoRollup merge of #28167 - petrochenkov:bytelit, r=nikomatsakis
Steve Klabnik [Fri, 4 Sep 2015 00:10:07 +0000 (20:10 -0400)]
Rollup merge of #28167 - petrochenkov:bytelit, r=nikomatsakis

Avoid confusion with binary integer literals and binary operator expressions in libsyntax

8 years agoAuto merge of #27984 - arielb1:misc-assemble-improvements, r=nikomatsakis
bors [Fri, 4 Sep 2015 00:00:09 +0000 (00:00 +0000)]
Auto merge of #27984 - arielb1:misc-assemble-improvements, r=nikomatsakis

this resolves type-variables early in assemble_candidates and
bails out quickly if the self type is an inference variable (which would
fail anyway because of `assemble_candidates_from_projected_tys`).

In both these cases, `assemble_candidates_from_impls` would try to go
over all impls and match them, leading to O(`n*m`) performance. Fixing this
improves rustc type-checking performance by 10%. As type-checking is only
is 5% of compilation, this doesn't impact bootstrap times, but *does*
improve type-error-detection time which is nice.

Crates that have many dependencies and contain significant amounts of
generic functions could see a bigger perf boost. As a microbenchmark,
the crate generated by

```
echo '#![feature(rustc_private)]'
echo 'extern crate rustc_driver;'
for i in {1..1000}; do cat << _EOF_
    pub fn foo$i<T>() {
        let mut v = Vec::new();
        let _w = v.clone();
        v.push("");
    }
_EOF_
done
```

sees performance improve from 7.2 to 1.4 seconds. I imagine many crates
would fall somewhere in-between.

r? @nikomatsakis

8 years agoRemoved incorrect reference from #28196
christopherdumas [Thu, 3 Sep 2015 21:39:34 +0000 (14:39 -0700)]
Removed incorrect reference from #28196

8 years agoreference grammar: fix item definition
Aleksey Kladov [Thu, 3 Sep 2015 21:29:47 +0000 (00:29 +0300)]
reference grammar: fix item definition

extern_block should extern_block_item

8 years agoreference grammar: whitespace cleanup
Aleksey Kladov [Thu, 3 Sep 2015 20:42:33 +0000 (23:42 +0300)]
reference grammar: whitespace cleanup

8 years agobook: it is RwLock, not RWLock
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 20:14:28 +0000 (22:14 +0200)]
book: it is RwLock, not RWLock

8 years agoAuto merge of #28200 - Manishearth:rollup, r=Manishearth
bors [Thu, 3 Sep 2015 20:10:42 +0000 (20:10 +0000)]
Auto merge of #28200 - Manishearth:rollup, r=Manishearth

- Successful merges: #28164, #28170, #28184, #28186, #28187, #28188, #28191, #28193, #28194, #28195
- Failed merges:

8 years agoAdd ptr import (fixup #28187)
Manish Goregaokar [Thu, 3 Sep 2015 18:33:38 +0000 (00:03 +0530)]
Add ptr import (fixup #28187)

8 years agoRollup merge of #28195 - AlisdairO:diagnostics214, r=Manishearth
Manish Goregaokar [Thu, 3 Sep 2015 18:00:38 +0000 (23:30 +0530)]
Rollup merge of #28195 - AlisdairO:diagnostics214, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoRollup merge of #28194 - steveklabnik:add_fixme, r=alexcrichton
Manish Goregaokar [Thu, 3 Sep 2015 18:00:38 +0000 (23:30 +0530)]
Rollup merge of #28194 - steveklabnik:add_fixme, r=alexcrichton

8 years agoRollup merge of #28193 - dhuseby:fixing_bitrig_alloc_crate_tests, r=alexcrichton
Manish Goregaokar [Thu, 3 Sep 2015 18:00:38 +0000 (23:30 +0530)]
Rollup merge of #28193 - dhuseby:fixing_bitrig_alloc_crate_tests, r=alexcrichton

@alexcrichton this will get the bitrig buildbot back to green.

8 years agoRollup merge of #28191 - llogiq:iter, r=Manishearth
Manish Goregaokar [Thu, 3 Sep 2015 18:00:38 +0000 (23:30 +0530)]
Rollup merge of #28191 - llogiq:iter, r=Manishearth

Nothing too big, a few needless returns and a few closures eliminated (the latter may improve performance in some cases, at least compilation should be a bit faster).

8 years agoRollup merge of #28188 - Manishearth:elide-core, r=alexcrichton
Manish Goregaokar [Thu, 3 Sep 2015 18:00:37 +0000 (23:30 +0530)]
Rollup merge of #28188 - Manishearth:elide-core, r=alexcrichton

Makes things more greppable.

This change was made automatically by clippy + bash scripts, though I will run test passes, please review carefully.

8 years agoRollup merge of #28187 - petrochenkov:null, r=aturon
Manish Goregaokar [Thu, 3 Sep 2015 18:00:37 +0000 (23:30 +0530)]
Rollup merge of #28187 - petrochenkov:null, r=aturon

And replace more `0 as *const T`/`0 as *mut T`s with `null()`/`null_mut()`s

I'm not sure what is the general policy about making simple functions `const`, but `null()` and `null_mut()` seem to be good candidates.

8 years agoRollup merge of #28186 - thomas07vt:thomas07vt-patch-trpl-rust-inside-other-languages...
Manish Goregaokar [Thu, 3 Sep 2015 18:00:37 +0000 (23:30 +0530)]
Rollup merge of #28186 - thomas07vt:thomas07vt-patch-trpl-rust-inside-other-languages.md, r=steveklabnik

The embed rust file that we compile prints out 'Thread finished..' messages along with a 'done!' r? @steveklabnik

8 years agoRollup merge of #28184 - xiaochuanyu:patch-1, r=alexcrichton
Manish Goregaokar [Thu, 3 Sep 2015 18:00:37 +0000 (23:30 +0530)]
Rollup merge of #28184 - xiaochuanyu:patch-1, r=alexcrichton

Originally in an example it reads as follows:
```rust
fn inverse<T>() -> T
        // this is using ConvertTo as if it were "ConvertFrom<i32>"
         where i32: ConvertTo<T> {
     42.convert()
 }
```
There was no mention of `ConvertFrom` elsewhere in the page other than in this comment. Is this supposed to be `ConvertTo<i64>` ?
I'm confused by this example.

8 years agodoc: reduce indentation of examples to 4 spaces
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 20:06:23 +0000 (22:06 +0200)]
doc: reduce indentation of examples to 4 spaces

Also, add trailing commas

8 years agobook: improve flow
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 19:54:00 +0000 (21:54 +0200)]
book: improve flow

8 years agobook: Rust is a language, so no need to mention that fact here
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 19:40:19 +0000 (21:40 +0200)]
book: Rust is a language, so no need to mention that fact here

8 years agoreference grammar: remove procedure_type
Aleksey Kladov [Thu, 3 Sep 2015 19:25:47 +0000 (22:25 +0300)]
reference grammar: remove procedure_type

8 years agoreference grammar: remove duplicate else_tail rule
Aleksey Kladov [Thu, 3 Sep 2015 19:19:56 +0000 (22:19 +0300)]
reference grammar: remove duplicate else_tail rule

8 years agoTake method invocation semantics out of chapter on deref coercion.
benshu [Thu, 3 Sep 2015 19:17:59 +0000 (21:17 +0200)]
Take method invocation semantics out of chapter on deref coercion.

8 years agobook: "word" feels more suitable than "name"
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 19:14:01 +0000 (21:14 +0200)]
book: "word" feels more suitable than "name"

Also, add missing comma

8 years agoreference grammar: loop label should be optional
Aleksey Kladov [Thu, 3 Sep 2015 19:13:50 +0000 (22:13 +0300)]
reference grammar: loop label should be optional

This adds missing `?` marks to productions for loops and break/continue.

It also adds missing option label to while let loop

8 years agobook: replace comma with a more suitable character
Tshepang Lekhonkhobe [Thu, 3 Sep 2015 19:05:35 +0000 (21:05 +0200)]
book: replace comma with a more suitable character

8 years agoFix multiple mutable autoderefs with `Box`
Andrew Paseltiner [Thu, 3 Sep 2015 17:10:34 +0000 (13:10 -0400)]
Fix multiple mutable autoderefs with `Box`

Closes #26205.

8 years agoRollup merge of #28164 - AlisdairO:diagnostics329, r=Manishearth
Manish Goregaokar [Thu, 3 Sep 2015 18:00:36 +0000 (23:30 +0530)]
Rollup merge of #28164 - AlisdairO:diagnostics329, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoadd long diagnostics for E0214
Alisdair Owens [Thu, 3 Sep 2015 16:01:50 +0000 (17:01 +0100)]
add long diagnostics for E0214

8 years agoAuto merge of #28192 - Manishearth:lint-hir, r=eddyb
bors [Thu, 3 Sep 2015 15:42:16 +0000 (15:42 +0000)]
Auto merge of #28192 - Manishearth:lint-hir, r=eddyb

LintPass still uses the AST, though there isn't any need to. This makes it hard to move lints to the HIR.

r? @eddyb @nrc

8 years agoMove lints to HIR
Manish Goregaokar [Thu, 3 Sep 2015 13:29:56 +0000 (18:59 +0530)]
Move lints to HIR

8 years agoAdd an issue number to this FIXME
Steve Klabnik [Thu, 3 Sep 2015 15:00:33 +0000 (11:00 -0400)]
Add an issue number to this FIXME

8 years agoFixes #27886 -- bitrig does not use jemalloc (yet)
Dave Huseby [Thu, 3 Sep 2015 14:25:21 +0000 (07:25 -0700)]
Fixes #27886 -- bitrig does not use jemalloc (yet)

8 years agoAuto merge of #28176 - arielb1:fast-index, r=eddyb
bors [Thu, 3 Sep 2015 13:01:03 +0000 (13:01 +0000)]
Auto merge of #28176 - arielb1:fast-index, r=eddyb

r? @eddyb

8 years agotake mapped function by mutable reference
llogiq [Thu, 3 Sep 2015 12:50:06 +0000 (14:50 +0200)]
take mapped function by mutable reference

8 years agoElide lifetimes in libcore
Manish Goregaokar [Thu, 3 Sep 2015 09:49:08 +0000 (15:19 +0530)]
Elide lifetimes in libcore

8 years agoclippy improvements to iterators
llogiq [Thu, 3 Sep 2015 10:35:34 +0000 (12:35 +0200)]
clippy improvements to iterators

8 years agorewrite metadata indexing
Ariel Ben-Yehuda [Wed, 2 Sep 2015 22:22:31 +0000 (01:22 +0300)]
rewrite metadata indexing

this improves the compilation time for small crates by ~20%

8 years agoremove totally useless struct-field index
Ariel Ben-Yehuda [Tue, 1 Sep 2015 17:37:05 +0000 (20:37 +0300)]
remove totally useless struct-field index

8 years agoAdapt the PR for HIR changes
Simonas Kazlauskas [Thu, 3 Sep 2015 08:54:17 +0000 (11:54 +0300)]
Adapt the PR for HIR changes

8 years agoUse consistent terminology for byte string literals
Vadim Petrochenkov [Thu, 3 Sep 2015 07:54:53 +0000 (10:54 +0300)]
Use consistent terminology for byte string literals
Avoid confusion with binary integer literals and binary operator expressions in libsyntax

8 years agoUse `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`
Vadim Petrochenkov [Thu, 3 Sep 2015 06:49:50 +0000 (09:49 +0300)]
Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`

8 years agoBash output fix to match real 'ruby embed.rb' call
John Thomas [Thu, 3 Sep 2015 06:13:56 +0000 (23:13 -0700)]
Bash output fix to match real 'ruby embed.rb' call

The embed rust file that we compile prints out 'Thread finished..' messages along with a 'done!'

8 years agoMake `null()` and `null_mut()` const functions
Vadim Petrochenkov [Wed, 2 Sep 2015 19:06:04 +0000 (22:06 +0300)]
Make `null()` and `null_mut()` const functions

8 years agoFix mistake in trait.md
Xiao Chuan Yu [Thu, 3 Sep 2015 05:23:00 +0000 (01:23 -0400)]
Fix mistake in trait.md

8 years agoAuto merge of #28182 - jackwilsonv:patch-2, r=steveklabnik
bors [Thu, 3 Sep 2015 04:43:40 +0000 (04:43 +0000)]
Auto merge of #28182 - jackwilsonv:patch-2, r=steveklabnik

r? @steveklabnik

##### About the `struct` section specifically:
I wasn't sure how you'd feel about the first instance since it was originally capitalized, happy to change it back if you think that's better.

Also, I left 'tuple struct' as is since together it isn't a keyword. The first instance currently has single quotes but the others have nothing. I think that feels right.

##### Generally:
I'm working through the book now and I'm happy to keep updating this branch with any formatting tweaks or updates I find if that's easier for you guys, otherwise I'll just create smaller PRs as I go. Just let me know.

8 years agoAuto merge of #28174 - steveklabnik:gh14705, r=alexcricton
bors [Thu, 3 Sep 2015 02:12:21 +0000 (02:12 +0000)]
Auto merge of #28174 - steveklabnik:gh14705, r=alexcricton

Because 'doc' is a directory, when running `make doc`, you'll see
this:

    make: Nothing to be done for `doc'.

By adding a target for `doc` to build `docs`, both work.

Fixes #14705

8 years agoIntroduce 'make doc' -> 'make docs'
Steve Klabnik [Wed, 2 Sep 2015 22:03:17 +0000 (18:03 -0400)]
Introduce 'make doc' -> 'make docs'

Because 'doc' is a directory, when running `make doc`, you'll see
this:

    make: Nothing to be done for `doc'.

By adding a target for `doc` to build `docs`, both work.

Fixes #14705

8 years agoMakes formatting of struct keyword consistent
Jack Wilson [Thu, 3 Sep 2015 01:58:18 +0000 (18:58 -0700)]
Makes formatting of struct keyword consistent

8 years agoFix hygienic-label-x tests
Simonas Kazlauskas [Wed, 2 Sep 2015 21:03:38 +0000 (00:03 +0300)]
Fix hygienic-label-x tests

8 years agoFix #28105 test and add a test for #28109
Simonas Kazlauskas [Wed, 2 Sep 2015 19:35:04 +0000 (22:35 +0300)]
Fix #28105 test and add a test for #28109

8 years agoUse proper span for break and continue labels
Simonas Kazlauskas [Wed, 2 Sep 2015 19:29:41 +0000 (22:29 +0300)]
Use proper span for break and continue labels

Fixes #28109

8 years agostd: Run at_exit cleanup on process::exit
Alex Crichton [Fri, 28 Aug 2015 17:50:16 +0000 (10:50 -0700)]
std: Run at_exit cleanup on process::exit

This adds a call to `rt::cleanup` on `process::exit` to make sure we clean up
after ourselves on the way out from Rust.

Closes #28065

8 years agoAuto merge of #28138 - nrc:hir, r=nikomatsakis
bors [Wed, 2 Sep 2015 22:44:25 +0000 (22:44 +0000)]
Auto merge of #28138 - nrc:hir, r=nikomatsakis

r? @nikomatsakis

Trying to land this first stab, which basically just duplicates the AST. Will file issues for the various things I've got in mind to improve.

8 years agoconsolidate type-variable handling in assemble_candidates
Ariel Ben-Yehuda [Mon, 24 Aug 2015 20:27:00 +0000 (23:27 +0300)]
consolidate type-variable handling in assemble_candidates

this resolves type-variables early in assemble_candidates and
bails out quickly if the self type is an inference variable (which would
fail anyway because of `assemble_candidates_from_projected_tys`).

In both these cases, `assemble_candidates_from_impls` would try to go
over all impls and match them, leading to O(n*m) performance. Fixing this
improves rustc type-checking performance by 10%. As type-checking is only
is 5% of compilation, this doesn't impact bootstrap times, but *does*
improve type-error-detection time which is nice.

Crates that have many dependencies and contain significant amounts of
generic functions could see a bigger perf boost. As a microbenchmark,
the crate generated by

echo '#![feature(rustc_private)]'
echo 'extern crate rustc_driver;'
for i in {1..1000}; do cat << _EOF_
    pub fn foo$i<T>() {
        let mut v = Vec::new();
        let _w = v.clone();
        v.push("");
    }
_EOF_
done

sees performance improve from 7.2 to 1.4 seconds. I imagine many crates
would fall somewhere in-between.

8 years agoAdd an intital HIR and lowering step
Nick Cameron [Fri, 31 Jul 2015 07:04:06 +0000 (00:04 -0700)]
Add an intital HIR and lowering step

8 years agoAuto merge of #28117 - marcusklaas:continue-break, r=alexcrichton
bors [Wed, 2 Sep 2015 21:02:34 +0000 (21:02 +0000)]
Auto merge of #28117 - marcusklaas:continue-break, r=alexcrichton

Fixes https://github.com/rust-lang/rust/issues/28108.

8 years agoAuto merge of #28135 - jackwilsonv:patch-1, r=steveklabnik
bors [Wed, 2 Sep 2015 19:08:18 +0000 (19:08 +0000)]
Auto merge of #28135 - jackwilsonv:patch-1, r=steveklabnik

Small formatting change

r? @steveklabnik

8 years agoFix overly long spans for break and continue
Marcus Klaas [Sun, 30 Aug 2015 22:26:02 +0000 (00:26 +0200)]
Fix overly long spans for break and continue

The spans of break and continue would include the next token.

8 years agoAuto merge of #28165 - mneumann:dragonfly_snapshots, r=alexcrichton
bors [Wed, 2 Sep 2015 17:27:10 +0000 (17:27 +0000)]
Auto merge of #28165 - mneumann:dragonfly_snapshots, r=alexcrichton

@alexcrichton: The snapshot file is here: http://www.ntecs.de/downloads/rust/rust-stage0-2015-08-11-1af31d4-dragonfly-x86_64-08e7dd9d77434b377c0905cc5f8c705b2daf3a0e.tar.bz2.

This is the first part in getting Continuous builds for DragonFly (#16298).

8 years agoAdd snapshot for DragonFly BSD
Michael Neumann [Wed, 2 Sep 2015 16:21:02 +0000 (18:21 +0200)]
Add snapshot for DragonFly BSD

8 years agoAuto merge of #28162 - mneumann:dragonfly_fix_stat, r=alexcrichton
bors [Wed, 2 Sep 2015 14:51:11 +0000 (14:51 +0000)]
Auto merge of #28162 - mneumann:dragonfly_fix_stat, r=alexcrichton

8 years agoAdd long diagnostics for E0329
Alisdair Owens [Wed, 2 Sep 2015 14:35:56 +0000 (15:35 +0100)]
Add long diagnostics for E0329

8 years agoAuto merge of #28163 - llogiq:master, r=Manishearth
bors [Wed, 2 Sep 2015 10:20:41 +0000 (10:20 +0000)]
Auto merge of #28163 - llogiq:master, r=Manishearth

8 years agoImproved libfmt_macros code style with clippy
llogiq [Wed, 2 Sep 2015 10:13:10 +0000 (12:13 +0200)]
Improved libfmt_macros code style with clippy

8 years agoFix compile on DragonFly: Replace unknown uint32_t/in64_t by u32/i64.
Michael Neumann [Wed, 2 Sep 2015 08:57:57 +0000 (10:57 +0200)]
Fix compile on DragonFly: Replace unknown uint32_t/in64_t by u32/i64.

8 years agoAuto merge of #28156 - nagisa:binaryheap-debug, r=Gankro
bors [Wed, 2 Sep 2015 06:37:32 +0000 (06:37 +0000)]
Auto merge of #28156 - nagisa:binaryheap-debug, r=Gankro

r? @Gankro

8 years agoAuto merge of #28155 - vchimishuk:doc-rust-inside-other-languages-tab, r=alexcrichton
bors [Wed, 2 Sep 2015 04:55:37 +0000 (04:55 +0000)]
Auto merge of #28155 - vchimishuk:doc-rust-inside-other-languages-tab, r=alexcrichton

Fixed x variable identation. How it was displayed in Firefox before: http://s16.postimg.org/c9448tn0k/Screenshot_from_2015_09_01_17_35_43.jpg

8 years agoAuto merge of #28149 - jakerr:atomic, r=alexcrichton
bors [Wed, 2 Sep 2015 03:13:43 +0000 (03:13 +0000)]
Auto merge of #28149 - jakerr:atomic, r=alexcrichton

Makes the code agree with the comment: 'value answers "am I locked?"'.

8 years agoAuto merge of #28148 - eefriedman:binary_heap, r=alexcrichton
bors [Wed, 2 Sep 2015 01:33:20 +0000 (01:33 +0000)]
Auto merge of #28148 - eefriedman:binary_heap, r=alexcrichton

8 years agoAuto merge of #28132 - arielb1:uninstantiable, r=nikomatsakis
bors [Tue, 1 Sep 2015 23:51:47 +0000 (23:51 +0000)]
Auto merge of #28132 - arielb1:uninstantiable, r=nikomatsakis

It is *very* easy to bypass, and is a relic of a bygone age where the type-checker was *much* less robust.

Fixes #27497

r? @nikomatsakis

8 years agoAuto merge of #28146 - eefriedman:deque_extras, r=alexcrichton
bors [Tue, 1 Sep 2015 22:07:59 +0000 (22:07 +0000)]
Auto merge of #28146 - eefriedman:deque_extras, r=alexcrichton

8 years agoAuto merge of #28130 - alexcrichton:fix-msvc-static-tls-dtor, r=brson
bors [Tue, 1 Sep 2015 19:34:21 +0000 (19:34 +0000)]
Auto merge of #28130 - alexcrichton:fix-msvc-static-tls-dtor, r=brson

Running TLS destructors for a MSVC Windows binary requires the linker doesn't
elide the `_tls_used` or `__tls_used` symbols (depending on the architecture).
This is currently achieved via a `#[link_args]` hack but this only works for
dynamically linked binaries because the link arguments aren't propagated to
statically linked binaries.

This commit alters the strategy to instead emit a volatile load from those
symbols so LLVM can't elide it, forcing the reference to the symbol to stay
alive as long as the callback function stays alive (which we've made sure of
with the `#[linkage]` attribute).

Closes #28111

8 years agostd: Run TLS destructors in a statically linked binary
Alex Crichton [Mon, 31 Aug 2015 17:28:07 +0000 (10:28 -0700)]
std: Run TLS destructors in a statically linked binary

Running TLS destructors for a MSVC Windows binary requires the linker doesn't
elide the `_tls_used` or `__tls_used` symbols (depending on the architecture).
This is currently achieved via a `#[link_args]` hack but this only works for
dynamically linked binaries because the link arguments aren't propagated to
statically linked binaries.

This commit alters the strategy to instead emit a volatile load from those
symbols so LLVM can't elide it, forcing the reference to the symbol to stay
alive as long as the callback function stays alive (which we've made sure of
with the `#[linkage]` attribute).

Closes #28111

8 years agoAuto merge of #28088 - tbu-:pr_fixed_size_array, r=alexcrichton
bors [Tue, 1 Sep 2015 17:39:33 +0000 (17:39 +0000)]
Auto merge of #28088 - tbu-:pr_fixed_size_array, r=alexcrichton

8 years agoImplement Debug for BinaryHeap
Simonas Kazlauskas [Tue, 1 Sep 2015 17:26:51 +0000 (20:26 +0300)]
Implement Debug for BinaryHeap

Fixes #28154