]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoLink rustllvm statically, and distribute a static snapshot
Alex Crichton [Sun, 1 Dec 2013 04:52:21 +0000 (20:52 -0800)]
Link rustllvm statically, and distribute a static snapshot

In order to keep up to date with changes to the libraries that `llvm-config`
spits out, the dependencies to the LLVM are a dynamically generated rust file.
This file is now automatically updated whenever LLVM is updated to get kept
up-to-date.

At the same time, this cleans out some old cruft which isn't necessary in the
makefiles in terms of dependencies.

Closes #10745
Closes #10744

10 years agoauto merge of #10832 : chris-morgan/rust/let's-lop-lang-item-line-count, r=alexcrichton
bors [Fri, 6 Dec 2013 09:11:18 +0000 (01:11 -0800)]
auto merge of #10832 : chris-morgan/rust/let's-lop-lang-item-line-count, r=alexcrichton

This should make maintenance of lang items simpler and also reduces the
line count by about 201 lines.

10 years agoauto merge of #10665 : cmr/rust/doc_lint, r=alexcrichton
bors [Fri, 6 Dec 2013 07:41:19 +0000 (23:41 -0800)]
auto merge of #10665 : cmr/rust/doc_lint, r=alexcrichton

Because the root module isn't actually an item, we need to do some hackish
handling of it.

Closes #10656.

10 years agoCheck crate root for docs in missing_doc lint.
Corey Richardson [Tue, 26 Nov 2013 06:12:14 +0000 (01:12 -0500)]
Check crate root for docs in missing_doc lint.

Because the root module isn't actually an item, we need to do some hackish
handling of it.

Closes #10656.

10 years agoauto merge of #10758 : alexcrichton/rust/upgrade-llvm, r=alexcrichton
bors [Fri, 6 Dec 2013 05:26:19 +0000 (21:26 -0800)]
auto merge of #10758 : alexcrichton/rust/upgrade-llvm, r=alexcrichton

This upgrades LLVM in order to make progress on #10708, and it's also been awhile since we last upgraded!

The contentious point of this upgrade is that all JIT support has been removed because LLVM is changing it and we're not keeping up with it.

10 years agoUse a macro in lang_items to remove duplication.
Chris Morgan [Fri, 6 Dec 2013 04:24:25 +0000 (15:24 +1100)]
Use a macro in lang_items to remove duplication.

This should make maintenance of lang items simpler and also reduces the
line count by about 201 lines.

10 years agoauto merge of #10721 : osa1/rust/intermediatestr, r=brson
bors [Fri, 6 Dec 2013 02:56:19 +0000 (18:56 -0800)]
auto merge of #10721 : osa1/rust/intermediatestr, r=brson

as recommended by @huonw on this PR https://github.com/mozilla/rust/pull/10711 , I removed intermediate step that generates a string instead of directly writing to Writer without generating intermediate string.

10 years agoauto merge of #10675 : LeoTestard/rust/lifetimes-no-keywords, r=brson
bors [Fri, 6 Dec 2013 01:41:18 +0000 (17:41 -0800)]
auto merge of #10675 : LeoTestard/rust/lifetimes-no-keywords, r=brson

Fixes #10565.

`'self` is still allowed for the moment, as it is used everywhere in the codebase. And I'm not sure if it still has a special meaning currently or not.

10 years agoRemove unused upcalls
Alex Crichton [Thu, 28 Nov 2013 22:16:17 +0000 (14:16 -0800)]
Remove unused upcalls

