]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #29582 - oli-obk:token_tree, r=sfackler
bors [Fri, 6 Nov 2015 21:11:06 +0000 (21:11 +0000)]
Auto merge of #29582 - oli-obk:token_tree, r=sfackler

8 years agoAuto merge of #29657 - defuz:patch-2, r=steveklabnik
bors [Fri, 6 Nov 2015 16:42:03 +0000 (16:42 +0000)]
Auto merge of #29657 - defuz:patch-2, r=steveklabnik

r? @steveklabnik

8 years agoAuto merge of #29643 - petrochenkov:stability5, r=alexcrichton
bors [Fri, 6 Nov 2015 14:57:41 +0000 (14:57 +0000)]
Auto merge of #29643 - petrochenkov:stability5, r=alexcrichton

Also remove `stable` stability annotations from inherent impls

(There will be a warning for useless stability annotations soon.)

r? @Gankro

8 years agoremove `Tt` prefix from TokenType variants
Oliver Schneider [Fri, 6 Nov 2015 13:52:02 +0000 (14:52 +0100)]
remove `Tt` prefix from TokenType variants

[breaking change]

8 years agoAuto merge of #29620 - petrochenkov:reachable2, r=alexcrichton
bors [Fri, 6 Nov 2015 13:13:08 +0000 (13:13 +0000)]
Auto merge of #29620 - petrochenkov:reachable2, r=alexcrichton

Handle them in `middle::reachable` instead (no optimizations so far, just drop all trait impl items into the reachable set, as before). Addresses the concerns from https://github.com/rust-lang/rust/pull/29291#discussion_r43672413
\+ In `middle::reachable` don't treat impls of `Drop` specially, they are subsumed by the general impl treatment.
\+ Add some tests checking reachability of trait methods written in UFCS form
\+ Minor refactoring in the second commit

r? @alexcrichton

8 years agoOpps, fix incorrect call
Ivan Ivaschenko [Fri, 6 Nov 2015 11:52:17 +0000 (13:52 +0200)]
Opps, fix incorrect call

8 years agoRename me in AUTHORS.txt
Ivan Ivaschenko [Fri, 6 Nov 2015 11:48:24 +0000 (13:48 +0200)]
Rename me in AUTHORS.txt

8 years agoRemoving the hack from error handling chapter, which is does not make sense anymore.
Ivan Ivaschenko [Fri, 6 Nov 2015 11:44:42 +0000 (13:44 +0200)]
Removing the hack from error handling chapter, which is does not make sense anymore.

8 years agoAuto merge of #29615 - steveklabnik:lol_strings, r=alexcrichton
bors [Fri, 6 Nov 2015 11:28:07 +0000 (11:28 +0000)]
Auto merge of #29615 - steveklabnik:lol_strings, r=alexcrichton

&format!("...") is the same as "" if we're not doing any interpolation,
and doesn't allocate an intermediate String.

8 years agoAuto merge of #29604 - bstrie:de_ms, r=alexcrichton
bors [Fri, 6 Nov 2015 09:42:17 +0000 (09:42 +0000)]
Auto merge of #29604 - bstrie:de_ms, r=alexcrichton

8 years agoAuto merge of #29600 - Ryman:rustdoc_better_testnames, r=alexcrichton
bors [Fri, 6 Nov 2015 07:58:27 +0000 (07:58 +0000)]
Auto merge of #29600 - Ryman:rustdoc_better_testnames, r=alexcrichton

Old doctest names
```bash
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
```

New doctest names
```bash
test sync::atomic::AtomicBool::load_0 ... ok
test sync::atomic::AtomicIsize::load_0 ... ok
test sync::atomic::AtomicPtr<T>::load_0 ... ok
test sync::atomic::AtomicUsize::load_0 ... ok
```

