]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agolibstd: Implement some convenience methods on vectors
Patrick Walton [Wed, 19 Feb 2014 05:36:51 +0000 (21:36 -0800)]
libstd: Implement some convenience methods on vectors

10 years agoauto merge of #12420 : pnkfelix/rust/fsk-improve-doc-for-ptr-offset, r=alexcrichton
bors [Fri, 21 Feb 2014 16:26:50 +0000 (08:26 -0800)]
auto merge of #12420 : pnkfelix/rust/fsk-improve-doc-for-ptr-offset, r=alexcrichton

ptr::RawPtr, spell out units used for the `offset` argument.

spell out units used for the `offset` argument, so that callers do not
try to scale to byte units themselves.

(this was originally landed in PR #11002 for the stand-alone functions, but that PR did not modify the `RawPtr` methods, since that had no doc at all at the time.  Now `RawPtr` has the *only* documentation for `offset`, since the stand-alone functions went away in PR #12167 / PR #12248.)

10 years agoauto merge of #12419 : huonw/rust/compiler-unsafe, r=alexcrichton
bors [Fri, 21 Feb 2014 15:06:51 +0000 (07:06 -0800)]
auto merge of #12419 : huonw/rust/compiler-unsafe, r=alexcrichton

Previously an `unsafe` block created by the compiler (like those in the
formatting macros) would be "ignored" if surrounded by `unsafe`, that
is, the internal unsafety would be being legitimised by the external
block:

    unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } }

And the code in the inner block would be using the outer block, making
it considered used (and the inner one considered unused).

This patch forces the compiler to create a new unsafe context for
compiler generated blocks, so that their internal unsafety doesn't
escape to external blocks.

Fixes #12418.

10 years agoauto merge of #12415 : HeroesGrave/rust/move-enum-set, r=alexcrichton
bors [Fri, 21 Feb 2014 13:26:58 +0000 (05:26 -0800)]
auto merge of #12415 : HeroesGrave/rust/move-enum-set, r=alexcrichton

Part of #8784

Also removed the one glob import.

10 years agoauto merge of #12410 : DaGenix/rust/fix-incorrect-comment, r=alexcrichton
bors [Fri, 21 Feb 2014 12:01:57 +0000 (04:01 -0800)]
auto merge of #12410 : DaGenix/rust/fix-incorrect-comment, r=alexcrichton

The comments say that the prelude imports std::io::println since it would
be annoying to have to import it in every program that uses it. However,
the prelude doesn't actually import that function anymore. So, update the
comments to better match reality.

10 years agoauto merge of #12290 : mrshu/rust/lint-warn-by-default, r=alexcrichton
bors [Fri, 21 Feb 2014 08:56:58 +0000 (00:56 -0800)]
auto merge of #12290 : mrshu/rust/lint-warn-by-default, r=alexcrichton

This first part of my attempts to fix #11432.

In this one I only set NonCamelCaseTypes to warn by default and tried to fix errors that were reported by `make check`.

Please feel free to let me know if I missed something or didn't do it the right way.

Thanks.

10 years agoauto merge of #12407 : alexcrichton/rust/up-llvm, r=sfackler
bors [Fri, 21 Feb 2014 07:16:57 +0000 (23:16 -0800)]
auto merge of #12407 : alexcrichton/rust/up-llvm, r=sfackler

This updates the LLVM submodule to the `rust-llvm-2014-02-19` tag which is the
old one with https://github.com/rust-lang/llvm/pull/4 cherry-picked on top.

Awesome job by @neykov for this!

10 years agoChanged NonCamelCaseTypes lint to warn by default
mr.Shu [Mon, 10 Feb 2014 14:36:31 +0000 (15:36 +0100)]
Changed NonCamelCaseTypes lint to warn by default

Added allow(non_camel_case_types) to librustc where necesary

Tried to fix problems with non_camel_case_types outside rustc

fixed failing tests

Docs updated

Moved #[allow(non_camel_case_types)] a level higher.

markdown.rs reverted

Fixed timer that was failing tests

Fixed another timer

10 years agoauto merge of #12164 : alexcrichton/rust/rlibs-and-dylibs, r=cmr
bors [Fri, 21 Feb 2014 02:51:57 +0000 (18:51 -0800)]
auto merge of #12164 : alexcrichton/rust/rlibs-and-dylibs, r=cmr

The first commit improves error messages during linking, and the second commit improves error messages during crate-loading time.

Closes #12297
Closes #12377

10 years agoRe-work loading crates with nicer errors
Alex Crichton [Mon, 10 Feb 2014 20:50:53 +0000 (12:50 -0800)]
Re-work loading crates with nicer errors

This commit rewrites crate loading internally in attempt to look at less
metadata and provide nicer errors. The loading is now split up into a few
stages:

1. Collect a mapping of (hash => ~[Path]) for a set of candidate libraries for a
   given search. The hash is the hash in the filename and the Path is the
   location of the library in question. All candidates are filtered based on
   their prefix/suffix (dylib/rlib appropriate) and then the hash/version are
   split up and are compared (if necessary).

   This means that if you're looking for an exact hash of library you don't have
   to open up the metadata of all libraries named the same, but also in your
   path.