The main one removed is rust_upcall_reset_stack_limit (continuation of #10156),
and this also removes the upcall_trace function. The was hidden behind a
`-Z trace` flag, but if you attempt to use this now you'll get a linker error
because there is no implementation of the 'upcall_trace' function. Due to this
no longer working, I decided to remove it entirely from the compiler (I'm also a
little unsure on what it did in the first place).

10 years agoauto merge of #10506 : nikomatsakis/rust/issue-10391-ICE-with-lifetimes, r=pnkfelix
bors [Fri, 6 Dec 2013 00:26:20 +0000 (16:26 -0800)]
auto merge of #10506 : nikomatsakis/rust/issue-10391-ICE-with-lifetimes, r=pnkfelix

Make trait lifetime parameters early bound in static fn type. Reasoning for this change is (hopefully) explained well enough in the comment, so I'll not duplicate it here. Fixes #10391.

r? @pnkfelix

10 years agoFix test for #10391 to have pub main
Niko Matsakis [Thu, 5 Dec 2013 23:25:01 +0000 (18:25 -0500)]
Fix test for #10391 to have pub main

10 years agoauto merge of #10562 : ongardie/rust/master, r=brson
bors [Thu, 5 Dec 2013 23:16:27 +0000 (15:16 -0800)]
auto merge of #10562 : ongardie/rust/master, r=brson

It's useful to allow users to get at the internal std::rc::comm::Port,
and other such fields, since they implement important traits like
Select.

See [rust-dev] "select on std::comm::Port and different types" at https://mail.mozilla.org/pipermail/rust-dev/2013-November/006735.html for background.

10 years agoauto merge of #10817 : alexcrichton/rust/sched-fix, r=brson
bors [Thu, 5 Dec 2013 22:01:46 +0000 (14:01 -0800)]
auto merge of #10817 : alexcrichton/rust/sched-fix, r=brson

Right now, as pointed out in #8132, it is very easy to introduce a subtle race
in the runtime. I believe that this is the cause of the current flakiness on the
bots.

I have taken the last idea mentioned in that issue which is to use a lock around
descheduling and context switching in order to solve this race.

Closes #8132

10 years agoauto merge of #10211 : ktt3ja/rust/add-lrucache, r=brson
bors [Thu, 5 Dec 2013 20:32:12 +0000 (12:32 -0800)]
auto merge of #10211 : ktt3ja/rust/add-lrucache, r=brson

There's an open issue ([Issue #4988](https://github.com/mozilla/rust/issues/4988?source=cc)) for adding an LRU Cache to the standard library. I'm new to this so I hope I didn't miss anything I'm supposed to do.

10 years agoForbid keywords as lifetime parameters names.
Léo Testard [Tue, 26 Nov 2013 15:35:12 +0000 (16:35 +0100)]
Forbid keywords as lifetime parameters names.

10 years agoauto merge of #10825 : octurion/rust/master, r=alexcrichton
bors [Thu, 5 Dec 2013 17:46:29 +0000 (09:46 -0800)]
auto merge of #10825 : octurion/rust/master, r=alexcrichton

10 years agoSolve some nasty deschedulinging races with a lock
Alex Crichton [Thu, 5 Dec 2013 03:51:29 +0000 (19:51 -0800)]
Solve some nasty deschedulinging races with a lock

Right now, as pointed out in #8132, it is very easy to introduce a subtle race
in the runtime. I believe that this is the cause of the current flakiness on the
bots.

I have taken the last idea mentioned in that issue which is to use a lock around
descheduling and context switching in order to solve this race.

Closes #8132

10 years agoUpdate LLVM and jettison jit support
Alex Crichton [Sun, 1 Dec 2013 22:37:15 +0000 (14:37 -0800)]
Update LLVM and jettison jit support

LLVM's JIT has been updated numerous times, and we haven't been tracking it at
all. The existing LLVM glue code no longer compiles, and the JIT isn't used for
anything currently.

This also rebases out the FixedStackSegment support which we have added to LLVM.
None of this is still in use by the compiler, and there's no need to keep this
functionality around inside of LLVM.

This is needed to unblock #10708 (where we're tripping an LLVM assertion).

10 years agoFix documentation typo (divison operator is not backslash)
Alexandros Tasos [Thu, 5 Dec 2013 14:24:48 +0000 (16:24 +0200)]
Fix documentation typo (divison operator is not backslash)

10 years agoauto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichton
bors [Thu, 5 Dec 2013 07:26:19 +0000 (23:26 -0800)]
auto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichton

Rename the `*::init()` functions back to `*::new()`, since `new` is not
going to become a keyword.

10 years agoRename std::rt::deque::*::init() to *::new()
Kevin Ballard [Wed, 4 Dec 2013 03:37:57 +0000 (19:37 -0800)]
Rename std::rt::deque::*::init() to *::new()

10 years agoRename extra::json::*::init() constructors to *::new()
Kevin Ballard [Wed, 4 Dec 2013 03:18:35 +0000 (19:18 -0800)]
Rename extra::json::*::init() constructors to *::new()

10 years agoRevert "libstd: Change `Path::new` to `Path::init`."
Kevin Ballard [Wed, 4 Dec 2013 03:15:12 +0000 (19:15 -0800)]
Revert "libstd: Change `Path::new` to `Path::init`."

This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.

Leave the #[ignores] in that were added to rustpkg tests.

Conflicts:
src/librustc/driver/driver.rs
src/librustc/metadata/creader.rs

10 years agoauto merge of #10804 : alexcrichton/rust/less-dup, r=pcwalton
bors [Thu, 5 Dec 2013 06:11:22 +0000 (22:11 -0800)]
auto merge of #10804 : alexcrichton/rust/less-dup, r=pcwalton

This is just an implementation detail of using libuv, so move the libuv-specific
logic into librustuv.

10 years agoauto merge of #10799 : TeXitoi/rust/shootout-reverse-complement-resurected, r=alexcri...
bors [Thu, 5 Dec 2013 04:46:23 +0000 (20:46 -0800)]
auto merge of #10799 : TeXitoi/rust/shootout-reverse-complement-resurected, r=alexcrichton

This version is inspired by the best version in C by Mr Ledrug,
but without the parallelisation.

10 years agoauto merge of #10803 : vmx/rust/integer-decode, r=cmr
bors [Thu, 5 Dec 2013 02:46:21 +0000 (18:46 -0800)]
auto merge of #10803 : vmx/rust/integer-decode, r=cmr

The `integer_decode()` function decodes a float (f32/f64)
into integers containing the mantissa, exponent and sign.

It's needed for `rationalize()` implementation of #9838.

The code got ported from ABCL [1].

[1] http://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java?rev=14465#L94

I got the permission to use this code for Rust from Peter Graves (the ABCL copyright holder) . If there's any further IP clearance needed, let me know.

10 years agoauto merge of #10690 : thestinger/rust/doc, r=alexcrichton
bors [Thu, 5 Dec 2013 00:51:23 +0000 (16:51 -0800)]
auto merge of #10690 : thestinger/rust/doc, r=alexcrichton

This begins a rewrite of some sections the tutorial as an introduction
to concepts through the implementation of a simple data structure. I
think this would be a good way to introduce references, generics, traits
and many other concepts too. For example, the section introducing
alternatives to ownership can demonstrate a persistent list.

10 years agorewrite part of the tutorial
Daniel Micay [Wed, 27 Nov 2013 07:43:52 +0000 (02:43 -0500)]
rewrite part of the tutorial

This begins a rewrite of some sections the tutorial as an introduction
to concepts through the implementation of a simple data structure. I
think this would be a good way to introduce references, traits and many
other concepts too. For example, the section introducing alternatives to
ownership can demonstrate a persistent list.

10 years agoauto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, r=alexcrichton
bors [Wed, 4 Dec 2013 21:31:45 +0000 (13:31 -0800)]
auto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, r=alexcrichton

The comments on this function date back from when it was used for `for`
expressions in addition to `do` expressions.

10 years agoauto merge of #10701 : huonw/rust/rm-from_utf8, r=brson
bors [Wed, 4 Dec 2013 19:32:23 +0000 (11:32 -0800)]
auto merge of #10701 : huonw/rust/rm-from_utf8, r=brson

This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.

10 years agorewrite of shootout-reverse-complement.rs
Guillaume Pinot [Wed, 4 Dec 2013 08:03:55 +0000 (09:03 +0100)]
rewrite of shootout-reverse-complement.rs

This version is inspired by the best version in C by Mr Ledrug,
but without the parallelisation.

10 years agoDon't dup the stdio file descriptors.
Alex Crichton [Wed, 4 Dec 2013 16:51:47 +0000 (08:51 -0800)]
Don't dup the stdio file descriptors.

This is just an implementation detail of using libuv, so move the libuv-specific
logic into librustuv.

10 years agoauto merge of #10788 : alexcrichton/rust/fixes, r=pcwalton
bors [Wed, 4 Dec 2013 16:12:11 +0000 (08:12 -0800)]
auto merge of #10788 : alexcrichton/rust/fixes, r=pcwalton

I used the wrong condition where I was looking for "is this method public or is
this implementation a trait" rather than what was being checked.

10 years agoDecode a float into integers
Volker Mische [Sun, 1 Dec 2013 23:47:19 +0000 (00:47 +0100)]
Decode a float into integers

The `integer_decode()` function decodes a float (f32/f64)
into integers containing the mantissa, exponent and sign.

It's needed for `rationalize()` implementation of #9838.

The code got ported from ABCL [1].

[1] http://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java?rev=14465#L94

10 years agoauto merge of #10794 : alexcrichton/rust/issue-10790, r=alexcrichton
bors [Wed, 4 Dec 2013 13:26:35 +0000 (05:26 -0800)]
auto merge of #10794 : alexcrichton/rust/issue-10790, r=alexcrichton

Note entirely sure how this is passing at all today, but regardless this fixes
the problems seen in #10790

Closes #10790

10 years agoauto merge of #10793 : chris-morgan/rust/2013-12-04-vim-updates, r=Aatch
bors [Wed, 4 Dec 2013 12:11:26 +0000 (04:11 -0800)]
auto merge of #10793 : chris-morgan/rust/2013-12-04-vim-updates, r=Aatch

- Implement comment nesting (the implementation is quite ugly at present
  and is not quite correct; note the big comment in that area).

- Highlight invalid escape sequences as errors.

- Fix up various inconsistencies and incorrectnesses in number
  highlighting.

- Update prelude items (``std::io::{Buffer, Writer, Reader, Seek}``).

- Highlight the ``proc`` keyword.

- Remove %-formatting sequence highlighting (a relic of old formatting).

- Don't highlight TODO in strings (it's unconventional).