8 years agoAuto merge of #29588 - nikomatsakis:mir-switch, r=aatch
bors [Fri, 6 Nov 2015 06:13:59 +0000 (06:13 +0000)]
Auto merge of #29588 - nikomatsakis:mir-switch, r=aatch

Introduce a `SwitchInt` and restructure pattern matching to collect integers and characters into one master switch. This is aimed at #29227, but is not a complete fix. Whereas before we generated an if-else-if chain and, at least on my machine, just failed to compile, we now spend ~9sec compiling `rustc_abuse`. AFAICT this is basically just due to a need for more micro-optimization of the matching process: perf shows a fair amount of time just spent iterating over the candidate list. Still, it seemed worth opening a PR with this step alone, since it's a big step forward.

8 years agoAuto merge of #29491 - alexcrichton:avoid-stdio-tls, r=brson
bors [Fri, 6 Nov 2015 04:29:11 +0000 (04:29 +0000)]
Auto merge of #29491 - alexcrichton:avoid-stdio-tls, r=brson

Currently if a print happens while a thread is being torn down it may cause a
panic if the LOCAL_STDOUT TLS slot has been destroyed by that point. This adds a
guard to check and prints to the process stdout if that's the case (as we do for
if the slot is already borrowed).

Closes #29488

8 years agoAuto merge of #29653 - alexcrichton:fix-distcheck-again-zomg, r=brson
bors [Fri, 6 Nov 2015 02:41:20 +0000 (02:41 +0000)]
Auto merge of #29653 - alexcrichton:fix-distcheck-again-zomg, r=brson

The recent change of libdir on windows was accidentally not propagated to
`make dist` and related commands. This commit touches that up!

Closes #29640

8 years agoAuto merge of #29305 - alexcrichton:bad-getenv, r=brson
bors [Fri, 6 Nov 2015 00:56:08 +0000 (00:56 +0000)]
Auto merge of #29305 - alexcrichton:bad-getenv, r=brson

As discovered in #29298, `env::set_var("", "")` will panic, but it turns out
that it *also* deadlocks on Unix systems. This happens because if a panic
happens while holding the environment lock, we then go try to read
RUST_BACKTRACE, grabbing the environment lock, causing a deadlock.

Specifically, the changes made here are:

* The environment lock is pushed into `std::sys` instead of `std::env`. This
  also only puts it in the Unix implementation, not Windows where the functions
  are already threadsafe.
* The `std::sys` implementation now returns `io::Result` so panics are
  explicitly at the `std::env` level.

8 years agomk: Account for libdir change on windows
Alex Crichton [Fri, 6 Nov 2015 00:06:25 +0000 (16:06 -0800)]
mk: Account for libdir change on windows

The recent change of libdir on windows was accidentally not propagated to
`make dist` and related commands. This commit touches that up!

Closes #29640

8 years agolibrustdoc: improve testnames for doctests
Kevin Butler [Wed, 4 Nov 2015 23:41:33 +0000 (23:41 +0000)]
librustdoc: improve testnames for doctests

8 years agoAuto merge of #29648 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 5 Nov 2015 21:51:29 +0000 (21:51 +0000)]
Auto merge of #29648 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29609, #29611, #29613, #29614, #29619, #29624, #29630
- Failed merges:

8 years agoRollup merge of #29630 - apasel422:marker, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:50 +0000 (22:28 +0100)]
Rollup merge of #29630 - apasel422:marker, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #29624 - rilut:patch-1, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29624 - rilut:patch-1, r=steveklabnik

Thanks.
r? @steveklabnik

8 years agoRollup merge of #29619 - steveklabnik:gh28824, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29619 - steveklabnik:gh28824, r=alexcrichton

Fixes #28824

8 years agoRollup merge of #29614 - bluss:vec-drop-comment, r=Gankro
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29614 - bluss:vec-drop-comment, r=Gankro

vec: Remove old comment in Vec::drop

This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.

8 years agoRollup merge of #29613 - steveklabnik:29506, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29613 - steveklabnik:29506, r=alexcrichton