2. Once this mapping is constructed, each (hash, ~[Path]) pair is filtered down
   to just a Path. This is necessary because the same rlib could show up twice
   in the path in multiple locations. Right now the filenames are based on just
   the crate id, so this could be indicative of multiple version of a crate
   during one crate_id lifetime in the path. If multiple duplicate crates are
   found, an error is generated.

3. Now that we have a mapping of (hash => Path), we error on multiple versions
   saying that multiple versions were found. Only if there's one (hash => Path)
   pair do we actually return that Path and its metadata.

With this restructuring, it restructures code so errors which were assertions
previously are now first-class errors. Additionally, this should read much less
metadata with lots of crates of the same name or same version in a path.

Closes #11908

10 years agoauto merge of #12401 : alexcrichton/rust/if-ok-2-try, r=brson
bors [Fri, 21 Feb 2014 00:56:51 +0000 (16:56 -0800)]
auto merge of #12401 : alexcrichton/rust/if-ok-2-try, r=brson

This "bubble up an error" macro was originally named if_ok! in order to get it
landed, but after the fact it was discovered that this name is not exactly
desirable.

The name `if_ok!` isn't immediately clear that is has much to do with error
handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In
general, the agreed opinion about `if_ok!` is that is came in as subpar.

The name `try!` is more invocative of error handling, it's shorter by 2 letters,
and it looks fitting in almost all circumstances. One concern about the word
`try!` is that it's too invocative of exceptions, but the belief is that this
will be overcome with documentation and examples.

Close #12037

10 years agoauto merge of #12161 : aepsil0n/rust/docs/for-loop, r=alexcrichton
bors [Thu, 20 Feb 2014 18:36:49 +0000 (10:36 -0800)]
auto merge of #12161 : aepsil0n/rust/docs/for-loop, r=alexcrichton

I just started learning Rust and the absence of an explanation of the for-loop in the beginning really bugged me about the tutorial. Hence I simply added these lines, where I would have expected them. I know that there is something later on in the section on traits. However, this simple iteration scheme feels like something that you should be aware of right away.

10 years agoMass rename if_ok! to try!
Alex Crichton [Wed, 19 Feb 2014 18:07:49 +0000 (10:07 -0800)]
Mass rename if_ok! to try!

This "bubble up an error" macro was originally named if_ok! in order to get it
landed, but after the fact it was discovered that this name is not exactly
desirable.

The name `if_ok!` isn't immediately clear that is has much to do with error
handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In
general, the agreed opinion about `if_ok!` is that is came in as subpar.

The name `try!` is more invocative of error handling, it's shorter by 2 letters,
and it looks fitting in almost all circumstances. One concern about the word
`try!` is that it's too invocative of exceptions, but the belief is that this
will be overcome with documentation and examples.

Close #12037

10 years agoauto merge of #12405 : kud1ing/rust/backticks, r=huonw
bors [Thu, 20 Feb 2014 16:21:45 +0000 (08:21 -0800)]
auto merge of #12405 : kud1ing/rust/backticks, r=huonw

10 years agoauto merge of #12403 : eddyb/rust/generic-dtors-with-bounds, r=nikomatsakis
bors [Thu, 20 Feb 2014 15:06:49 +0000 (07:06 -0800)]
auto merge of #12403 : eddyb/rust/generic-dtors-with-bounds, r=nikomatsakis

Fix generic Drop impls with trait bounds.
Fixes #4252.

10 years agoptr::RawPtr, spell out units used for the `offset` argument.
Felix S. Klock II [Thu, 20 Feb 2014 13:58:46 +0000 (14:58 +0100)]
ptr::RawPtr, spell out units used for the `offset` argument.

spell out units used for the `offset` argument, so that callers do not
try to scale to byte units themselves.

10 years agoauto merge of #12399 : michaelwoerister/rust/simd-fix, r=alexcrichton
bors [Thu, 20 Feb 2014 13:46:48 +0000 (05:46 -0800)]
auto merge of #12399 : michaelwoerister/rust/simd-fix, r=alexcrichton

Fixes  #12333.
I also re-enabled the *function-arg-initialization* test case, so if it passes again, fixes #12021.

10 years agoauto merge of #12398 : alexcrichton/rust/rlibs-and-dylibs-2, r=cmr
bors [Thu, 20 Feb 2014 12:31:49 +0000 (04:31 -0800)]
auto merge of #12398 : alexcrichton/rust/rlibs-and-dylibs-2, r=cmr

The new methodology can be found in the re-worded comment, but the gist of it is
that -C prefer-dynamic doesn't turn off static linkage. The error messages
should also be a little more sane now.

Closes #12133

10 years agorustc: avoid compiler generated `unsafe` blocks leaking.
Huon Wilson [Thu, 20 Feb 2014 12:22:45 +0000 (23:22 +1100)]
rustc: avoid compiler generated `unsafe` blocks leaking.

Previously an `unsafe` block created by the compiler (like those in the
formatting macros) would be "ignored" if surrounded by `unsafe`, that
is, the internal unsafety would be being legitimised by the external
block:

    unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } }

And the code in the inner block would be using the outer block, making
it considered used (and the inner one considered unused).