10 years agostd::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.
Huon Wilson [Sun, 1 Dec 2013 13:33:04 +0000 (00:33 +1100)]
std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.

10 years agostd::str: remove from_utf8.
Huon Wilson [Thu, 28 Nov 2013 12:52:11 +0000 (23:52 +1100)]
std::str: remove from_utf8.

This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.

10 years agoauto merge of #10783 : sfackler/rust/drop, r=alexcrichton
bors [Wed, 4 Dec 2013 09:36:29 +0000 (01:36 -0800)]
auto merge of #10783 : sfackler/rust/drop, r=alexcrichton

It's a more fitting name for the most common use case of this function.

10 years agoauto merge of #10776 : alexcrichton/rust/issue-9725, r=pcwalton
bors [Wed, 4 Dec 2013 07:56:25 +0000 (23:56 -0800)]
auto merge of #10776 : alexcrichton/rust/issue-9725, r=pcwalton

Closes #9725

10 years agoauto merge of #10785 : alexcrichton/rust/omg-i-hate-windows, r=pcwalton
bors [Wed, 4 Dec 2013 05:11:26 +0000 (21:11 -0800)]
auto merge of #10785 : alexcrichton/rust/omg-i-hate-windows, r=pcwalton

Turns out LLVM only builds libfoo.a libraries, so we're going to need this logic
to statically link librustc