in favor of just expect()

Fixes #29506

8 years agoRollup merge of #29611 - steveklabnik:gh25918, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29611 - steveklabnik:gh25918, r=alexcrichton

Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918

8 years agoRollup merge of #29609 - ivan:rustdoc-ctrl-s, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:48 +0000 (22:28 +0100)]
Rollup merge of #29609 - ivan:rustdoc-ctrl-s, r=steveklabnik

Rustdoc pages with a search box inadvertently override `ctrl-s` in addition to the intended `s` and `S` keys.  You can test this in at least Firefox and Chrome (tested: Windows): press `ctrl-s` on http://doc.rust-lang.org/std/.  The search box is focused when instead the browser's save feature should be activated.  This PR fixes `ctrl-s` and possibly other browser shortcuts.

8 years agoRemove stability annotations from trait impl items
Vadim Petrochenkov [Thu, 5 Nov 2015 21:13:46 +0000 (00:13 +0300)]
Remove stability annotations from trait impl items

Remove `stable` stability annotations from inherent impls

8 years agoAuto merge of #29583 - dotdash:mir_small_agg, r=nikomatsakis
bors [Thu, 5 Nov 2015 20:06:13 +0000 (20:06 +0000)]
Auto merge of #29583 - dotdash:mir_small_agg, r=nikomatsakis

Fix handling of small aggregate function arguments and assignments of temporaries to lvalues.

8 years agoTidy `core::marker` doc summaries
Andrew Paseltiner [Thu, 5 Nov 2015 18:29:46 +0000 (13:29 -0500)]
Tidy `core::marker` doc summaries

8 years agoAuto merge of #29565 - sfackler:issue-29540, r=huonw
bors [Thu, 5 Nov 2015 18:15:26 +0000 (18:15 +0000)]
Auto merge of #29565 - sfackler:issue-29540, r=huonw

Closes #29540

r? @huonw

8 years agodoc(lib.rs): fix #L79 with inline link syntax
Rizky Luthfianto [Thu, 5 Nov 2015 17:15:32 +0000 (00:15 +0700)]
doc(lib.rs): fix #L79 with inline link syntax

8 years agoConvert TODO into FIXME
Niko Matsakis [Thu, 5 Nov 2015 16:54:24 +0000 (11:54 -0500)]
Convert TODO into FIXME

8 years agoAuto merge of #29593 - ben0x539:reflect-doc-comment, r=steveklabnik
bors [Thu, 5 Nov 2015 16:29:07 +0000 (16:29 +0000)]
Auto merge of #29593 - ben0x539:reflect-doc-comment, r=steveklabnik

Rustdoc takes the first paragraph as a summary, so having a huge
paragraph that ends with introducing an example looked somewhat wrong on
the module page.

8 years agoBeef up macro designator docs
Steve Klabnik [Thu, 5 Nov 2015 15:46:56 +0000 (16:46 +0100)]
Beef up macro designator docs

Fixes #28824

8 years ago`EmbargoVisitor::reexports` isn't needed
Vadim Petrochenkov [Thu, 5 Nov 2015 15:42:48 +0000 (18:42 +0300)]
`EmbargoVisitor::reexports` isn't needed

8 years agoFix handling of fat pointer function arguments
Björn Steinbrink [Thu, 5 Nov 2015 15:18:45 +0000 (16:18 +0100)]
Fix handling of fat pointer function arguments

The store for the "extra" data went to the wrong destination.

8 years agorustc_privacy: Do not export items needed solely for the reachability analysis
Vadim Petrochenkov [Thu, 5 Nov 2015 15:17:33 +0000 (18:17 +0300)]
rustc_privacy: Do not export items needed solely for the reachability analysis

Process them in middle::reachable instead
Add tests for reachability of trait methods written in UFCS form

8 years agoremove excess string allocation
Steve Klabnik [Thu, 5 Nov 2015 14:30:32 +0000 (15:30 +0100)]
remove excess string allocation