This patch forces the compiler to create a new unsafe context for
compiler generated blocks, so that their internal unsafety doesn't
escape to external blocks.

Fixes #12418.

10 years agoauto merge of #12397 : alexcrichton/rust/send-off-the-runtime, r=brson
bors [Thu, 20 Feb 2014 11:11:48 +0000 (03:11 -0800)]
auto merge of #12397 : alexcrichton/rust/send-off-the-runtime, r=brson

The fairness yield mistakenly called `Local::take()` which meant that it would
only work if a local task was available. In theory sending on a channel (or calling try_recv) requires
no runtime because it never blocks, so there's no reason it shouldn't support
such a use case.

Closes #12391

10 years agoauto merge of #12343 : liigo/rust/move-extra-test-to-libtest, r=alexcrichton
bors [Thu, 20 Feb 2014 09:51:56 +0000 (01:51 -0800)]
auto merge of #12343 : liigo/rust/move-extra-test-to-libtest, r=alexcrichton

I don't think `extra` is a good/meaningful name for a library. `libextra` should disappear, and we move all of its sub modules out of it. This PR is just one of that steps: move `extra::test` to `libtest`.

I didn't add `libtest` to doc index, because it's an internal library currently.

**Update:**

All comments addressed. All tests passed. Rebased and squashed.

10 years agoauto merge of #12396 : alexcrichton/rust/windows-env-var, r=huonw
bors [Thu, 20 Feb 2014 08:36:53 +0000 (00:36 -0800)]
auto merge of #12396 : alexcrichton/rust/windows-env-var, r=huonw

On windows, the GetEnvironmentVariable function will return the necessary buffer
size if the buffer provided was too small. This case previously fell through the
checks inside of fill_utf16_buf_and_decode, tripping an assertion in the `slice`
method.

This adds an extra case for when the return value is >= the buffer size, in
which case we assume the return value as the new buffer size and try again.

Closes #12376

10 years agomove extra::test to libtest
Liigo Zhuang [Fri, 14 Feb 2014 01:49:11 +0000 (09:49 +0800)]
move extra::test to libtest

10 years agoauto merge of #12392 : aepsil0n/rust/fix/pub_randbigint, r=huonw
bors [Thu, 20 Feb 2014 07:21:50 +0000 (23:21 -0800)]
auto merge of #12392 : aepsil0n/rust/fix/pub_randbigint, r=huonw

Closes #12383.

Test suite did not capture this and can't as long as it is in the same module hierarchy. This is probably something that should be addressed in the future.

10 years agomove enum_set to libcollections. #8784
HeroesGrave [Thu, 20 Feb 2014 06:10:41 +0000 (19:10 +1300)]
move enum_set to libcollections. #8784

10 years agoauto merge of #12244 : pcwalton/rust/deuniquevectorpatterns, r=pcwalton
bors [Thu, 20 Feb 2014 05:56:51 +0000 (21:56 -0800)]
auto merge of #12244 : pcwalton/rust/deuniquevectorpatterns, r=pcwalton

Preparatory work for removing unique vectors from the language, which is
itself preparatory work for dynamically sized types.

r? @brson

10 years agoauto merge of #12394 : huonw/rust/transmute--, r=pnkfelix
bors [Thu, 20 Feb 2014 04:41:51 +0000 (20:41 -0800)]
auto merge of #12394 : huonw/rust/transmute--, r=pnkfelix

These can all be done by implicit or explicit &T -> *T casts, which are
more restricted and so are safer.

10 years agoUpdate comments in the prelude
Palmer Cox [Thu, 20 Feb 2014 03:05:31 +0000 (22:05 -0500)]
Update comments in the prelude

The comments say that the prelude imports std::io::println since it would
be annoying to have to import it in every program that uses it. However,
the prelude doesn't actually import that function anymore. So, update the
comments to better match reality.

10 years agoFix sending/try_recv on channels off the runtime
Alex Crichton [Wed, 19 Feb 2014 16:26:11 +0000 (08:26 -0800)]
Fix sending/try_recv on channels off the runtime

The fairness yield mistakenly called `Local::take()` which meant that it would
only work if a local task was available. In theory sending on a channel (or
calling try_recv) requires no runtime because it never blocks, so there's no
reason it shouldn't support such a use case.

Closes #12391

10 years agolibrustc: Remove unique vector patterns from the language.
Patrick Walton [Thu, 13 Feb 2014 17:46:46 +0000 (09:46 -0800)]
librustc: Remove unique vector patterns from the language.

Preparatory work for removing unique vectors from the language, which is
itself preparatory work for dynamically sized types.

10 years agoauto merge of #12387 : cmr/rust/ast-json, r=alexcrichton
bors [Thu, 20 Feb 2014 00:21:48 +0000 (16:21 -0800)]
auto merge of #12387 : cmr/rust/ast-json, r=alexcrichton

See the commits

10 years agoauto merge of #12389 : zr40/rust/fix-test-metric-typo, r=alexcrichton
bors [Wed, 19 Feb 2014 23:01:50 +0000 (15:01 -0800)]
auto merge of #12389 : zr40/rust/fix-test-metric-typo, r=alexcrichton