10 years agoMove std::util::ignore to std::prelude::drop
Steven Fackler [Tue, 3 Dec 2013 06:37:26 +0000 (22:37 -0800)]
Move std::util::ignore to std::prelude::drop

It's a more fitting name for the most common use case of this function.

10 years agoDon't infinitely recurse in a process test
Alex Crichton [Wed, 4 Dec 2013 03:17:45 +0000 (19:17 -0800)]
Don't infinitely recurse in a process test

Note entirely sure how this is passing at all today, but regardless this fixes
the problems seen in #10790

10 years agoauto merge of #10752 : dhodder/rust/master, r=pcwalton
bors [Wed, 4 Dec 2013 02:31:36 +0000 (18:31 -0800)]
auto merge of #10752 : dhodder/rust/master, r=pcwalton

10 years agoImprove various Vim syntax highlighting things.
Chris Morgan [Wed, 4 Dec 2013 01:41:56 +0000 (12:41 +1100)]
Improve various Vim syntax highlighting things.

- Implement comment nesting (the implementation is quite ugly at present
  and is not quite correct; note the big comment in that area).

- Highlight invalid escape sequences as errors.

- Fix up various inconsistencies and incorrectnesses in number
  highlighting.

- Update prelude items (``std::io::{Buffer, Writer, Reader, Seek}``).

- Highlight the ``proc`` keyword.

- Remove %-formatting sequence highlighting (a relic of old formatting).

- Don't highlight TODO in strings (it's unconventional).

10 years agoFix the comments for libsyntax::parse::parser::parse_sugary_call_expr
Kevin Ballard [Wed, 4 Dec 2013 00:55:00 +0000 (16:55 -0800)]
Fix the comments for libsyntax::parse::parser::parse_sugary_call_expr

The comments on this function date back from when it was used for `for`
expressions in addition to `do` expressions.