&format!("...") is the same as "" if we're not doing any interpolation,
and doesn't allocate an intermediate String.

8 years agovec: Remove old comment in Vec::drop
Ulrik Sverdrup [Thu, 5 Nov 2015 13:37:45 +0000 (14:37 +0100)]
vec: Remove old comment in Vec::drop

This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.

8 years agoRemove .ok().expect()
Steve Klabnik [Thu, 5 Nov 2015 13:40:50 +0000 (14:40 +0100)]
Remove .ok().expect()

in favor of just expect()

Fixes #29506

8 years agoRemove short intro from README
Steve Klabnik [Thu, 5 Nov 2015 13:04:39 +0000 (14:04 +0100)]
Remove short intro from README

Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918

8 years agoAuto merge of #29610 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 5 Nov 2015 12:49:44 +0000 (12:49 +0000)]
Auto merge of #29610 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29416, #29537, #29538, #29539, #29567, #29568, #29571, #29579
- Failed merges:

8 years agodocs for Reflect: blank line after first sentence
Benjamin Herr [Wed, 4 Nov 2015 22:37:27 +0000 (23:37 +0100)]
docs for Reflect: blank line after first sentence

Rustdoc takes the first paragraph as a summary, so having a huge
paragraph that ends with introducing an example looked somewhat wrong on
the module page.

8 years agoRollup merge of #29579 - steveklabnik:gh27322, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:03 +0000 (12:43 +0100)]
Rollup merge of #29579 - steveklabnik:gh27322, r=apasel422

Fixes #27322

8 years agoRollup merge of #29571 - steveklabnik:gh29322, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:03 +0000 (12:43 +0100)]
Rollup merge of #29571 - steveklabnik:gh29322, r=apasel422

Fixes #29322

8 years agoRollup merge of #29568 - steveklabnik:gh24591, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29568 - steveklabnik:gh24591, r=apasel422

Fixes #24591

8 years agoRollup merge of #29567 - Toby-S:patch-1, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29567 - Toby-S:patch-1, r=steveklabnik

Reword "Writing the logic" paragraph to prevent `unwrap` being confused for a macro (and other small changes to improve the flow of the paragraph).

cc @steveklabnik

8 years agoRollup merge of #29539 - shepmaster:empty-iterator-docs, r=Gankro
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29539 - shepmaster:empty-iterator-docs, r=Gankro

8 years agoRollup merge of #29538 - steveklabnik:ch1_edits, r=brson
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29538 - steveklabnik:ch1_edits, r=brson

I did some preliminary editing work with No Starch on the first chapter of the book, and here's some of the results. We're going to want to return to this later when @brson etc's new rustup work is done, so this is mostly just a first pass.

But, we agreed that having separate chapters for each of this bit of intro is a bit excessive. So let's move all of this intro stuff into one chapter.

I'd appreciate a careful review of this, as there was also some confusion about some things, which resulted in me taking one huge markdown file apart and splitting it back up, as well as some editor issues, so I _think_ this looks good, but double checking things matters!

/cc @aturon

8 years agoRollup merge of #29537 - bltavares:issue-24954, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29537 - bltavares:issue-24954, r=steveklabnik

Closes #24954

8 years agoRollup merge of #29416 - brson:relnotes, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29416 - brson:relnotes, r=alexcrichton

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)

More highlights would be good. I intend to go through and hyperlink all the APIs still.

8 years agolibrustdoc: don't override ctrl-s and other browser shortcuts
Ivan Kozik [Thu, 5 Nov 2015 10:39:02 +0000 (10:39 +0000)]
librustdoc: don't override ctrl-s and other browser shortcuts

8 years agoAuto merge of #28887 - steveklabnik:gh28851, r=alexcrichton
bors [Thu, 5 Nov 2015 10:30:02 +0000 (10:30 +0000)]
Auto merge of #28887 - steveklabnik:gh28851, r=alexcrichton