10 years agoUpgrade LLVM for segmented stacks on thumb
Alex Crichton [Wed, 19 Feb 2014 22:58:02 +0000 (14:58 -0800)]
Upgrade LLVM for segmented stacks on thumb

This updates the LLVM submodule to the `rust-llvm-2014-02-19` tag which is the
old one with https://github.com/rust-lang/llvm/pull/4 cherry-picked on top.

Awesome job by @neykov for this!

10 years agoResolve the vtables for method calls to generic Drop impls with trait bounds.
Eduard Burtescu [Wed, 19 Feb 2014 22:12:09 +0000 (00:12 +0200)]
Resolve the vtables for method calls to generic Drop impls with trait bounds.

10 years agoadjust to currently used style
kud1ing [Wed, 19 Feb 2014 21:38:15 +0000 (22:38 +0100)]
adjust to currently used style

10 years agoReplaced method_map_entry with method_origin and cleaned up vtable checking a bit.
Eduard Burtescu [Wed, 19 Feb 2014 20:11:45 +0000 (22:11 +0200)]
Replaced method_map_entry with method_origin and cleaned up vtable checking a bit.

10 years agoDon't recurse twice into ExprParen in vtable checking.
Eduard Burtescu [Wed, 19 Feb 2014 20:05:05 +0000 (22:05 +0200)]
Don't recurse twice into ExprParen in vtable checking.

10 years agoauto merge of #12231 : wycats/rust/url_path_parse, r=alexcrichton
bors [Wed, 19 Feb 2014 20:51:48 +0000 (12:51 -0800)]
auto merge of #12231 : wycats/rust/url_path_parse, r=alexcrichton

It is sometimes useful to parse just the path portion of a URL (path,
query string and fragment) rather than the entire URL.

In theory I could have made Url embed a Path, but that would be a
breaking change and I assume that Servo uses this API. I would be
happy to update the PR to embed Path in Url if that's what people
wanted.

10 years agoauto merge of #11904 : nick29581/rust/0filemap, r=alexcrichton
bors [Wed, 19 Feb 2014 19:36:48 +0000 (11:36 -0800)]
auto merge of #11904 : nick29581/rust/0filemap, r=alexcrichton

10 years agorustc: support dumping the AST as JSON
Corey Richardson [Wed, 19 Feb 2014 07:27:49 +0000 (02:27 -0500)]
rustc: support dumping the AST as JSON

This is mostly useful for working on rustc, when one is unfamiliar with the
AST a particular construct will produce. It's a -Z flag as it's very much for
debugging.

Closes #10485

10 years agoauto merge of #12379 : alexcrichton/rust/fix-ar-thing, r=brson
bors [Wed, 19 Feb 2014 18:21:50 +0000 (10:21 -0800)]
auto merge of #12379 : alexcrichton/rust/fix-ar-thing, r=brson

When creating a staticlib, it unzips all static archives it finds and then
inserts the files manually into the output file. This process is done through
`ar`, and `ar` doesn't like if you specify you want to add files and you don't
give it any files.

This case arose whenever you linked to an archive that didn't have any contents
or all of the contents were filtered out. This just involved ignoring the case
where the number of inputs we have is 0, because we don't have any files to add
anyway.

10 years agoauto merge of #12375 : FlaPer87/rust/issue-7660, r=cmr
bors [Wed, 19 Feb 2014 17:01:51 +0000 (09:01 -0800)]
auto merge of #12375 : FlaPer87/rust/issue-7660, r=cmr

10 years agoTweak how preference factors into linkage
Alex Crichton [Mon, 10 Feb 2014 19:33:33 +0000 (11:33 -0800)]
Tweak how preference factors into linkage

The new methodology can be found in the re-worded comment, but the gist of it is
that -C prefer-dynamic doesn't turn off static linkage. The error messages
should also be a little more sane now.

Closes #12133

10 years agodebuginfo: Re-enable test case that should have worked all along.
Michael Woerister [Wed, 19 Feb 2014 16:16:36 +0000 (17:16 +0100)]
debuginfo: Re-enable test case that should have worked all along.

10 years agodebuginfo: Fix a RUSTFLAGS incompatibility in test runner.
Michael Woerister [Wed, 19 Feb 2014 16:11:36 +0000 (17:11 +0100)]
debuginfo: Fix a RUSTFLAGS incompatibility in test runner.

10 years agodebuginfo: Move test case from run-pass to debug-info directory so it does not interf...
Michael Woerister [Wed, 19 Feb 2014 12:56:25 +0000 (13:56 +0100)]
debuginfo: Move test case from run-pass to debug-info directory so it does not interfere with RUSTFLAGS=-g

10 years agodebuginfo: Add support for simd types
Michael Woerister [Wed, 19 Feb 2014 12:54:19 +0000 (13:54 +0100)]
debuginfo: Add support for simd types

10 years agoFix getting/setting huge env vars on windows
Alex Crichton [Wed, 19 Feb 2014 16:11:00 +0000 (08:11 -0800)]
Fix getting/setting huge env vars on windows

On windows, the GetEnvironmentVariable function will return the necessary buffer
size if the buffer provided was too small. This case previously fell through the
checks inside of fill_utf16_buf_and_decode, tripping an assertion in the `slice`
method.

This adds an extra case for when the return value is >= the buffer size, in
which case we assume the return value as the new buffer size and try again.