10 years agoMake trait lifetime parameters early bound in static fn type. This is related
Niko Matsakis [Fri, 15 Nov 2013 22:04:01 +0000 (17:04 -0500)]
Make trait lifetime parameters early bound in static fn type.  This is related
to #5121.

Fixes #10391.

10 years agoFix a bug in exporting trait implementations
Alex Crichton [Tue, 3 Dec 2013 23:15:17 +0000 (15:15 -0800)]
Fix a bug in exporting trait implementations

I used the wrong condition where I was looking for "is this method public or is
this implementation a trait" rather than what was being checked.

10 years agoauto merge of #10747 : alexcrichton/rust/snapshots, r=cmr
bors [Tue, 3 Dec 2013 22:36:59 +0000 (14:36 -0800)]
auto merge of #10747 : alexcrichton/rust/snapshots, r=cmr

This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies).

This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot.

There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.

10 years agoRegister new snapshots
Alex Crichton [Sun, 1 Dec 2013 00:38:07 +0000 (16:38 -0800)]
Register new snapshots

10 years agoauto merge of #10768 : Blei/rust/logging-enabled-macros, r=alexcrichton
bors [Tue, 3 Dec 2013 20:11:25 +0000 (12:11 -0800)]
auto merge of #10768 : Blei/rust/logging-enabled-macros, r=alexcrichton

This is useful when the information that is needed to do useful logging
is expensive to produce.

10 years agoauto merge of #10757 : TeXitoi/rust/mut-split-iter, r=alexcrichton
bors [Tue, 3 Dec 2013 18:11:25 +0000 (10:11 -0800)]
auto merge of #10757 : TeXitoi/rust/mut-split-iter, r=alexcrichton

I've renamed `MutableVector::mut_split(at)` to `MutableVector::mut_split_at(at)` to be coherent with ImmutableVector.  As specified in the commit log, The `size_hint` method is not optimal because of #9629.

10 years agoSearch for libfoo.a on windows as well as foo.lib
Alex Crichton [Tue, 3 Dec 2013 16:59:09 +0000 (08:59 -0800)]
Search for libfoo.a on windows as well as foo.lib

Turns out LLVM only builds libfoo.a libraries, so we're going to need this logic
to statically link librustc

10 years agoadd MutableVector::mut_split(self, pred) -> DoubleEndedIterator<&mut [T]>
Guillaume Pinot [Sun, 1 Dec 2013 17:50:34 +0000 (18:50 +0100)]
add MutableVector::mut_split(self, pred) -> DoubleEndedIterator<&mut [T]>

This method is the mutable version of ImmutableVector::split.  It is
a DoubleEndedIterator, making mut_rsplit irrelevent.  The size_hint
method is not optimal because of #9629.

At the same time, clarify *split* iterator doc.

10 years agoauto merge of #10777 : alexcrichton/rust/issue-10743, r=luqmana
bors [Tue, 3 Dec 2013 16:21:26 +0000 (08:21 -0800)]
auto merge of #10777 : alexcrichton/rust/issue-10743, r=luqmana

Commit messages have the fun details, the focus of this is closing #10743 though

10 years agoResume propagation of linking to native dylibs
Alex Crichton [Mon, 2 Dec 2013 22:37:30 +0000 (14:37 -0800)]
Resume propagation of linking to native dylibs

The reasons for this are outlined in issue #10743 as well as the comment I have
now placed in the code.

Closes #10743

10 years agoTidy up a few problems with run-make tests
Alex Crichton [Mon, 2 Dec 2013 22:51:47 +0000 (14:51 -0800)]
Tidy up a few problems with run-make tests

Use the correct set of dependencies as well as CFG_PYTHON instead of assuming
'python' is the right one.

10 years agoContinue tightening holes in reachability
Alex Crichton [Mon, 2 Dec 2013 01:56:55 +0000 (17:56 -0800)]
Continue tightening holes in reachability

* Don't flag any address_insignificant statics as reachable because the whole
  point of the address_insignificant optimization is that the static is not
  reachable. Additionally, there's no need for it to be reachable because LLVM
  optimizes it away.

* Be sure to not leak external node ids into our reachable set, this can
  spuriously cause local items to be considered reachable if the node ids just
  happen to line up

10 years agoauto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger
bors [Tue, 3 Dec 2013 09:51:26 +0000 (01:51 -0800)]
auto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.