If you try to put something that's bigger than a char into a char
literal, you get an error:

    fn main() {
        let c = 'ஶ்ரீ';
    }

    error: unterminated character constant:

This is a very compiler-centric message. Yes, it's technically
'unterminated', but that's not what you, the user did wrong.

Instead, this commit changes it to

    error: character literal that's larger than a char:

As this actually tells you what went wrong.

Fixes #28851

8 years agoFixes as per @brson's review
Steve Klabnik [Thu, 5 Nov 2015 08:45:38 +0000 (09:45 +0100)]
Fixes as per @brson's review

8 years agoImprove error message for char literals
Steve Klabnik [Wed, 7 Oct 2015 16:26:50 +0000 (12:26 -0400)]
Improve error message for char literals

If you try to put something that's bigger than a char into a char
literal, you get an error:

    fn main() {
        let c = 'ஶ்ரீ';
    }

    error: unterminated character constant:

This is a very compiler-centric message. Yes, it's technically
'unterminated', but that's not what you, the user did wrong.

Instead, this commit changes it to

    error: character literal may only contain one codepoint

As this actually tells you what went wrong.

Fixes #28851

8 years agoAuto merge of #29581 - gereeter:unwrap-defmap-refcell, r=nrc
bors [Thu, 5 Nov 2015 04:24:01 +0000 (04:24 +0000)]
Auto merge of #29581 - gereeter:unwrap-defmap-refcell, r=nrc

This is basically a more conservative recreation of #24096.

8 years agoDeprecate `_ms` functions that predate the `Duration` API
Ben Striegel [Thu, 5 Nov 2015 01:11:01 +0000 (17:11 -0800)]
Deprecate `_ms` functions that predate the `Duration` API

8 years agoRemove use of RefCell<DefMap> in the simpler parts of pat_util
Jonathan S [Wed, 4 Nov 2015 12:26:00 +0000 (06:26 -0600)]
Remove use of RefCell<DefMap> in the simpler parts of pat_util

8 years agoRemove use of RefCell<DefMap> in resolve_lifetime
Jonathan S [Wed, 4 Nov 2015 06:26:41 +0000 (00:26 -0600)]
Remove use of RefCell<DefMap> in resolve_lifetime

8 years agoRemove use of RefCell<DefMap> in check_static_recursion
Jonathan S [Wed, 4 Nov 2015 06:20:31 +0000 (00:20 -0600)]
Remove use of RefCell<DefMap> in check_static_recursion

8 years agoUnwrap the RefCell around DefMap
Jonathan S [Wed, 4 Nov 2015 06:02:22 +0000 (00:02 -0600)]
Unwrap the RefCell around DefMap

8 years agoMore relnotes tweaks
Brian Anderson [Thu, 5 Nov 2015 00:56:23 +0000 (16:56 -0800)]
More relnotes tweaks

8 years agoAuto merge of #29543 - Amanieu:asm_mem_constraint, r=alexcrichton
bors [Wed, 4 Nov 2015 20:39:49 +0000 (20:39 +0000)]
Auto merge of #29543 - Amanieu:asm_mem_constraint, r=alexcrichton

The "m" memory constraint in inline assembly is broken (generates incorrect code or triggers LLVM asserts) and should not be used. Instead, indirect memory operands should be used with "\*m", "=\*m" and "+\*m".

Clang does this transparently by transforming "m" constraints into "\*m" indirect constraints, but for now just being able to use "\*m" directly is enough since asm! isn't stable.

While "\*m" works fine as an input operand, "=\*m" and "+\*m" need to be specified as input operands because they take a pointer value as an input. This PR relaxes the constraint checker to allow constraints starting with "=" or "+" if the constraint string contains a "\*", which indicates an indirect operand.

This (indirectly) fixes these issues: #29382, #16383 and #13366. The code will need to be changed to use "\*m" instead of "m".