Closes #12376

10 years agoauto merge of #12374 : dylanbraithwaite/rust/size_of_unit_clarification, r=cmr
bors [Wed, 19 Feb 2014 15:16:48 +0000 (07:16 -0800)]
auto merge of #12374 : dylanbraithwaite/rust/size_of_unit_clarification, r=cmr

Changed the docs for std::mem to clarify the fact that the size functions return sizes in bytes.

10 years agorustc: remove some unnecessary `transmute`s.
Huon Wilson [Wed, 19 Feb 2014 14:31:39 +0000 (01:31 +1100)]
rustc: remove some unnecessary `transmute`s.

These can all be done by implicit or explicit &T -> *T casts, which are
more restricted and so are safer.

10 years agoauto merge of #12349 : edwardw/rust/debug-expansion, r=huonw
bors [Wed, 19 Feb 2014 14:01:45 +0000 (06:01 -0800)]
auto merge of #12349 : edwardw/rust/debug-expansion, r=huonw

Currently, the format_args! macro and its downstream macros in turn
expand to series of let statements, one for each of its arguments, and
then the invocation of the macro function. If one or more of the
arguments are RefCell's, the enclosing statement for the temporary of
the let is the let itself, which leads to scope problem. This patch
changes let's to a match expression.

Closes #12239.

10 years agolibnum: Make RandBigInt trait public
Eduard Bopp [Wed, 19 Feb 2014 13:01:50 +0000 (14:01 +0100)]
libnum: Make RandBigInt trait public

Closes #12383.

10 years agoChange the format_args! macro expansion for temporaries
Edward Wang [Mon, 17 Feb 2014 19:32:12 +0000 (03:32 +0800)]
Change the format_args! macro expansion for temporaries

Currently, the format_args! macro and its downstream macros in turn
expand to series of let statements, one for each of its arguments, and
then the invocation of the macro function. If one or more of the
arguments are RefCell's, the enclosing statement for the temporary of
the let is the let itself, which leads to scope problem. This patch
changes let's to a match expression.

Closes #12239.

10 years agoauto merge of #12370 : rcxdude/rust/macro_fix, r=alexcrichton
bors [Wed, 19 Feb 2014 12:41:45 +0000 (04:41 -0800)]
auto merge of #12370 : rcxdude/rust/macro_fix, r=alexcrichton

Closes #11692. Instead of returning the original expression, a dummy expression
(with identical span) is returned. This prevents infinite loops of failed
expansions as well as odd double error messages in certain situations.

This is a slightly better fix than #12197, because it does not produce a double error and also fixes a few other cases where an infinite loop could happen.

This does not fix the other issue in #11692 (non-builtin macros not being recognised when expanded inside macros), which I think should be moved into a separate issue.

10 years agoauto merge of #12367 : darnuria/rust/tutorial_removing_do_syntax, r=cmr
bors [Wed, 19 Feb 2014 11:26:48 +0000 (03:26 -0800)]
auto merge of #12367 : darnuria/rust/tutorial_removing_do_syntax, r=cmr

The 'do' keyword was deprecated in 0.10 #11868 , and is keep as
reserved keyword  #12157 .

So the tutorial part about it doesn't make sense.
The spawning explanation was move into '15.2 Closure compatibility'.

10 years agoauto merge of #12339 : alexcrichton/rust/rustdoc-fixes, r=sfackler
bors [Wed, 19 Feb 2014 10:11:48 +0000 (02:11 -0800)]
auto merge of #12339 : alexcrichton/rust/rustdoc-fixes, r=sfackler

Commits have the details

10 years agorustdoc: Handle links to reexported items
Alex Crichton [Mon, 17 Feb 2014 07:11:09 +0000 (23:11 -0800)]
rustdoc: Handle links to reexported items

When building up our path cache, we don't plaster over a path which was
previously inserted if we're inserting a non-public-item thing.

Closes #11678

10 years agorustdoc: Clickable links on methods themselves
Alex Crichton [Mon, 17 Feb 2014 06:40:08 +0000 (22:40 -0800)]
rustdoc: Clickable links on methods themselves

Useful for getting the link to a method or function.

Closes #10332

10 years agorustdoc: Fix json output and input
Alex Crichton [Mon, 17 Feb 2014 06:31:05 +0000 (22:31 -0800)]
rustdoc: Fix json output and input

Turns out a hash map with integer keys isn't serializable to json.

Closes #10115

10 years agorustdoc: Highlight methods jumped to
Alex Crichton [Mon, 17 Feb 2014 05:56:14 +0000 (21:56 -0800)]
rustdoc: Highlight methods jumped to

This helps figure out where you actually jumped to, especially if the thing you
jumped to is at the very bottom of the page.

Closes #9905

10 years agorustdoc: Show macros in documentation
Alex Crichton [Mon, 17 Feb 2014 05:40:26 +0000 (21:40 -0800)]
rustdoc: Show macros in documentation

Any macro tagged with #[macro_export] will be showed in the documentation for
that module. This also documents all the existing macros inside of std::macros.

Closes #3163
cc #5605
Closes #9954