10 years agoauto merge of #10773 : jvns/rust/patch-1, r=cmr
bors [Tue, 3 Dec 2013 07:32:33 +0000 (23:32 -0800)]
auto merge of #10773 : jvns/rust/patch-1, r=cmr

The section on closure types was missing, so I added one. I'm new to Rust, so there are probably important things to say about closure types that I'm missing here.

I tested the example with the latest Rust nightly.

10 years agoAdd test to check for debug logging disabled at compile time
Philipp Brüschweiler [Tue, 3 Dec 2013 06:09:48 +0000 (07:09 +0100)]
Add test to check for debug logging disabled at compile time

10 years agoauto merge of #10772 : alexcrichton/rust/issue-3053, r=alexcrichton
bors [Tue, 3 Dec 2013 05:32:38 +0000 (21:32 -0800)]
auto merge of #10772 : alexcrichton/rust/issue-3053, r=alexcrichton

Rebasing #10446 with a `pub fn main`

10 years agorustdoc: Tell rustc we're building a library
Alex Crichton [Tue, 3 Dec 2013 05:26:40 +0000 (21:26 -0800)]
rustdoc: Tell rustc we're building a library

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.

10 years agoauto merge of #10770 : alexcrichton/rust/static-librustrt, r=alexcrichton
bors [Tue, 3 Dec 2013 04:16:51 +0000 (20:16 -0800)]
auto merge of #10770 : alexcrichton/rust/static-librustrt, r=alexcrichton

This wasn't uncovered during testing because the librustrt is available locally
in the build directory (and it needs to be for all the tests to link against it
as well).

Closes #10765

10 years agoauto merge of #10771 : pnkfelix/rust/fix-make-check-for-ccacheless-clang, r=acrichto
bors [Tue, 3 Dec 2013 03:02:07 +0000 (19:02 -0800)]
auto merge of #10771 : pnkfelix/rust/fix-make-check-for-ccacheless-clang, r=acrichto

 This fixes a problem with `make check` clang -Werror failing due to an unused -Llib arg.

10 years agoauto merge of #10759 : SiegeLord/rust/placeholder, r=cmr
bors [Tue, 3 Dec 2013 01:31:42 +0000 (17:31 -0800)]
auto merge of #10759 : SiegeLord/rust/placeholder, r=cmr

This makes the search bar more visible.

10 years agoauto merge of #10736 : Blei/rust/fix_c_vec, r=alexcrichton
bors [Tue, 3 Dec 2013 00:06:40 +0000 (16:06 -0800)]
auto merge of #10736 : Blei/rust/fix_c_vec, r=alexcrichton

Controversial change: make the constructors safe, but instead mark the
setters and getters as unsafe. This follows the tradition that construction
of *T is safe, but the access is unsafe instead.

10 years agoDisallow duplicate bindings of struct fields
Alex Crichton [Mon, 2 Dec 2013 22:20:27 +0000 (14:20 -0800)]
Disallow duplicate bindings of struct fields

Closes #9725

10 years agoauto merge of #10742 : alexcrichton/rust/frameworks, r=cmr
bors [Mon, 2 Dec 2013 21:36:41 +0000 (13:36 -0800)]
auto merge of #10742 : alexcrichton/rust/frameworks, r=cmr

Commits have the fun details, and scrutiny on the new documentation would be appreciated!

10 years agoc_vec: Modernize
Philipp Brüschweiler [Mon, 2 Dec 2013 20:53:23 +0000 (21:53 +0100)]
c_vec: Modernize

Generally use more modern constructs (such as using `CVec::new()` as
constructor and move to more method usage).

Potentially controversial changes:
* change `get()` to return a reference instead of cloning
* remove `set()`, add `get_mut()` instead
* add an `unwrap()` method that destroys the CVec without running any
  associated destructor

10 years agoAdd a macro to check if logging at a given label is enabled
Philipp Brüschweiler [Mon, 2 Dec 2013 20:47:57 +0000 (21:47 +0100)]
Add a macro to check if logging at a given label is enabled

This is useful when the information that is needed to do useful logging
is expensive to produce.

10 years agoauto merge of #10728 : sanxiyn/rust/proc, r=cmr
bors [Mon, 2 Dec 2013 20:21:32 +0000 (12:21 -0800)]
auto merge of #10728 : sanxiyn/rust/proc, r=cmr

Fix #10718.

10 years agoAdd section on closure types to manual
Julia Evans [Mon, 2 Dec 2013 19:39:11 +0000 (14:39 -0500)]
Add section on closure types to manual