8 years agoIntroduce a `SwitchInt` and restructure pattern matching to collect
Niko Matsakis [Mon, 26 Oct 2015 18:35:18 +0000 (14:35 -0400)]
Introduce a `SwitchInt` and restructure pattern matching to collect
integers and characters into one master switch.

8 years agoAuto merge of #29536 - sanxiyn:unused-assign-arg, r=alexcrichton
bors [Wed, 4 Nov 2015 18:52:07 +0000 (18:52 +0000)]
Auto merge of #29536 - sanxiyn:unused-assign-arg, r=alexcrichton

Fix #29136.

8 years ago[MIR-trans] Fix handling of non-alloca temps in trans_operand_into()
Björn Steinbrink [Wed, 4 Nov 2015 16:39:25 +0000 (17:39 +0100)]
[MIR-trans] Fix handling of non-alloca temps in trans_operand_into()

8 years agoAuto merge of #29519 - alexcrichton:fix-distcheck, r=nikomatsakis
bors [Wed, 4 Nov 2015 17:01:07 +0000 (17:01 +0000)]
Auto merge of #29519 - alexcrichton:fix-distcheck, r=nikomatsakis

Needed for distcheck to pass and to have a working tarball.

8 years ago[MIR-trans] Fix handling of small aggregate arguments
Björn Steinbrink [Wed, 4 Nov 2015 15:18:15 +0000 (16:18 +0100)]
[MIR-trans] Fix handling of small aggregate arguments

Function arguments that are small aggregates get passed as integer types
instead. To correctly handle that, we need to use store_ty instead of
plain Store.

8 years agoAuto merge of #29564 - gereeter:no-freevar-refcell, r=sanxiyn
bors [Wed, 4 Nov 2015 15:13:49 +0000 (15:13 +0000)]
Auto merge of #29564 - gereeter:no-freevar-refcell, r=sanxiyn

8 years agoAuto merge of #29528 - amitsaha:rust-inside-other-languages-minor, r=nikomatsakis
bors [Wed, 4 Nov 2015 13:24:50 +0000 (13:24 +0000)]
Auto merge of #29528 - amitsaha:rust-inside-other-languages-minor, r=nikomatsakis

When referring to the different shared library extensions, specify the OS explicitly.

8 years agoMention [T]::sort is stable in docs
Steve Klabnik [Wed, 4 Nov 2015 11:44:31 +0000 (12:44 +0100)]
Mention [T]::sort is stable in docs

Fixes #27322

8 years agoAuto merge of #29200 - tshepang:rustfmt-path, r=aturon
bors [Wed, 4 Nov 2015 11:37:50 +0000 (11:37 +0000)]
Auto merge of #29200 - tshepang:rustfmt-path, r=aturon

8 years agoMention multiple impl blocks in TRPL
Steve Klabnik [Wed, 4 Nov 2015 09:35:09 +0000 (10:35 +0100)]
Mention multiple impl blocks in TRPL

Fixes #29322

8 years agoAdd note about HashMap::capacity's bounds
Steve Klabnik [Wed, 4 Nov 2015 09:19:54 +0000 (10:19 +0100)]
Add note about HashMap::capacity's bounds

Fixes #24591

8 years agoMerge first three chapters into one.
Steve Klabnik [Tue, 3 Nov 2015 13:00:22 +0000 (14:00 +0100)]
Merge first three chapters into one.

Conceptually, this makes more sense as one introductory chapter.

8 years agoAuto merge of #29550 - nrc:save-root, r=alexcrichton
bors [Wed, 4 Nov 2015 08:39:44 +0000 (08:39 +0000)]
Auto merge of #29550 - nrc:save-root, r=alexcrichton

8 years agoFix #29542
Toby Scrace [Wed, 4 Nov 2015 07:42:54 +0000 (07:42 +0000)]
Fix #29542