10 years agorustdoc: Fixup links to enum variants
Alex Crichton [Sun, 16 Feb 2014 22:35:13 +0000 (14:35 -0800)]
rustdoc: Fixup links to enum variants

Pages aren't emitted for enum variants, so whenever we're linking to an enum
variant instead link to the parent enum instead.

Closes #12289

10 years agoauto merge of #12364 : Armavica/rust/mk-tips, r=alexcrichton
bors [Wed, 19 Feb 2014 08:56:51 +0000 (00:56 -0800)]
auto merge of #12364 : Armavica/rust/mk-tips, r=alexcrichton

The command `make tips` did not work properly because of a flaw in the regexp parsing Makefile.in for documentation (`SHOW_DOCS`). I fixed it and also added a note about `make clean` in the build documentation (`make help`).

10 years agoFix typo in test metric ratchet stdout output
Matthijs van der Vleuten [Thu, 13 Feb 2014 10:42:59 +0000 (11:42 +0100)]
Fix typo in test metric ratchet stdout output

10 years agoauto merge of #12361 : sfackler/rust/rustdoc-test-extern, r=alexcrichton
bors [Wed, 19 Feb 2014 06:16:47 +0000 (22:16 -0800)]
auto merge of #12361 : sfackler/rust/rustdoc-test-extern, r=alexcrichton

10 years agorustdoc: Only inject extern crates if not present
Steven Fackler [Tue, 18 Feb 2014 04:43:32 +0000 (20:43 -0800)]
rustdoc: Only inject extern crates if not present

10 years agoauto merge of #12317 : huonw/rust/utf16, r=alexcrichton
bors [Wed, 19 Feb 2014 03:26:50 +0000 (19:26 -0800)]
auto merge of #12317 : huonw/rust/utf16, r=alexcrichton

Iterators! Use them (in `is_utf16`), create them (in `utf16_items`).

Handle errors gracefully (`from_utf16_lossy`) and `from_utf16` returning `Option<~str>` instead of failing.

Add a pile of tests.

10 years agostr: add a function for truncating a vector of u16 at NUL.
Huon Wilson [Tue, 18 Feb 2014 11:25:32 +0000 (22:25 +1100)]
str: add a function for truncating a vector of u16 at NUL.

Many of the functions interacting with Windows APIs allocate a vector of
0's and do not retrieve a length directly from the API call, and so need
to be sure to remove the unmodified junk at the end of the vector.

10 years agoauto merge of #12245 : nick29581/rust/priv2, r=alexcrichton
bors [Wed, 19 Feb 2014 02:11:48 +0000 (18:11 -0800)]
auto merge of #12245 : nick29581/rust/priv2, r=alexcrichton

closes #4110