10 years agoBring the linkage documentation up-to-date
Alex Crichton [Sat, 30 Nov 2013 21:26:46 +0000 (13:26 -0800)]
Bring the linkage documentation up-to-date

This includes documentation for all the previous changes done to linking
in #10582. Additionally, this brings the list of feature-gates up-to-date with
the currently recognized list of features.

10 years agoAdd test for #3053. Fixes #3053.
Niko Matsakis [Tue, 12 Nov 2013 19:44:15 +0000 (14:44 -0500)]
Add test for #3053. Fixes #3053.

10 years agoMake the ccache-free case look like the ccache case.
Felix S. Klock II [Mon, 2 Dec 2013 18:08:45 +0000 (19:08 +0100)]
Make the ccache-free case look like the ccache case.

This fixes a problem with `make check` clang -Werror failing due to an
unused -Llib arg.

10 years agoDeclare librustrt a static dependency of libextra
Alex Crichton [Mon, 2 Dec 2013 17:39:02 +0000 (09:39 -0800)]
Declare librustrt a static dependency of libextra

This wasn't uncovered during testing because the librustrt is available locally
in the build directory (and it needs to be for all the tests to link against it
as well).

Closes #10765

10 years agoFix type inference for proc expressions
Seo Sanghyeon [Fri, 29 Nov 2013 18:53:05 +0000 (03:53 +0900)]
Fix type inference for proc expressions

10 years agorename MutableVector::mut_split(at) to MutableVector::mut_split_at(at)
Guillaume Pinot [Sun, 1 Dec 2013 17:19:39 +0000 (18:19 +0100)]
rename MutableVector::mut_split(at) to MutableVector::mut_split_at(at)

10 years agoAdd a type="search" to the search bar in the documentation.
SiegeLord [Mon, 2 Dec 2013 02:36:59 +0000 (21:36 -0500)]
Add a type="search" to the search bar in the documentation.

10 years agoAdd placeholder text to the search bar in the documentation.
SiegeLord [Mon, 2 Dec 2013 01:42:38 +0000 (20:42 -0500)]
Add placeholder text to the search bar in the documentation.

10 years agoauto merge of #10753 : alexcrichton/rust/fix-make-install, r=huonw
bors [Sun, 1 Dec 2013 23:36:58 +0000 (15:36 -0800)]
auto merge of #10753 : alexcrichton/rust/fix-make-install, r=huonw

Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.

10 years agoAdd struct and type doc comments for extra::url::*
Dave Hodder [Sun, 1 Dec 2013 22:25:58 +0000 (22:25 +0000)]
Add struct and type doc comments for extra::url::*

Updated doc comments further, following suggestions from huonw in PR
#10752.

10 years agoauto merge of #10756 : thestinger/rust/transmute, r=alexcrichton
bors [Sun, 1 Dec 2013 20:42:16 +0000 (12:42 -0800)]
auto merge of #10756 : thestinger/rust/transmute, r=alexcrichton

10 years agoauto merge of #10749 : Blei/rust/fix-linker-args, r=alexcrichton
bors [Sun, 1 Dec 2013 19:26:57 +0000 (11:26 -0800)]
auto merge of #10749 : Blei/rust/fix-linker-args, r=alexcrichton

This is inspired by a mystifying linker failure when using `pkg-config` to
generate the linker args: `pkg-config` produces output that ends in a
space, thus resulting in an empty linker argument.

Also added some updates to the concerning error messages that helped
spotting this bug.

10 years agorustc: filter out empty linker args
Philipp Brüschweiler [Sun, 1 Dec 2013 10:08:46 +0000 (11:08 +0100)]
rustc: filter out empty linker args

This is inspired by a mystifying linker failure when using `pkg-config` to
generate the linker args: `pkg-config` produces output that ends in a
space, thus resulting in an empty linker argument.

Also added some updates to the concerning error messages that helped
spotting this bug.

10 years agoremove useless `transmute_immut` function
Daniel Micay [Sun, 1 Dec 2013 15:18:47 +0000 (10:18 -0500)]
remove useless `transmute_immut` function

10 years ago*Actually* fix `make install` with rlibs
Alex Crichton [Sun, 1 Dec 2013 14:58:46 +0000 (06:58 -0800)]
*Actually* fix `make install` with rlibs

Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.