Reword "Writing the logic" paragraph to prevent `unwrap` being confused
for a macro.

8 years agoDon't chain method calls in #[derive(Debug)]
Steven Fackler [Wed, 4 Nov 2015 06:48:28 +0000 (22:48 -0800)]
Don't chain method calls in #[derive(Debug)]

Closes #29540

8 years agoAuto merge of #29478 - angelsl:msvc2, r=alexcrichton
bors [Wed, 4 Nov 2015 06:07:24 +0000 (06:07 +0000)]
Auto merge of #29478 - angelsl:msvc2, r=alexcrichton

r? @alexcrichton

8 years agoRemove the RefCell around freevars and freevars_seen in librustc_resolve
Jonathan S [Wed, 4 Nov 2015 05:12:37 +0000 (23:12 -0600)]
Remove the RefCell around freevars and freevars_seen in librustc_resolve

8 years agoBuild compiler-rt/builtins with MSVC
angelsl [Fri, 23 Oct 2015 16:31:12 +0000 (00:31 +0800)]
Build compiler-rt/builtins with MSVC

8 years agoAuto merge of #29217 - nikomatsakis:mir-trans, r=dotdash
bors [Wed, 4 Nov 2015 02:13:05 +0000 (02:13 +0000)]
Auto merge of #29217 - nikomatsakis:mir-trans, r=dotdash

This branch implements a variant of trans that is based on MIR. It is very incomplete (intentionally), and had only the goal of laying out enough work to enable more incremental follow-on patches. Currently, only fns tagged with `#[rustc_mir]` use the new trans code. I plan to build up a meta-issue as well that tracks the various "not-yet-implemented" points. The only fn that has been tested so far is this amazingly complex "spike" fn:

```rust
#[rustc_mir]
fn sum(x: i32, y: i32) -> i32 {
    x + y
}
```

In general, the most interesting commit is the last one. There are some points on which I would like feedback from @rust-lang/compiler:

- I did not use `Datum`. Originally, I thought that maybe just a `ValueRef` would be enough but I wound up with two very simple structures, `LvalueRef` and `OperandRef`, that just package up a `ValueRef` and a type. Because of MIR's structure, you don't wind up mixing by-ref and by-value so much, and I tend to think that a thinner abstraction layer is better here, but I'm not sure.
- Related to the above, I expect that sooner or later we will analyze temps (and maybe variables too) to find those whose address is never taken and which are word-sized and which perhaps meet a few other criteria. For those, we'll probably want to avoid the alloca, just because it means prettier code.
- I generally tried to re-use data structures from elsewhere in trans, though I'm sure we can trim these down.
- I didn't do any debuginfo primarily because it seems to want node-ids and we have only spans. I haven't really read into that code so I don't know what's going on there.

r? @nrc

8 years agoremove unused import
Niko Matsakis [Wed, 4 Nov 2015 01:38:02 +0000 (20:38 -0500)]
remove unused import

8 years agoAuto merge of #29547 - arielb1:speculative-upvar, r=eddyb
bors [Wed, 4 Nov 2015 00:30:05 +0000 (00:30 +0000)]
Auto merge of #29547 - arielb1:speculative-upvar, r=eddyb

`resolve_identifier` used to mark a variable as an upvar when used within a closure. However, the function is also used for the "unnecessary qualification" lint, which would mark paths whose last component had the same name as a local as upvars.

Fixes #29522

r? @eddyb

8 years agoaddress nits from dotdash
Niko Matsakis [Tue, 3 Nov 2015 20:50:04 +0000 (15:50 -0500)]
address nits from dotdash

8 years agocorrect typos
Niko Matsakis [Tue, 3 Nov 2015 11:44:45 +0000 (06:44 -0500)]
correct typos

8 years agoAdd (and use) an analysis to determine which temps can forgo an alloca.
Niko Matsakis [Tue, 3 Nov 2015 11:35:09 +0000 (06:35 -0500)]
Add (and use) an analysis to determine which temps can forgo an alloca.

