]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #24287 - brson:beta, r=steveklabnik
bors [Tue, 14 Apr 2015 04:42:06 +0000 (04:42 +0000)]
Auto merge of #24287 - brson:beta, r=steveklabnik

r? @steveklabnik

Should land this, https://github.com/rust-lang/rust/pull/24270, and https://github.com/rust-lang/rust/pull/24245 before rolling another beta.

9 years agoAuto merge of #24251 - alexcrichton:unsafe-from-raw-fd, r=aturon
bors [Tue, 14 Apr 2015 00:07:50 +0000 (00:07 +0000)]
Auto merge of #24251 - alexcrichton:unsafe-from-raw-fd, r=aturon

As pointed out in [RFC issue 1043][rfc] it is quite useful to have the standard
I/O types to provide the contract that they are the sole owner of the underlying
object they represent. This guarantee enables writing safe interfaces like the
`MemoryMap` API sketched out in that issue.

[rfc]: https://github.com/rust-lang/rfcs/issues/1043

As constructing objects from these raw handles may end up violating these
ownership gurantees, the functions for construction are now marked unsafe.

[breaking-change]
Closes rust-lang/rfcs#1043

9 years agoAuto merge of #24198 - alexcrichton:windows-readlink, r=aturon
bors [Mon, 13 Apr 2015 17:39:14 +0000 (17:39 +0000)]
Auto merge of #24198 - alexcrichton:windows-readlink, r=aturon

The current implementation of using GetFinalPathNameByHandle actually reads all
intermediate links instead of just looking at the current link. This commit
alters the behavior of the function to use a different API which correctly reads
only one level of the soft link.

[breaking-change]

9 years agoAuto merge of #24362 - alexcrichton:issue-24334, r=huonw
bors [Mon, 13 Apr 2015 14:57:13 +0000 (14:57 +0000)]
Auto merge of #24362 - alexcrichton:issue-24334, r=huonw

Make sure the unstable `scoped` modules isn't named the same as the `scoped`
function.

cc #24334

9 years agoAuto merge of #24351 - michaelwoerister:named-tuple-fields, r=alexcrichton
bors [Mon, 13 Apr 2015 12:39:49 +0000 (12:39 +0000)]
Auto merge of #24351 - michaelwoerister:named-tuple-fields, r=alexcrichton

This PR makes `rustc` emit field names for tuple fields in DWARF. Formerly there was no way of directly accessing the fields of a tuple in GDB and LLDB since there is no C/C++ equivalent to this. Now, the debugger sees the name `__{field-index}` for tuple fields. So you can type for example `some_tuple_val.__2` to get the third tuple component.
When pretty printers are used (e.g. via `rust-gdb` or `rust-lldb`) these artificial field names will not clutter tuple rendering (which was the main motivation for not doing this in the past).

Solves #21948.

9 years agoAuto merge of #24344 - gfxmonk:update-libbacktrace, r=pnkfelix
bors [Mon, 13 Apr 2015 10:23:58 +0000 (10:23 +0000)]
Auto merge of #24344 - gfxmonk:update-libbacktrace, r=pnkfelix

On linux, certain crashes can cause rust's backtrace generation code to consume huge amounts of memory (multiple gigabytes) when trying to generate a backtrace (e.g. servo/servo#5340).

I tracked this down to a bug in libbacktrace's allocation strategy when processing large binaries, and thankfully it's already been fixed upstream.

The change which fixes this specific issue is r210256, and is discussed here:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00547.html

I assume we'd prefer to update libbacktrace wholesale, rather than cherry-picking individual patches, so this PR updates libbacktrace to the latest code from svn://gcc.gnu.org/svn/gcc/trunk/libbacktrace (r220112).

I've copied the upstream code and reapplied the parts of the following commits which touch src/libbacktrace:

 - cd8f31759fd04b9ce9c903fa00cae81dc5bba546
 - fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae

I have not reapplied f5765793b650e45e8c9bc89dfc7a4dc628123cb7 or d51047ded072b412ec18a6f78c1fb80835a477f5, as those are both cosmetic cleanups applied to the entire codebase. For this directory, it seems worthwhile diverging as little as possible from upstream, to reduce the effort of future updates. But I can add them as well if preferred.

9 years agoAuto merge of #24339 - lfairy:remove-regex-data, r=alexcrichton
bors [Mon, 13 Apr 2015 08:08:23 +0000 (08:08 +0000)]
Auto merge of #24339 - lfairy:remove-regex-data, r=alexcrichton