10 years agoMake priavcy checking aware that a `use` directive can point to two defintions (names...
Nick Cameron [Tue, 11 Feb 2014 19:19:18 +0000 (08:19 +1300)]
Make priavcy checking aware that a `use` directive can point to two defintions (namespaces) with different privacy. Closes #4110

10 years agoFix bug with zero-length filemaps and rename bytepos_to_local_charpos to bytepos_to_c...
Nick Cameron [Wed, 19 Feb 2014 01:24:07 +0000 (14:24 +1300)]
Fix bug with zero-length filemaps and rename bytepos_to_local_charpos to bytepos_to_charpos.

10 years agoFix staticlib outputs linking to blank archives
Alex Crichton [Wed, 19 Feb 2014 00:05:05 +0000 (16:05 -0800)]
Fix staticlib outputs linking to blank archives

When creating a staticlib, it unzips all static archives it finds and then
inserts the files manually into the output file. This process is done through
`ar`, and `ar` doesn't like if you specify you want to add files and you don't
give it any files.

This case arose whenever you linked to an archive that didn't have any contents
or all of the contents were filtered out. This just involved ignoring the case
where the number of inputs we have is 0, because we don't have any files to add
anyway.

10 years agoauto merge of #12359 : alexcrichton/rust/update-compiler-rt, r=luqmana
bors [Tue, 18 Feb 2014 21:41:49 +0000 (13:41 -0800)]
auto merge of #12359 : alexcrichton/rust/update-compiler-rt, r=luqmana

Closes #12356

10 years agoRegression test closes #7660
Flavio Percoco [Tue, 18 Feb 2014 20:55:18 +0000 (21:55 +0100)]
Regression test closes #7660

10 years agoClarify unit of size in docs for size_of functions.
Dylan Braithwaite [Tue, 18 Feb 2014 20:30:21 +0000 (20:30 +0000)]
Clarify unit of size in docs for size_of functions.
Changed the docs in mem.rs to clarify the fact the the size functions return sizes in bytes.

10 years agoauto merge of #12357 : chromatic/rust/gh_11976_fail_bounds_check_str, r=alexcrichton
bors [Tue, 18 Feb 2014 20:21:45 +0000 (12:21 -0800)]
auto merge of #12357 : chromatic/rust/gh_11976_fail_bounds_check_str, r=alexcrichton

Fixes #11976.

10 years agoauto merge of #12336 : kballard/rust/mutexarc-no-freeze, r=alexcrichton
bors [Tue, 18 Feb 2014 18:16:48 +0000 (10:16 -0800)]
auto merge of #12336 : kballard/rust/mutexarc-no-freeze, r=alexcrichton

With Rc no longer trying to statically prevent cycles (and thus no
longer using the Freeze bound), it seems appropriate to remove that
restriction from MutexArc as well.

Closes #9251.

10 years agoauto merge of #12330 : nick29581/rust/glue, r=huonw
bors [Tue, 18 Feb 2014 16:56:51 +0000 (08:56 -0800)]
auto merge of #12330 : nick29581/rust/glue, r=huonw

closes #3290

10 years agoAvoid returning original macro if expansion fails.
Douglas Young [Tue, 18 Feb 2014 16:14:12 +0000 (16:14 +0000)]
Avoid returning original macro if expansion fails.

Closes #11692. Instead of returning the original expression, a dummy expression
(with identical span) is returned. This prevents infinite loops of failed
expansions as well as odd double error messages in certain situations.

10 years agoauto merge of #12354 : alexcrichton/rust/fix-rustuv-segfault, r=cmr
bors [Tue, 18 Feb 2014 14:46:55 +0000 (06:46 -0800)]
auto merge of #12354 : alexcrichton/rust/fix-rustuv-segfault, r=cmr

The details can be found in the comments I added to the test, but the gist of it
is that capturing output injects rescheduling a green task on failure, which
wasn't desired for the test in question.

cc #12340

10 years agoRemoving '15.3 Do syntax' in tutorial.
Axel Viala [Tue, 18 Feb 2014 14:39:32 +0000 (15:39 +0100)]
Removing '15.3 Do syntax' in tutorial.

The 'do' keyword was deprecated in 0.10 #11868 , and is keep as
reserved keyword #12157 .

So the tutorial part about it doesn't make sense.
The spawning explanation was move into '15.2 Closure compatibility'.

Fixing misspelling.

Thanks for precisions.

Moved from 15.2 to 15.1.

Fixed typo, and apply pnkfelix advices.

10 years agoauto merge of #12351 : kud1ing/rust/backticks, r=alexcrichton
bors [Tue, 18 Feb 2014 13:31:55 +0000 (05:31 -0800)]
auto merge of #12351 : kud1ing/rust/backticks, r=alexcrichton

10 years agoauto merge of #12314 : huonw/rust/is_utf8_iter, r=kballard
bors [Tue, 18 Feb 2014 12:06:48 +0000 (04:06 -0800)]
auto merge of #12314 : huonw/rust/is_utf8_iter, r=kballard

See the commit messages for more details, but this makes `std::str::is_utf8` slightly faster and 100% non-`unsafe` and uses a similar thing to make the first scan of `from_utf8_lossy` 100% safe & faster.

10 years agostd: convert first_non_utf8_byte to use the iterator.
Huon Wilson [Sun, 16 Feb 2014 06:12:47 +0000 (17:12 +1100)]
std: convert first_non_utf8_byte to use the iterator.

This makes it very slightly faster, especially when the string is valid
UTF-8, and completely removes the use of `unsafe` from the first half.

Before:

    from_utf8_lossy_100_ascii              ... bench:       151 ns/iter (+/- 17)
    from_utf8_lossy_100_invalid            ... bench:       447 ns/iter (+/- 33)
    from_utf8_lossy_100_multibyte          ... bench:       135 ns/iter (+/- 4)
    from_utf8_lossy_invalid                ... bench:       124 ns/iter (+/- 10

After:

    from_utf8_lossy_100_ascii              ... bench:       119 ns/iter (+/- 8)
    from_utf8_lossy_100_invalid            ... bench:       454 ns/iter (+/- 16)
    from_utf8_lossy_100_multibyte          ... bench:       116 ns/iter (+/- 9)
    from_utf8_lossy_invalid                ... bench:       119 ns/iter (+/- 9)

10 years agostd::str: safen and optimize is_utf8.
Huon Wilson [Sun, 16 Feb 2014 05:11:47 +0000 (16:11 +1100)]
std::str: safen and optimize is_utf8.

This uses a vector iterator to avoid the necessity for unsafe indexing,
and makes this function slightly faster. Unfortunately #11751 means that
the iterator comes with repeated `null` checks which means the
pure-ASCII case still has room for significant improvement (and the
other cases too, but it's most significant for just ASCII).

Before:

    is_utf8_100_ascii             ... bench:       143 ns/iter (+/- 6)
    is_utf8_100_multibyte         ... bench:       134 ns/iter (+/- 4)

After:

    is_utf8_100_ascii             ... bench:       123 ns/iter (+/- 4)
    is_utf8_100_multibyte         ... bench:       115 ns/iter (+/- 5)

10 years agomk: Talk about `make clean` in the build help
Virgile Andreani [Tue, 18 Feb 2014 10:55:34 +0000 (11:55 +0100)]
mk: Talk about `make clean` in the build help

10 years agomk: Fix the regexp of SHOW_DOCS
Virgile Andreani [Tue, 18 Feb 2014 10:53:23 +0000 (11:53 +0100)]
mk: Fix the regexp of SHOW_DOCS

The tag marks were missing, and `make tips` didn't work.

10 years agoauto merge of #12345 : huonw/rust/speeling, r=cmr
bors [Tue, 18 Feb 2014 10:51:49 +0000 (02:51 -0800)]
auto merge of #12345 : huonw/rust/speeling, r=cmr

10 years agoauto merge of #12342 : ehsanul/rust/remove-shared-chan-tasks-guide, r=alexcrichton
bors [Tue, 18 Feb 2014 09:36:51 +0000 (01:36 -0800)]
auto merge of #12342 : ehsanul/rust/remove-shared-chan-tasks-guide, r=alexcrichton

The code examples are up to date, but the surrounding explanations are not.

10 years agoauto merge of #12321 : bjz/rust/remove-real, r=alexcrichton
bors [Tue, 18 Feb 2014 06:16:51 +0000 (22:16 -0800)]
auto merge of #12321 : bjz/rust/remove-real, r=alexcrichton

This is part of the effort to simplify `std::num`, as tracked in issue #10387. It is also a step towards a proper IEEE-754 trait (see #12281).

10 years agoauto merge of #12103 : alexcrichton/rust/unix, r=brson
bors [Tue, 18 Feb 2014 04:01:52 +0000 (20:01 -0800)]
auto merge of #12103 : alexcrichton/rust/unix, r=brson

There's a few parts to this PR

* Implement unix pipes in libnative for unix platforms (thanks @Geal!)
* Implement named pipes in libnative for windows (terrible, terrible code)
* Remove `#[cfg(unix)]` from `mod unix` in `std::io::net`. This is a terrible name for what it is, but that's the topic of #12093.

The windows implementation was significantly more complicated than I thought it would be, but it seems to be passing all the tests. now.

Closes #11201

10 years agoUpdate compiler-rt
Alex Crichton [Tue, 18 Feb 2014 03:58:47 +0000 (19:58 -0800)]
Update compiler-rt

Closes #12356

10 years agoMade fail_bounds_check more careful with strings.
chromatic [Tue, 18 Feb 2014 02:38:23 +0000 (18:38 -0800)]
Made fail_bounds_check more careful with strings.

Fixes GH #11976.

10 years agoTest ordering of glue_drop and glue_takew in self-re-assignment. Closes #3290.
Nick Cameron [Sun, 16 Feb 2014 22:53:12 +0000 (11:53 +1300)]
Test ordering of glue_drop and glue_takew in self-re-assignment. Closes #3290.

10 years agoauto merge of #12243 : dguenther/rust/extend-tidy, r=alexcrichton
bors [Tue, 18 Feb 2014 02:46:48 +0000 (18:46 -0800)]
auto merge of #12243 : dguenther/rust/extend-tidy, r=alexcrichton

Extends the license and formatting check to `*.js` files in `src/doc` and `*.sh`, `*.pl`, `*.c`, and `*.h` files in `src/etc`. As best as I could tell, these files should be covered under the Rust project license.

cc @brson: Do any other scripts need a license? I'd like to double-check that this PR closes #4534.

10 years agoauto merge of #12232 : kballard/rust/taskbuilder-is-a-builder, r=alexcrichton
bors [Tue, 18 Feb 2014 01:31:52 +0000 (17:31 -0800)]
auto merge of #12232 : kballard/rust/taskbuilder-is-a-builder, r=alexcrichton

Delete all the documentation from std::task that references linked
failure.

Tweak TaskBuilder to be more builder-like. `.name()` is now `.named()` and
`.add_wrapper()` is now `.with_wrapper()`. Remove `.watched()` and
`.unwatched()` as they didn't actually do anything.

Closes #6399.

10 years agoauto merge of #12146 : gentlefolk/rust/issue-2404, r=alexcrichton
bors [Tue, 18 Feb 2014 00:11:52 +0000 (16:11 -0800)]
auto merge of #12146 : gentlefolk/rust/issue-2404, r=alexcrichton

Addresses FIXME described in issue #2404

10 years agoUpdated metadata::creader::resolve_crate_deps to use the correct span. Clarified...
gentlefolk [Mon, 10 Feb 2014 03:29:21 +0000 (22:29 -0500)]
Updated metadata::creader::resolve_crate_deps to use the correct span. Clarified error message when an external crate's dependency is missing. Closes #2404.

10 years agoFix a segfault in the rustuv tests
Alex Crichton [Mon, 17 Feb 2014 22:41:33 +0000 (14:41 -0800)]
Fix a segfault in the rustuv tests

The details can be found in the comments I added to the test, but the gist of it
is that capturing output injects rescheduling a green task on failure, which
wasn't desired for the test in question.

cc #12340

10 years agoauto merge of #12352 : alexcrichton/rust/fix-master, r=brson
bors [Mon, 17 Feb 2014 22:16:53 +0000 (14:16 -0800)]
auto merge of #12352 : alexcrichton/rust/fix-master, r=brson

This deadlock was caused when the channel was closed at just the right time, so
the extra `self.cnt.fetch_add` actually should have preserved the DISCONNECTED
state of the channel. by modifying this the channel entered a state such that
the port would never succeed in dropping.

This also moves the increment of self.steals until after the MAX_STEALS block.
The reason for this is that in 'fn recv()' the steals variable is decremented
immediately after the try_recv(), which could in theory set steals to -1 if it
was previously set to 0 in try_recv().

Closes #12340