8 years agosave-analysis: emit the crate root
Nick Cameron [Tue, 3 Nov 2015 21:16:06 +0000 (10:16 +1300)]
save-analysis: emit the crate root

8 years agoAuto merge of #29545 - mystor:vec-deque-test-panic, r=bluss
bors [Tue, 3 Nov 2015 21:12:03 +0000 (21:12 +0000)]
Auto merge of #29545 - mystor:vec-deque-test-panic, r=bluss

I think this should fix the test failures in debug mode from #29492

The assertion was written incorrectly, and I don't like the way the new assertion is written, but I _think_ it does the right thing now.

8 years agoAuto merge of #29532 - Ryman:cow_path, r=alexcrichton
bors [Tue, 3 Nov 2015 19:29:44 +0000 (19:29 +0000)]
Auto merge of #29532 - Ryman:cow_path, r=alexcrichton

8 years agoresolve: don't speculatively create freevars when resolving
Ariel Ben-Yehuda [Tue, 3 Nov 2015 18:44:23 +0000 (20:44 +0200)]
resolve: don't speculatively create freevars when resolving

Fixes #29522

8 years agoAdd test for inline asm indirect memory operands
Amanieu d'Antras [Tue, 3 Nov 2015 18:13:03 +0000 (18:13 +0000)]
Add test for inline asm indirect memory operands

8 years agoCorrect incorrect assertion in VecDeque::wrap_copy
Michael Layzell [Tue, 3 Nov 2015 18:03:36 +0000 (13:03 -0500)]
Correct incorrect assertion in VecDeque::wrap_copy

8 years agoUpdate compiler-rt
angelsl [Fri, 23 Oct 2015 17:27:23 +0000 (01:27 +0800)]
Update compiler-rt

8 years agolibcollections: DRY up a PartialEq impl for String
Kevin Butler [Tue, 3 Nov 2015 04:54:32 +0000 (04:54 +0000)]
libcollections: DRY up a PartialEq impl for String

8 years agolibstd: implement PartialEq<Path> for PathBuf and Cow<Path>
Kevin Butler [Tue, 3 Nov 2015 04:51:21 +0000 (04:51 +0000)]
libstd: implement PartialEq<Path> for PathBuf and Cow<Path>

8 years agoAuto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton
bors [Tue, 3 Nov 2015 17:02:13 +0000 (17:02 +0000)]
Auto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton

This sets the `cap-lints` setting to 'allow' for all doc compilations. There's precedent for this as rustdoc [already whitelists unstable code](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L112) when compiling documentation, with the expectation being that a regular compile will complain about any problems. I think the same justification applies here.

Problem case in the wild: https://github.com/laumann/compiletest-rs/pull/28

r? @Manishearth

8 years agoAllow indirect operands to be used as inputs for inline asm
Amanieu d'Antras [Tue, 3 Nov 2015 15:19:46 +0000 (15:19 +0000)]
Allow indirect operands to be used as inputs for inline asm

8 years agoAuto merge of #29515 - Manishearth:ice-itembody, r=eddyb
bors [Tue, 3 Nov 2015 15:19:07 +0000 (15:19 +0000)]
Auto merge of #29515 - Manishearth:ice-itembody, r=eddyb

r? @eddyb or @nrc

8 years agoFix ICE with unresolved associated items in closures (fixes #28971)
Manish Goregaokar [Sun, 11 Oct 2015 20:44:55 +0000 (02:14 +0530)]
Fix ICE with unresolved associated items in closures (fixes #28971)

8 years agoAuto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnik
bors [Tue, 3 Nov 2015 13:34:09 +0000 (13:34 +0000)]
Auto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnik

A line may be indented with either spaces or tabs, but not a mix of both. If there is a mix of tabs and spaces, only the kind that occurs first is counted.

This addresses issue #29268.