The regex crate keeps its own tables now (rust-lang/regex#41) so we
don't need them here.

[breaking-change]

9 years agoAuto merge of #24323 - rprichard:panic-line-type, r=alexcrichton
bors [Mon, 13 Apr 2015 05:55:50 +0000 (05:55 +0000)]
Auto merge of #24323 - rprichard:panic-line-type, r=alexcrichton

There are syntax extensions that call `std::rt::begin_unwind` passing it a `usize`.  I updated the syntax extension to instead pass `u32`, but for bootstrapping reasons, I needed to create a `#[cfg(stage0)]` version of `std::rt::begin_unwind` and therefore also `panic!`.

9 years agostd: Work around a stability bug in thread
Alex Crichton [Mon, 13 Apr 2015 04:42:59 +0000 (21:42 -0700)]
std: Work around a stability bug in thread

Make sure the unstable `scoped` modules isn't named the same as the `scoped`
function.

cc #24334

9 years agoAuto merge of #24315 - richo:make-debug-helper, r=pnkfelix
bors [Mon, 13 Apr 2015 02:50:13 +0000 (02:50 +0000)]
Auto merge of #24315 - richo:make-debug-helper, r=pnkfelix

Also add docs because not being able to discover these things is the pits.

This was lifted from http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html , and solves a problem I've solved myself a *lot* of times, often in massively inferior ways.

Super open to documenting it somewhere other than nitty-gritty, which isn't immediately obvious.

9 years agoAuto merge of #23849 - bcoopers:master, r=pnkfelix
bors [Mon, 13 Apr 2015 00:34:21 +0000 (00:34 +0000)]
Auto merge of #23849 - bcoopers:master, r=pnkfelix

Right now, if the user requests to increase the vector size via reserve() or push_back() and the request brings the attempted memory above usize::MAX, we panic.

With this change there is only a panic if the minimum requested memory that could meet the requirement is above usize::MAX- otherwise it simply requests its largest capacity possible, usize::MAX.

9 years agoRemove regex module from libunicode
Chris Wong [Sun, 12 Apr 2015 01:24:19 +0000 (13:24 +1200)]
Remove regex module from libunicode

The regex crate keeps its own tables now (rust-lang/regex#41) so we
don't need them here.

[breaking-change]

9 years agoAuto merge of #24349 - Manishearth:rollup, r=Manishearth
bors [Sun, 12 Apr 2015 20:50:19 +0000 (20:50 +0000)]
Auto merge of #24349 - Manishearth:rollup, r=Manishearth

- Successful merges: #24072, #24233, #24321, #24339, #24341, #24342, #24347
- Failed merges:

9 years agoRollup merge of #24347 - xamgore:master, r=huonw
Manish Goregaokar [Sun, 12 Apr 2015 13:16:15 +0000 (18:46 +0530)]
Rollup merge of #24347 - xamgore:master, r=huonw

Docs meant that ParseIntError is returned though the function returns ParseFloatError.

9 years agoAdd a name for tuple fields in debuginfo so that they can be accessed in debuggers.
Michael Woerister [Mon, 6 Apr 2015 18:39:51 +0000 (11:39 -0700)]
Add a name for tuple fields in debuginfo so that they can be accessed in debuggers.

9 years agoThe panic! macro can't be called with a variable declared
bcoopers [Sun, 12 Apr 2015 17:47:10 +0000 (13:47 -0400)]
The panic! macro can't be called with a variable declared
with "let" when building on stage0. So change the error
message to a static const.

9 years agoAuto merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelix
bors [Sun, 12 Apr 2015 16:37:29 +0000 (16:37 +0000)]
Auto merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelix

Also fixed bug calling .note() instead of .help()

See #24036

9 years agoRollup merge of #24341 - beefsack:traits-doc-dead-link, r=huonw
Manish Goregaokar [Sun, 12 Apr 2015 13:16:14 +0000 (18:46 +0530)]
Rollup merge of #24341 - beefsack:traits-doc-dead-link, r=huonw

The "static and dynamic dispatch" chapter seems to no longer exist but there is a dead link from the Traits chapter pointing to it.

Have changed the link to point to "Trait Objects" which covers static and dynamic dispatch.

9 years agoRollup merge of #24321 - lstat:16602-needstest, r=pnkfelix
Manish Goregaokar [Sun, 12 Apr 2015 13:16:14 +0000 (18:46 +0530)]
Rollup merge of #24321 - lstat:16602-needstest, r=pnkfelix

Closes #16602

9 years agoRollup merge of #24233 - frewsxcv:cleanup-fuse-iterator, r=Gankro
Manish Goregaokar [Sun, 12 Apr 2015 13:16:14 +0000 (18:46 +0530)]
Rollup merge of #24233 - frewsxcv:cleanup-fuse-iterator, r=Gankro

9 years agoRollup merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelix
Manish Goregaokar [Sun, 12 Apr 2015 13:16:14 +0000 (18:46 +0530)]
Rollup merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelix

Also fixed bug calling .note() instead of .help()

See #24036

9 years agomod.rs documentary fix
Igor Strebezhev [Sun, 12 Apr 2015 10:48:19 +0000 (14:48 +0400)]
mod.rs documentary fix

Docs meant that Option is returned though the function returns Result.

9 years agoAuto merge of #24248 - nrc:macro-span, r=sfackler
bors [Sun, 12 Apr 2015 09:03:04 +0000 (09:03 +0000)]
Auto merge of #24248 - nrc:macro-span, r=sfackler

9 years agoAuto merge of #24003 - rprichard:span-fixes, r=huonw
bors [Sun, 12 Apr 2015 06:48:28 +0000 (06:48 +0000)]
Auto merge of #24003 - rprichard:span-fixes, r=huonw

 * In `noop_fold_expr`, call `new_span` in these cases:
    - `ExprMethodCall`'s identifier
    - `ExprField`'s identifier
    - `ExprTupField`'s integer

   Calling `new_span` for `ExprMethodCall`'s identifier is necessary to print
   an acceptable diagnostic for `write!(&2, "")`. We see this error:
   ```
   <std macros>:2:20: 2:66 error: type `&mut _` does not implement any method in scope named `write_fmt`
   <std macros>:2 ( & mut * $ dst ) . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ```
   With this change, we also see a macro expansion backtrace leading to
   the `write!(&2, "")` call site.

 * After fully expanding a macro, we replace the expansion expression's
   span with the original span. Call `fld.new_span` to add a backtrace to
   this span. (Note that I'm call `new_span` after `bt.pop()`, so the macro
   just expanded isn't on the backtrace.)

   The motivating example for this change is `println!("{}")`. The format
   string literal is `concat!($fmt, "arg")` and is inside the libstd macro.
   We need to see the backtrace to find the `println!` call site.

 * Add a backtrace to the `format_args!` format expression span.

r?  alexcrichton

Addresses #23459

9 years agoSimplify iterator logic for Fuse
Corey Farwell [Thu, 9 Apr 2015 15:59:48 +0000 (08:59 -0700)]
Simplify iterator logic for Fuse

9 years agoAuto merge of #24109 - sanxiyn:diverging-closure, r=pnkfelix
bors [Sun, 12 Apr 2015 04:33:40 +0000 (04:33 +0000)]
Auto merge of #24109 - sanxiyn:diverging-closure, r=pnkfelix

Fix #23896.

9 years agoUpdated dead link in Traits chapter of book to point to Trait Objects chapter.
Michael Alexander [Sun, 12 Apr 2015 02:42:05 +0000 (10:42 +0800)]
Updated dead link in Traits chapter of book to point to Trait Objects chapter.

9 years agoFix spans for macros
Nick Cameron [Thu, 9 Apr 2015 20:49:10 +0000 (08:49 +1200)]
Fix spans for macros

9 years agoAuto merge of #23011 - nagisa:the-war-of-symbol-and-symbol, r=pnkfelix
bors [Sun, 12 Apr 2015 01:26:53 +0000 (01:26 +0000)]
Auto merge of #23011 - nagisa:the-war-of-symbol-and-symbol, r=pnkfelix

We provide tools to tell what exact symbols to emit for any fn or static, but
don’t quite check if that won’t cause any issues later on. Some of the issues
include LLVM mangling our names again and our names pointing to wrong locations,
us generating dumb foreign call wrappers, linker errors, extern functions
resolving to different symbols altogether (`extern {fn fail();} fail();` in some
cases calling `fail1()`), etc.

Before the commit we had a function called `note_unique_llvm_symbol`, so it is
clear somebody was aware of the issue at some point, but the function was barely
used, mostly in irrelevant locations.

Along with working on it I took liberty to start refactoring trans/base into
a few smaller modules. The refactoring is incomplete and I hope I will find some
motivation to carry on with it.

This is possibly a [breaking-change] because it makes dumbly written code
properly invalid.

This fixes all those issues about incorrect use of #[no_mangle] being not reported/misreported/ICEd by the compiler.

NB. This PR does not attempt to tackle the parallel codegen issue that was mentioned in https://github.com/rust-lang/rust/pull/22811, but I believe it should be very straightforward in a follow up PR by modifying `trans::declare::get_defined_value` to look at all the contexts.

cc @alexcrichton @huonw @nrc because you commented on the original RFC issue.

EDIT: wow, this became much bigger than I initially intended.

9 years agoRemove the vestigial ExtCtxt::print_backtrace function.
Ryan Prichard [Fri, 10 Apr 2015 05:42:59 +0000 (22:42 -0700)]
Remove the vestigial ExtCtxt::print_backtrace function.

It was added in 2011-08-05 and reduced to a no-op ten days later.

9 years agoSuppress the macro backtrace for `fileline_note` and `fileline_help`.
Ryan Prichard [Mon, 6 Apr 2015 01:07:11 +0000 (18:07 -0700)]
Suppress the macro backtrace for `fileline_note` and `fileline_help`.

9 years agoAdd compile-file/macro-backtrace-{invalid-internals,nested,println} tests
Ryan Prichard [Sat, 4 Apr 2015 02:58:41 +0000 (19:58 -0700)]
Add compile-file/macro-backtrace-{invalid-internals,nested,println} tests

9 years agoExpand internal-unstable to handle named field accesses and method calls.
Ryan Prichard [Sat, 4 Apr 2015 03:22:36 +0000 (20:22 -0700)]
Expand internal-unstable to handle named field accesses and method calls.

9 years agoPropagate macro backtraces more often, improve formatting diagnostics
Ryan Prichard [Fri, 3 Apr 2015 08:27:04 +0000 (01:27 -0700)]
Propagate macro backtraces more often, improve formatting diagnostics

 * In noop_fold_expr, call new_span in these cases:
    - ExprMethodCall's identifier
    - ExprField's identifier
    - ExprTupField's integer

   Calling new_span for ExprMethodCall's identifier is necessary to print
   an acceptable diagnostic for write!(&2, ""). We see this error:

       <std macros>:2:20: 2:66 error: type `&mut _` does not implement any method in scope named `write_fmt`
       <std macros>:2 ( & mut * $ dst ) . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   With this change, we also see a macro expansion backtrace leading to
   the write!(&2, "") call site.

 * After fully expanding a macro, we replace the expansion expression's
   span with the original span. Call fld.new_span to add a backtrace to
   this span. (Note that I'm call new_span after bt.pop(), so the macro
   just expanded isn't on the backtrace.)

   The motivating example for this change is println!("{}"). The format
   string literal is concat!($fmt, "arg") and is inside the libstd macro.
   We need to see the backtrace to find the println! call site.

 * Add a backtrace to the format_args! format expression span.

Addresses #23459

9 years agoAuto merge of #24328 - Manishearth:rollup, r=Manishearth
bors [Sat, 11 Apr 2015 18:31:59 +0000 (18:31 +0000)]
Auto merge of #24328 - Manishearth:rollup, r=Manishearth

9 years agoFix readme doctest (fixup #24239)
Manish Goregaokar [Sat, 11 Apr 2015 15:39:36 +0000 (21:09 +0530)]
Fix readme doctest (fixup #24239)

9 years agoAuto merge of #24269 - benashford:formatting-fix, r=alexcrichton
bors [Sat, 11 Apr 2015 15:34:24 +0000 (15:34 +0000)]
Auto merge of #24269 - benashford:formatting-fix, r=alexcrichton

This fixes the bug described in issue #23150.  This affected formatting any floating point number into a string in a formatting pattern that: a) required rounding up, and b) required an extra digit on the front.

So `format!("{:.0}", 9.9)` would fail, but `format!("{:.0}", 8.9)` would succeed.  This was due to a negative integer being cast to a `usize` resulting in an 'arithmetic operation overflowed' panic.

The fix was to change the order of operations so that the number is zero before casting.

9 years agoRollup merge of #24309 - tshepang:doc-avoid-x-confusion, r=Manishearth
Manish Goregaokar [Sat, 11 Apr 2015 13:36:01 +0000 (19:06 +0530)]
Rollup merge of #24309 - tshepang:doc-avoid-x-confusion, r=Manishearth

9 years agoRollup merge of #24304 - ihrwein:fix-some-typos, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:35:52 +0000 (19:05 +0530)]
Rollup merge of #24304 - ihrwein:fix-some-typos, r=alexcrichton

Signed-off-by: Tibor Benke <ihrwein@gmail.com>
9 years agoRollup merge of #24298 - White-Oak:master, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:35:43 +0000 (19:05 +0530)]
Rollup merge of #24298 - White-Oak:master, r=alexcrichton

 Fixes 'fn from_str_radix' documentation where docs meant that Option is returned, though the function returns Result.

9 years agoRollup merge of #24291 - xamgore:patch-1, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:35:34 +0000 (19:05 +0530)]
Rollup merge of #24291 - xamgore:patch-1, r=steveklabnik

 From [here](http://doc.rust-lang.org/nightly/std/primitive.i8.html):

> `fn rotate_right(self, n: u32) -> i8`
> Shifts the bits to the right by a specified __amount amount__, n, wrapping the truncated bits to the beginning of the resulting integer.

9 years agoRollup merge of #24283 - apasel422:patch-2, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:35:26 +0000 (19:05 +0530)]
Rollup merge of #24283 - apasel422:patch-2, r=alexcrichton

9 years agoRollup merge of #24282 - SimonSapin:patch-6, r=pnkfelix
Manish Goregaokar [Sat, 11 Apr 2015 13:35:17 +0000 (19:05 +0530)]
Rollup merge of #24282 - SimonSapin:patch-6, r=pnkfelix

 https://botbot.me/mozilla/rust-internals/2015-04-10/?msg=36316959&page=6

9 years agoRollup merge of #24281 - steveklabnik:lol_editing, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:35:09 +0000 (19:05 +0530)]
Rollup merge of #24281 - steveklabnik:lol_editing, r=alexcrichton

 more more more

9 years agoRollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:35:00 +0000 (19:05 +0530)]
Rollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnik

 ...to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.

r? @steveklabnik

9 years agoRollup merge of #24274 - steveklabnik:fix_pow_docs, r=nikomatsakis
Manish Goregaokar [Sat, 11 Apr 2015 13:34:51 +0000 (19:04 +0530)]
Rollup merge of #24274 - steveklabnik:fix_pow_docs, r=nikomatsakis

 This is very confusing now that these are inherent methods.

9 years agoRollup merge of #24259 - lstat:needstest, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:34:43 +0000 (19:04 +0530)]
Rollup merge of #24259 - lstat:needstest, r=alexcrichton

 Closes #20772
Closes #20939
Closes #21950
Closes #22034

9 years agoRollup merge of #24253 - steveklabnik:doc_primitive_types, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:34:37 +0000 (19:04 +0530)]
Rollup merge of #24253 - steveklabnik:doc_primitive_types, r=alexcrichton

 A brief introduction to each type, with pointers to the primitive pages
for more info.

9 years agoRollup merge of #24247 - steveklabnik:update_variable_bindings, r=huonw
Manish Goregaokar [Sat, 11 Apr 2015 13:34:30 +0000 (19:04 +0530)]
Rollup merge of #24247 - steveklabnik:update_variable_bindings, r=huonw

 keeping on with the edits

9 years agoRollup merge of #24245 - nikomatsakis:issue-24241-coherence-failure, r=pnkfelix
Manish Goregaokar [Sat, 11 Apr 2015 13:34:22 +0000 (19:04 +0530)]
Rollup merge of #24245 - nikomatsakis:issue-24241-coherence-failure, r=pnkfelix

 Don't use skolemized parameters but rather fresh variables in coherence. Skolemized parameters wind up preventing unification. Surprised we had no test for this! Fixes #24241.

r? @pnkfelix

9 years agoRollup merge of #24244 - steveklabnik:more_editing, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:34:15 +0000 (19:04 +0530)]
Rollup merge of #24244 - steveklabnik:more_editing, r=steveklabnik

 Fill out blank section headers. Copy edit the entire first section.

9 years agoRollup merge of #24243 - frewsxcv:patch-13, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:34:08 +0000 (19:04 +0530)]
Rollup merge of #24243 - frewsxcv:patch-13, r=steveklabnik

9 years agoRollup merge of #24242 - nikomatsakis:escaping-closure-error-message, r=brson
Manish Goregaokar [Sat, 11 Apr 2015 13:34:03 +0000 (19:04 +0530)]
Rollup merge of #24242 - nikomatsakis:escaping-closure-error-message, r=brson

 Example showing sample inputs, old message, new message:

https://gist.github.com/nikomatsakis/11126784ac678b7eb6ba

Also adds infrastructure for reporting suggestions \"in situ\" and does some (minor) cleanups to `CodeMap`.

r? @brson

9 years agoRollup merge of #24240 - apasel422:patch-1, r=aturon
Manish Goregaokar [Sat, 11 Apr 2015 13:33:56 +0000 (19:03 +0530)]
Rollup merge of #24240 - apasel422:patch-1, r=aturon

9 years agoRollup merge of #24239 - steveklabnik:editing_pass, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:50 +0000 (19:03 +0530)]
Rollup merge of #24239 - steveklabnik:editing_pass, r=steveklabnik

 Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction.

It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.

9 years agoRollup merge of #24236 - aturon:issue-19097, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:43 +0000 (19:03 +0530)]
Rollup merge of #24236 - aturon:issue-19097, r=alexcrichton

 Closes #19097

9 years agoRollup merge of #24234 - thiagooak:academic-research, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:36 +0000 (19:03 +0530)]
Rollup merge of #24234 - thiagooak:academic-research, r=steveklabnik

 #24004

Something like this?

9 years agoRollup merge of #24121 - steveklabnik:gh24107, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:29 +0000 (19:03 +0530)]
Rollup merge of #24121 - steveklabnik:gh24107, r=steveklabnik

9 years agoRollup merge of #24285 - brson:rustup, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:20 +0000 (19:03 +0530)]
Rollup merge of #24285 - brson:rustup, r=alexcrichton

 Now lives at https://github.com/rust-lang/rustup

r? @alexcrichton

9 years agoRollup merge of #24269 - benashford:formatting-fix, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:13 +0000 (19:03 +0530)]
Rollup merge of #24269 - benashford:formatting-fix, r=alexcrichton

 This fixes the bug described in issue #23150.  This affected formatting any floating point number into a string in a formatting pattern that: a) required rounding up, and b) required an extra digit on the front.

So `format!(\"{:.0}\", 9.9)` would fail, but `format!(\"{:.0}\", 8.9)` would succeed.  This was due to a negative integer being cast to a `usize` resulting in an 'arithmetic operation overflowed' panic.

The fix was to change the order of operations so that the number is zero before casting.

9 years agoRollup merge of #24268 - pnkfelix:regression-tests, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:04 +0000 (19:03 +0530)]
Rollup merge of #24268 - pnkfelix:regression-tests, r=alexcrichton

 A pair of regression tests for issues that seem to have been fixed since they were originally filed.

9 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

9 years agoUpdate libbacktrace to r220112 (from GCC SVN)
Tim Cuthbertson [Sat, 11 Apr 2015 12:14:10 +0000 (22:14 +1000)]
Update libbacktrace to r220112 (from GCC SVN)

9 years agoAuto merge of #24268 - pnkfelix:regression-tests, r=alexcrichton
bors [Sat, 11 Apr 2015 11:06:14 +0000 (11:06 +0000)]
Auto merge of #24268 - pnkfelix:regression-tests, r=alexcrichton

A pair of regression tests for issues that seem to have been fixed since they were originally filed.

9 years agoChange the rt::unwind line argument type from usize to u32.
Ryan Prichard [Sat, 11 Apr 2015 09:46:57 +0000 (02:46 -0700)]
Change the rt::unwind line argument type from usize to u32.

9 years agoAuto merge of #24155 - chris-chambers:stmt_macros, r=sfackler
bors [Sat, 11 Apr 2015 08:07:34 +0000 (08:07 +0000)]
Auto merge of #24155 - chris-chambers:stmt_macros, r=sfackler

Statement macros are now treated somewhat like item macros, in that a statement macro can now expand into a series of statements, rather than just a single statement.

This allows statement macros to be nested inside other kinds of macros and expand properly, where previously the expansion would only work when no nesting was present.

See:
- `src/test/run-pass/macro-stmt_macro_in_expr_macro.rs`
- `src/test/run-pass/macro-nested_stmt_macro.rs`

This changes the interface of the MacResult trait.  make_stmt has become make_stmts and now returns a vector, rather than a single item.  Plugin writers who were implementing MacResult will have breakage, as well as anyone using MacEager::stmt.

See:
- `src/libsyntax/ext/base.rs`

This also causes a minor difference in behavior to the diagnostics produced by certain malformed macros.

See:
- `src/test/compile-fail/macro-incomplete-parse.rs`

9 years agoAdd tests for #16602
Luke Gallagher [Sat, 11 Apr 2015 07:13:24 +0000 (17:13 +1000)]
Add tests for #16602

Closes #16602

9 years agoMoves expand_stmt's bt_pop so that it balances correctly.
Christopher Chambers [Sat, 11 Apr 2015 05:59:00 +0000 (00:59 -0500)]
Moves expand_stmt's bt_pop so that it balances correctly.

9 years agoAuto merge of #24254 - aturon:join-handle-debug, r=alexcrichton
bors [Sat, 11 Apr 2015 05:57:55 +0000 (05:57 +0000)]
Auto merge of #24254 - aturon:join-handle-debug, r=alexcrichton

Make `Box<Any + Send>` implement `Debug`.

Fixes #21291

9 years agoSimplifications to statement macro handling.
Christopher Chambers [Sat, 11 Apr 2015 04:06:34 +0000 (23:06 -0500)]
Simplifications to statement macro handling.

SmallVector::pop no longer worries about converting a Many repr downward
to One or Zero.

expand_stmt makes use of `if let` for style purposes.

9 years agoEliminates a pointless is_empty test.
Christopher Chambers [Sat, 11 Apr 2015 03:20:01 +0000 (22:20 -0500)]
Eliminates a pointless is_empty test.

9 years agoImproves semicolon expansion efficiency, corrects bt_pop placement.
Christopher Chambers [Sat, 11 Apr 2015 02:50:23 +0000 (21:50 -0500)]
Improves semicolon expansion efficiency, corrects bt_pop placement.

Implements pop() on SmallVector, and uses it to expand the final semicolon
in a statement macro expansion more efficiently.

Corrects the placement of the call to fld.cx.bt_pop().  It must run
unconditionally to reverse the corresponding push.

9 years agoAuto merge of #24186 - richo:pad-pointers, r=alexcrichton
bors [Sat, 11 Apr 2015 01:59:18 +0000 (01:59 +0000)]
Auto merge of #24186 - richo:pad-pointers, r=alexcrichton

This pads out the printing of pointers to their native width.

Extracted from and rebased on top of #24144

9 years agomk: Add a printer helper to the make setup
Richo Healey [Sat, 11 Apr 2015 00:01:09 +0000 (17:01 -0700)]
mk: Add a printer helper to the make setup

Also add docs because not being able to discover these things is the
pits.

9 years agoAuto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson
bors [Fri, 10 Apr 2015 23:49:24 +0000 (23:49 +0000)]
Auto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson

Use `discriminant_value` intrinsic for `derive(PartialOrd)`

[breaking-change]

This is a [breaking-change] because it can change the result of comparison operators when enum discriminants have been explicitly assigned.  Notably in a case like:
```rust
#[derive(PartialOrd)]
enum E { A = 2, B = 1}
```

Under the old deriving, `A < B` held, because `A` came before `B` in the order of declaration.  But now we use the ordering according to the provided values, and thus `A > B`.  (However, this change is very unlikely to break much, if any, code, since the orderings themselves should all remain well-defined, total, etc.)

Fix #15523

9 years agoRemove pretty-expanded from 2 tests; deriving(Ord) uses unstable intrinsic.
Felix S. Klock II [Fri, 10 Apr 2015 22:50:59 +0000 (00:50 +0200)]
Remove pretty-expanded from 2 tests; deriving(Ord) uses unstable intrinsic.

9 years agobook: 'x' is already taken, so use something else
Tshepang Lekhonkhobe [Thu, 26 Mar 2015 19:53:17 +0000 (21:53 +0200)]
book: 'x' is already taken, so use something else

9 years agoFix some typos
Tibor Benke [Fri, 10 Apr 2015 20:51:05 +0000 (22:51 +0200)]
Fix some typos

Signed-off-by: Tibor Benke <ihrwein@gmail.com>
9 years agoMore editing work on TRPL
Steve Klabnik [Thu, 9 Apr 2015 19:17:31 +0000 (15:17 -0400)]
More editing work on TRPL

Fill out blank section headers. Copy edit the entire first section.

9 years agomod.rs docs fix - for floats
Oak [Fri, 10 Apr 2015 19:20:40 +0000 (23:20 +0400)]
mod.rs docs fix - for floats

Same with integers — docs meant that Option is returned though the function returns Result.

9 years agomod.rs docs fix
Oak [Fri, 10 Apr 2015 19:16:47 +0000 (23:16 +0400)]
mod.rs docs fix

Docs meant that Option is returned though the function returns Result.

9 years agoFix mistake in documentation
Igor Strebezhev [Fri, 10 Apr 2015 17:32:38 +0000 (20:32 +0300)]
Fix mistake in documentation

9 years agofix some comments.
Felix S. Klock II [Fri, 10 Apr 2015 17:13:34 +0000 (19:13 +0200)]
fix some comments.

9 years agoBump prerelease version
Brian Anderson [Fri, 10 Apr 2015 17:12:27 +0000 (10:12 -0700)]
Bump prerelease version

9 years agoTest case for 64-bit corner cases where truncation occurred before prior commit.
Felix S. Klock II [Fri, 10 Apr 2015 17:02:01 +0000 (19:02 +0200)]
Test case for 64-bit corner cases where truncation occurred before prior commit.

9 years agoIncorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.
Felix S. Klock II [Fri, 10 Apr 2015 17:00:38 +0000 (19:00 +0200)]
Incorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.

remove out of date fixme.

9 years agoRemove rustup.sh.
Brian Anderson [Fri, 10 Apr 2015 17:01:04 +0000 (10:01 -0700)]
Remove rustup.sh.

Now lives at https://github.com/rust-lang/rustup

9 years agoAdd examples for Convert
Steve Klabnik [Mon, 6 Apr 2015 18:25:39 +0000 (14:25 -0400)]
Add examples for Convert

9 years agos/Panicks/Panics/
Andrew Paseltiner [Fri, 10 Apr 2015 16:42:36 +0000 (12:42 -0400)]
s/Panicks/Panics/

9 years agoDoc: remove a "safety note" made obsolete by dropck for TypedArena
Simon Sapin [Fri, 10 Apr 2015 16:30:52 +0000 (18:30 +0200)]
Doc: remove a "safety note" made obsolete by dropck for TypedArena

https://botbot.me/mozilla/rust-internals/2015-04-10/?msg=36316959&page=6

9 years agocopyediting: while loops
Steve Klabnik [Fri, 10 Apr 2015 16:25:40 +0000 (12:25 -0400)]
copyediting: while loops

9 years agocopyediting: for loops
Steve Klabnik [Fri, 10 Apr 2015 16:21:14 +0000 (12:21 -0400)]
copyediting: for loops

9 years agocopyedits: patterns
Steve Klabnik [Fri, 10 Apr 2015 16:19:26 +0000 (12:19 -0400)]
copyedits: patterns

This also puts slice patterns in nightly docs, where they belong.

9 years agocopyediting: match
Steve Klabnik [Fri, 10 Apr 2015 16:03:30 +0000 (12:03 -0400)]
copyediting: match

9 years agocopy-editing: if
Steve Klabnik [Fri, 10 Apr 2015 15:50:28 +0000 (11:50 -0400)]
copy-editing: if

I decided to break if-let out, as it's too complex for this part, but moving
if that late seems silly too.

9 years agoremove backticks from titles
Steve Klabnik [Fri, 10 Apr 2015 15:35:19 +0000 (11:35 -0400)]
remove backticks from titles

This doesn't actually display correctly

9 years agosome TOC reorganization
Steve Klabnik [Fri, 10 Apr 2015 15:33:56 +0000 (11:33 -0400)]
some TOC reorganization

As I go through this, I'm finding some ways that I want to tweak the order.

9 years agoAuto merge of #24177 - alexcrichton:rustdoc, r=aturon
bors [Fri, 10 Apr 2015 16:18:44 +0000 (16:18 +0000)]
Auto merge of #24177 - alexcrichton:rustdoc, r=aturon

This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable).

I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.

9 years agoChanged the wording of the documentation for the insert method for Vec to be less...
Dominick Allen [Fri, 10 Apr 2015 15:33:21 +0000 (11:33 -0400)]
Changed the wording of the documentation for the insert method for Vec to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.

9 years agoFix pow docs to not use Int
Steve Klabnik [Fri, 10 Apr 2015 14:58:07 +0000 (10:58 -0400)]
Fix pow docs to not use Int

This is very confusing now that these are inherent methods.