10 years agoauto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichton
bors [Sun, 1 Dec 2013 13:42:06 +0000 (05:42 -0800)]
auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichton

10 years agoAdd struct and type doc comments for extra::url::*
Dave Hodder [Sun, 1 Dec 2013 12:30:32 +0000 (12:30 +0000)]
Add struct and type doc comments for extra::url::*

10 years agoauto merge of #10748 : kballard/rust/issue-10734-rpass, r=alexcrichton
bors [Sun, 1 Dec 2013 12:26:52 +0000 (04:26 -0800)]
auto merge of #10748 : kballard/rust/issue-10734-rpass, r=alexcrichton

Stop relying on a malloc error to indicate failure and instead use an
explicit check. Also ensure that the value is dropped at the correct
time (e.g. that the if statement is translated into `{ expr }` instead
of `expr`).

10 years agoauto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmr
bors [Sun, 1 Dec 2013 11:11:58 +0000 (03:11 -0800)]
auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmr

**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets.

With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes.

My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**.

I believe there is more to gain by fiddling with the enums' layouts.

10 years agoast: Remove one `@` and fix the fallout
Philipp Brüschweiler [Sat, 30 Nov 2013 16:27:25 +0000 (17:27 +0100)]
ast: Remove one `@` and fix the fallout

10 years agoRewrite the issue-10734 rpass file
Kevin Ballard [Sun, 1 Dec 2013 07:55:55 +0000 (23:55 -0800)]
Rewrite the issue-10734 rpass file

Stop relying on a malloc error to indicate failure and instead use an
explicit check. Also ensure that the value is dropped at the correct
time (e.g. that the if statement is translated into `{ expr }` instead
of `expr`).

10 years agoauto merge of #10746 : alexcrichton/rust/fix-make-install, r=cmr
bors [Sun, 1 Dec 2013 05:01:43 +0000 (21:01 -0800)]
auto merge of #10746 : alexcrichton/rust/fix-make-install, r=cmr

It was only copying the host files, not the target rlib files.

10 years agoauto merge of #10739 : DaGenix/rust/mut-chunks, r=alexcrichton
bors [Sun, 1 Dec 2013 03:46:35 +0000 (19:46 -0800)]
auto merge of #10739 : DaGenix/rust/mut-chunks, r=alexcrichton

mut_chunks() returns an iterator that produces mutable slices. This is the mutable version of the existing chunks() method on the ImmutableVector trait.

EDIT: This uses only safe code now.

PREVIOUSLY:
I tried to get this working with safe code only, but I couldn't figure out how to make that work. Before #8624, the exact same code worked without the need for the transmute() call. With that fix and without the transmute() call, the compiler complains about the call to mut_slice(). I think the issue is that the mutable slice that is returned will live longer than the self parameter since the self parameter doesn't have an explicit lifetime. However, that is the way that the Iterator trait defines the next() method. I'm sure there is a good reason for that, although I don't quite understand why. Anyway, I think the interface is safe, since the MutChunkIter will only hand out non-overlapping pointers and there is no way to get it to hand out the same pointer twice.

10 years agoFix make install to install rlib files
Alex Crichton [Sun, 1 Dec 2013 02:58:09 +0000 (18:58 -0800)]
Fix make install to install rlib files

It was only copying the host files, not the target rlib files.

10 years agoauto merge of #10733 : alexcrichton/rust/ignore-on-windows, r=pcwalton
bors [Sun, 1 Dec 2013 02:31:46 +0000 (18:31 -0800)]
auto merge of #10733 : alexcrichton/rust/ignore-on-windows, r=pcwalton

I've seen this fail on windows twice now, and it's not clear to me why it's
failing. For now, ignore it on that platform while investigation enuses.

10 years agoauto merge of #10738 : sfackler/rust/buffered-fixes, r=alexcrichton
bors [Sun, 1 Dec 2013 01:16:37 +0000 (17:16 -0800)]
auto merge of #10738 : sfackler/rust/buffered-fixes, r=alexcrichton

BufferedWriter::inner flushes before returning the underlying writer.

BufferedWriter::write no longer flushes the underlying writer.

LineBufferedWriter::write flushes up to the *last* newline in the input
string, not the first.

10 years agoImplement DoubleEndedIterator for MutChunkIter.
Palmer Cox [Sun, 1 Dec 2013 00:54:28 +0000 (19:54 -0500)]
Implement DoubleEndedIterator for MutChunkIter.