]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agorustc: Disable rpath settings by default
Alex Crichton [Wed, 11 Jun 2014 21:52:38 +0000 (14:52 -0700)]
rustc: Disable rpath settings by default

This commit disables rustc's emission of rpath attributes into dynamic libraries
and executables by default. The functionality is still preserved, but it must
now be manually enabled via a `-C rpath` flag.

This involved a few changes to the local build system:

* --disable-rpath is now the default configure option
* Makefiles now prefer our own LD_LIBRARY_PATH over the user's LD_LIBRARY_PATH
  in order to support building rust with rust already installed.
* The compiletest program was taught to correctly pass through the aux dir as a
  component of LD_LIBRARY_PATH in more situations.

The major impact of this change is that neither rustdoc nor rustc will work
out-of-the-box in all situations because they are dynamically linked. It must be
arranged to ensure that the libraries of a rust installation are part of the
LD_LIBRARY_PATH. The default installation paths for all platforms ensure this,
but if an installation is in a nonstandard location, then configuration may be
necessary.

Additionally, for all developers of rustc, it will no longer be possible to run
$target/stageN/bin/rustc out-of-the-box. The old behavior can be regained
through the `--enable-rpath` option to the configure script.

This change brings linux/mac installations in line with windows installations
where rpath is not possible.

Closes #11747
[breaking-change]

10 years agoauto merge of #14955 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 17 Jun 2014 02:51:53 +0000 (02:51 +0000)]
auto merge of #14955 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoTest fixes from rollup
Alex Crichton [Tue, 17 Jun 2014 01:45:13 +0000 (18:45 -0700)]
Test fixes from rollup

Closes #14888 (Allow disabling jemalloc as the memory allocator)
Closes #14905 (rustc: Improve span for error about using a method as a field.)
Closes #14920 (Fix #14915)
Closes #14924 (Add a Syntastic plugin for Rust.)
Closes #14935 (debuginfo: Correctly handle indirectly recursive types)
Closes #14938 (Reexport `num_cpus` in `std::os`. Closes #14707)
Closes #14941 (std: Don't fail the task when a Future is dropped)
Closes #14942 (rustc: Don't mark type parameters as exported)
Closes #14943 (doc: Fix a link in the FAQ)
Closes #14944 (Update "use" to "uses" on ln186)
Closes #14949 (Update repo location)
Closes #14950 (fix typo in the libc crate)
Closes #14951 (Update Sublime Rust github link)
Closes #14953 (Fix --disable-rpath and tests)

10 years agoFix --disable-rpath and tests
Alex Crichton [Wed, 11 Jun 2014 21:52:38 +0000 (14:52 -0700)]
Fix --disable-rpath and tests

This involved a few changes to the local build system:

* Makefiles now prefer our own LD_LIBRARY_PATH over the user's LD_LIBRARY_PATH
  in order to support building rust with rust already installed.
* The compiletest program was taught to correctly pass through the aux dir as a
  component of LD_LIBRARY_PATH in more situations.

This change was spliced out of #14832 to consist of just the fixes to running
tests without an rpath setting embedded in executables.

10 years agoUpdate Sublime Rust github link
Christopher Bergqvist [Mon, 16 Jun 2014 22:07:15 +0000 (00:07 +0200)]
Update Sublime Rust github link

Package switched maintainer from dbp to jhasse as stated in the README.md at the old link.

10 years agofix typo in the libc crate
Daniel Micay [Mon, 16 Jun 2014 23:24:17 +0000 (19:24 -0400)]
fix typo in the libc crate

10 years agoUpdate repo location
Brian Anderson [Mon, 16 Jun 2014 23:07:34 +0000 (16:07 -0700)]
Update repo location

10 years agoUpdate "use" to "uses" ln186
theptrk [Mon, 16 Jun 2014 21:04:54 +0000 (14:04 -0700)]
Update "use" to "uses" ln186

10 years agodoc: Fix a link in the FAQ
Alex Crichton [Mon, 16 Jun 2014 20:56:54 +0000 (13:56 -0700)]
doc: Fix a link in the FAQ

Closes #14914

10 years agorustc: Don't mark type parameters as exported
Alex Crichton [Mon, 16 Jun 2014 20:53:09 +0000 (13:53 -0700)]
rustc: Don't mark type parameters as exported

This ends up causing the privacy pass to get all confused, and there's nothing
inherently exported about them anyway.

Closes #14933

10 years agostd: Don't fail the task when a Future is dropped
Alex Crichton [Mon, 16 Jun 2014 20:24:31 +0000 (13:24 -0700)]
std: Don't fail the task when a Future is dropped

It's a benign failure that no one needs to know about.

Closes #14892

10 years agoMove `num_cpus` from `std::rt::util` to `std::os`. Closes #14707
Jorge Aparicio [Mon, 16 Jun 2014 20:36:07 +0000 (15:36 -0500)]
Move `num_cpus` from `std::rt::util` to `std::os`. Closes #14707

10 years agodebuginfo: Correctly handle indirectly recursive types.
Michael Woerister [Mon, 16 Jun 2014 12:28:05 +0000 (14:28 +0200)]
debuginfo: Correctly handle indirectly recursive types.

So far handling some indirectly recursive types, such as pointer types, has relied on LLVM metadata uniquing in a very implicit way. This could cause some inconsistencies in the debuginfo, and sometimes to hard to trace LLVM assertions.
With this commit unique type IDs and the TypeMap are used to explicitly make sure that no inconsistencies exist, and, if in the future some regression re-introduces one, give a better error message instead of the hard-to-interpret LLVM error.

10 years agoAdd a Syntastic plugin for Rust.
Andrew Gallant [Mon, 16 Jun 2014 17:07:49 +0000 (13:07 -0400)]
Add a Syntastic plugin for Rust.

10 years agoChange prints: @T -> Gc<T> , ~T -> Box<T>
John Schmidt [Sun, 15 Jun 2014 17:04:55 +0000 (10:04 -0700)]
Change prints: @T -> Gc<T> , ~T -> Box<T>

Fixes #14915

10 years agorustc: Improve span for error about using a method as a field.
Kevin Butler [Fri, 13 Jun 2014 21:56:42 +0000 (22:56 +0100)]
rustc: Improve span for error about using a method as a field.

libsyntax: ExprField now contains a SpannedIdent rather than Ident.

[breaking-change]

10 years agoalloc: Refactor OOM into a common routine
Alex Crichton [Sat, 14 Jun 2014 06:35:54 +0000 (23:35 -0700)]
alloc: Refactor OOM into a common routine

10 years agoalloc: Allow disabling jemalloc
Alex Crichton [Sat, 14 Jun 2014 06:23:31 +0000 (23:23 -0700)]
alloc: Allow disabling jemalloc

10 years agoalloc: Format heap.rs to 80-char max
Alex Crichton [Sat, 14 Jun 2014 06:22:58 +0000 (23:22 -0700)]
alloc: Format heap.rs to 80-char max

10 years agoauto merge of #14855 : TeXitoi/rust/relicense-shootout-binarytrees, r=brson
bors [Tue, 17 Jun 2014 01:01:55 +0000 (01:01 +0000)]
auto merge of #14855 : TeXitoi/rust/relicense-shootout-binarytrees, r=brson

Everyone agreed.

Related to #14248, close #14720

@brson OK?

10 years agoauto merge of #14852 : TeXitoi/rust/relicense-shootout-pidigits, r=brson
bors [Mon, 16 Jun 2014 23:11:46 +0000 (23:11 +0000)]
auto merge of #14852 : TeXitoi/rust/relicense-shootout-pidigits, r=brson

Everyone agreed.

Related to #14248, close #14718

@brson OK?

10 years agoauto merge of #14781 : alexcrichton/rust/issue-14724, r=brson
bors [Mon, 16 Jun 2014 20:36:41 +0000 (20:36 +0000)]
auto merge of #14781 : alexcrichton/rust/issue-14724, r=brson

* os::pipe() now returns `IoResult<os::Pipe>`
* os::pipe() is now unsafe because it does not arrange for deallocation of file
  descriptors
* PipeStream::pair() has been added. This is a safe method to get a pair of
  pipes.
* Dealing with pipes in native process bindings have been improved to be more
  robust in the face of failure and intermittent errors. This converts a few
  fail!() situations to Err situations.

cc #13538
Closes #14724
[breaking-change]

10 years agoauto merge of #14551 : alexcrichton/rust/issue-14467, r=kballard
bors [Mon, 16 Jun 2014 18:46:45 +0000 (18:46 +0000)]
auto merge of #14551 : alexcrichton/rust/issue-14467, r=kballard

Forking off a child which survives the parent is often a useful task, and is
currently not possible because the Process type will invoke `wait()` in its
destructor in order to prevent leaking resources. This function adds a new safe
method, `daemonize`, which can be used to consume an instance of `Process` which
will then not call `wait` in the destructor.

This new method is clearly documented as a leak of resources, but it must be
forcibly opted in to.

Closes #14467

10 years agostd: Improve pipe() functionality
Alex Crichton [Mon, 9 Jun 2014 20:23:49 +0000 (13:23 -0700)]
std: Improve pipe() functionality

* os::pipe() now returns IoResult<os::Pipe>
* os::pipe() is now unsafe because it does not arrange for deallocation of file
  descriptors
* os::Pipe fields are renamed from input to reader and out to write.
* PipeStream::pair() has been added. This is a safe method to get a pair of
  pipes.
* Dealing with pipes in native process bindings have been improved to be more
  robust in the face of failure and intermittent errors. This converts a few
  fail!() situations to Err situations.

Closes #9458
cc #13538
Closes #14724
[breaking-change]

10 years agostd: Support consuming a Process without waiting
Alex Crichton [Sat, 31 May 2014 00:18:12 +0000 (17:18 -0700)]
std: Support consuming a Process without waiting

Forking off a child which survives the parent is often a useful task, and is
currently not possible because the Process type will invoke `wait()` in its
destructor in order to prevent leaking resources. This function adds a new safe
method, `forget`, which can be used to consume an instance of `Process` which
will then not call `wait` in the destructor.

This new method is clearly documented as a leak of resources, but it must be
forcibly opted in to.

Closes #14467

10 years agoauto merge of #14877 : Seldaek/rust/commdocs, r=alexcrichton
bors [Mon, 16 Jun 2014 17:01:56 +0000 (17:01 +0000)]
auto merge of #14877 : Seldaek/rust/commdocs, r=alexcrichton

Finally what I promised to do in #13862 /cc @alexcrichton

10 years agoAdd examples of how to read from a channel with a timeout, refs #13862
Jordi Boggiano [Fri, 13 Jun 2014 22:49:01 +0000 (00:49 +0200)]
Add examples of how to read from a channel with a timeout, refs #13862

10 years agoauto merge of #14882 : pcwalton/rust/drop-underscore, r=nikomatsakis
bors [Mon, 16 Jun 2014 15:06:48 +0000 (15:06 +0000)]
auto merge of #14882 : pcwalton/rust/drop-underscore, r=nikomatsakis

This code didn't do anything, but was a vestige of the old semantics for
`let _ = ...`.

Closes #10488. (As near as I can tell anyhow.)

r? @nikomatsakis

10 years agoauto merge of #14932 : Sawyer47/rust/json-smallfix, r=huonw
bors [Mon, 16 Jun 2014 13:16:44 +0000 (13:16 +0000)]
auto merge of #14932 : Sawyer47/rust/json-smallfix, r=huonw

10 years agoauto merge of #14906 : P1start/rust/rustdoc-lifetimes, r=huonw
bors [Mon, 16 Jun 2014 11:31:56 +0000 (11:31 +0000)]
auto merge of #14906 : P1start/rust/rustdoc-lifetimes, r=huonw

rustdoc was previously formatting lifetimes with two apostrophes, presumably as a result of #14797.

10 years agoFix rustdoc's formatting of lifetimes
P1start [Sun, 15 Jun 2014 02:59:01 +0000 (14:59 +1200)]
Fix rustdoc's formatting of lifetimes

rustdoc was previously formatting lifetimes with two apostrophes, presumably
as a result of #14797.

10 years agoauto merge of #14900 : alexcrichton/rust/snapshots, r=huonw
bors [Mon, 16 Jun 2014 08:16:49 +0000 (08:16 +0000)]
auto merge of #14900 : alexcrichton/rust/snapshots, r=huonw

Closes #14898
Closes #14918

10 years agoauto merge of #14715 : vhbit/rust/ios-pr2, r=alexcrichton
bors [Mon, 16 Jun 2014 06:32:03 +0000 (06:32 +0000)]
auto merge of #14715 : vhbit/rust/ios-pr2, r=alexcrichton

10 years agoRegister new snapshots
Alex Crichton [Sat, 14 Jun 2014 18:03:34 +0000 (11:03 -0700)]
Register new snapshots

10 years agoPotential fix for Win32 build
Valerii Hiora [Mon, 16 Jun 2014 05:48:59 +0000 (08:48 +0300)]
Potential fix for Win32 build

It seems in one of rebases I’ve resolved conflicts wrong and left one redundant line, it is absent in current master and it might cause compilation failure by copying file into itself.

10 years agoSmall improvement for json PrettyEncoder
Piotr Jawniak [Sun, 15 Jun 2014 07:31:14 +0000 (09:31 +0200)]
Small improvement for json PrettyEncoder

10 years agoUpdated compiler-rt
Valerii Hiora [Sat, 14 Jun 2014 15:00:28 +0000 (18:00 +0300)]
Updated compiler-rt

Previous update unfortunately included changes which
broke Android compilation. This update fixes it and
should allow correct compilation of SjLj for iOS and
all builtins for Android.

10 years agoauto merge of #14835 : alexcrichton/rust/no-more-at, r=brson
bors [Sat, 14 Jun 2014 17:51:49 +0000 (17:51 +0000)]
auto merge of #14835 : alexcrichton/rust/no-more-at, r=brson

All functionality is now available through `Gc<T>` and `box(GC) expr`. This change also removes `GC` from the prelude (it's an experimental feature).

10 years agorustc: Obsolete the `@` syntax entirely
Alex Crichton [Thu, 12 Jun 2014 02:33:52 +0000 (19:33 -0700)]
rustc: Obsolete the `@` syntax entirely

This removes all remnants of `@` pointers from rustc. Additionally, this removes
the `GC` structure from the prelude as it seems odd exporting an experimental
type in the prelude by default.

Closes #14193
[breaking-change]

10 years agoRegister new snapshots
Alex Crichton [Thu, 12 Jun 2014 01:47:09 +0000 (18:47 -0700)]
Register new snapshots

10 years agoauto merge of #14884 : huonw/rust/getoptsfail, r=alexcrichton
bors [Sat, 14 Jun 2014 10:36:46 +0000 (10:36 +0000)]
auto merge of #14884 : huonw/rust/getoptsfail, r=alexcrichton

10 years agoauto merge of #14874 : pcwalton/rust/enum-to-float-casts-part-deux, r=alexcrichton
bors [Sat, 14 Jun 2014 08:46:48 +0000 (08:46 +0000)]
auto merge of #14874 : pcwalton/rust/enum-to-float-casts-part-deux, r=alexcrichton

Closes #14794.

If you're casting from an enum to a float, cast through an integer
first.

[breaking-change]

r? @alexcrichton

10 years agoauto merge of #14739 : zwarich/rust/mut-unique-path, r=nikomatsakis
bors [Sat, 14 Jun 2014 06:36:49 +0000 (06:36 +0000)]
auto merge of #14739 : zwarich/rust/mut-unique-path, r=nikomatsakis

Implement the stronger guarantees for mutable borrows proposed in #12624.

10 years agoauto merge of #14878 : vtsatskin/rust/rustdoc-sidebar-click-targets, r=alexcrichton
bors [Sat, 14 Jun 2014 04:46:46 +0000 (04:46 +0000)]
auto merge of #14878 : vtsatskin/rust/rustdoc-sidebar-click-targets, r=alexcrichton

There was feedback gathered by @bjz which request for larger click targets in the rustdoc sidebar. Here's my attempt at that.

My only concern with this patch is the removal of `<br>` between sidebar links. This may break formatting for text-only viewers of this documentation. If there is a large enough demographic of people that will be affected, perhaps we can try switching the structure of each sidebar block sidebar to an `<ol>` with each item as a `<li>`.

* Change links to display:block for click larger targets
* Remove linebreaks due to extra space
* Adjust margins so that element spacing stays the same
* Sidebar item hover background colour chosen from `<pre>` styling

10 years agoReorganize code in check_loans
Cameron Zwarich [Sat, 14 Jun 2014 03:48:10 +0000 (20:48 -0700)]
Reorganize code in check_loans

Move analyze_restrictions_on_use and check_if_path_is_moved so that all
of the code related to assignments is in a contiguous block at the end
of the file.

10 years agoAdd new tests for uses of mutably borrowed paths
Cameron Zwarich [Sat, 14 Jun 2014 03:48:10 +0000 (20:48 -0700)]
Add new tests for uses of mutably borrowed paths

10 years agoEnforce stronger guarantees for mutable borrows
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Enforce stronger guarantees for mutable borrows

Implement the stronger guarantees for mutable borrows from #12624. This
removes the ability to read from a mutably borrowed path for the
duration of the borrow, and enforces a unique access path for any
mutable borrow, for both reads and writes.

This makes mutable borrows work better with concurrent accesses from
multiple threads, and it opens the door for allowing moves out of
mutably borrowed values, as long as a new value is written before the
mutable borrow ends. This also aligns Rust more closely with academic
languages based on substructural types and separation logic.

The most common situation triggering an error after this change is a
call to a function mutably borrowing self with self.field as one of the
arguments. The workaround is to bind self.field to a temporary, but the
need for these temporaries will hopefully go away after #6268 is fixed.

Another situation that triggers an error is using the head expression of
a match in an arm that binds a variable with a mutable reference. The
use of the head expression needs to be replaced with an expression that
reconstructs it from match-bound variables.

This fixes #12624.

[breaking-change]

10 years agoFix all violations of stronger guarantees for mutable borrows
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Fix all violations of stronger guarantees for mutable borrows

Fix all violations in the Rust source tree of the stronger guarantee
of a unique access path for mutable borrows as described in #12624.

10 years agoRename analyze_move_out_from to analyze_restrictions_on_use
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Rename analyze_move_out_from to analyze_restrictions_on_use

Also rename MoveError to UseError and MoveOk / MoveWhileBorrowed to
UseOk / UseWhileBorrowed.

10 years agoMake analyze_move_out_from take a BorrowKind
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Make analyze_move_out_from take a BorrowKind

Currently analyze_move_out_from ignores the BorrowKind of loans, but the
same logic is useful when restricted to loans of specific borrow kinds.

10 years agoMake analyze_move_out_from more field-sensitive
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Make analyze_move_out_from more field-sensitive

Currently analyze_move_out_from checks all restrictions on all base
paths of the move path, but it only needs to check restrictions from
loans of the base paths, and can disregard restrictions from loans of
extensions of those base paths.

10 years agoMake check_for_move_of_borrowed_path take an &LoanPath rather than an &Rc<LoanPath>
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Make check_for_move_of_borrowed_path take an &LoanPath rather than an &Rc<LoanPath>

It doesn't actually need the Rc, and it reduces the net number of
pointer manipulations.

10 years agoMake analyze_move_out_from use a loop rather than recursion
Cameron Zwarich [Sat, 14 Jun 2014 03:48:09 +0000 (20:48 -0700)]
Make analyze_move_out_from use a loop rather than recursion

It will be simpler to make some of the changes that I need to make to
analyze_move_out if it uses a loop rather than recursion.

10 years agogetopts: derive Eq for types.
Huon Wilson [Sat, 14 Jun 2014 01:20:47 +0000 (11:20 +1000)]
getopts: derive Eq for types.

10 years agoauto merge of #14866 : bjz/rust/bitwise, r=alexcrichton
bors [Sat, 14 Jun 2014 01:11:44 +0000 (01:11 +0000)]
auto merge of #14866 : bjz/rust/bitwise, r=alexcrichton

10 years agogetopts: format failure messages with `Show`.
Huon Wilson [Sat, 14 Jun 2014 01:11:09 +0000 (11:11 +1000)]
getopts: format failure messages with `Show`.

This obsoletes the old `to_err_msg` method. Replace

    println!("Error: {}", failure.to_err_msg())

    let string = failure.to_err_msg();

with

    println!("Error: {}", failure)

    let string = failure.to_str();

[breaking-change]

10 years agolibrustc: Remove useless code to handle `let _ = ...`
Patrick Walton [Sat, 14 Jun 2014 00:57:36 +0000 (17:57 -0700)]
librustc: Remove useless code to handle `let _ = ...`

This code didn't do anything, but was a vestige of the old semantics for
`let _ = ...`.

Closes #10488. (As near as I can tell anyhow.)

10 years agoauto merge of #14750 : bachm/rust/master, r=alexcrichton
bors [Fri, 13 Jun 2014 22:46:35 +0000 (22:46 +0000)]
auto merge of #14750 : bachm/rust/master, r=alexcrichton

This adds the missing `get_mut` method to the `MutableVector` trait, and implements it for `&'a mut [T]`.

10 years agorustdoc: Larger click areas for sidebar items
Valentin Tsatskin [Fri, 13 Jun 2014 22:15:37 +0000 (15:15 -0700)]
rustdoc: Larger click areas for sidebar items

* Change links to display:block for click larger targets
* Remove linebreaks due to extra space
* Adjust margins so that element spacing stays the same
* Sidebar item hover background colour chosen from <pre> styling

10 years agoauto merge of #14867 : alexcrichton/rust/rollup, r=alexcrichton
bors [Fri, 13 Jun 2014 20:57:30 +0000 (20:57 +0000)]
auto merge of #14867 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoRolling up PRs in the queue
Alex Crichton [Fri, 13 Jun 2014 04:34:32 +0000 (21:34 -0700)]
Rolling up PRs in the queue

Closes #14797 (librustc: Fix the issue with labels shadowing variable names by making)
Closes #14823 (Improve error messages for io::fs)
Closes #14827 (libsyntax: Allow `+` to separate trait bounds from objects.)
Closes #14834 (configure: Don't sync unused submodules)
Closes #14838 (Remove typo on collections::treemap::UnionItems)
Closes #14839 (Fix the unused struct field lint for struct variants)
Closes #14840 (Clarify `Any` docs)
Closes #14846 (rustc: [T, ..N] and [T, ..N+1] are not the same)
Closes #14847 (Audit usage of NativeMutex)
Closes #14850 (remove unnecessary PaX detection)
Closes #14856 (librustc: Take in account mutability when casting array to raw ptr.)
Closes #14859 (librustc: Forbid `transmute` from being called on types whose size is)
Closes #14860 (Fix `quote_pat!` & parse outer attributes in `quote_item!`)

10 years agosyntax: parse outer attributes in `quote_item!` calls.
Huon Wilson [Thu, 12 Jun 2014 23:40:10 +0000 (09:40 +1000)]
syntax: parse outer attributes in `quote_item!` calls.

Fixes #14857.

10 years agosyntax: fix quote_pat! & unignore a quotation test.
Huon Wilson [Thu, 12 Jun 2014 23:36:26 +0000 (09:36 +1000)]
syntax: fix quote_pat! & unignore a quotation test.

10 years agolibrustc: Forbid `transmute` from being called on types whose size is
Patrick Walton [Thu, 12 Jun 2014 21:08:44 +0000 (14:08 -0700)]
librustc: Forbid `transmute` from being called on types whose size is
only known post-monomorphization, and report `transmute` errors before
the code is generated for that `transmute`.

This can break code that looked like:

    unsafe fn f<T>(x: T) {
        let y: int = transmute(x);
    }

Change such code to take a type parameter that has the same size as the
type being transmuted to.

Closes #12898.

[breaking-change]

10 years agolibrustc: Take in account mutability when casting array to raw ptr.
Luqman Aden [Thu, 12 Jun 2014 22:58:37 +0000 (18:58 -0400)]
librustc: Take in account mutability when casting array to raw ptr.

10 years agoremove unnecessary PaX detection
Daniel Micay [Thu, 12 Jun 2014 20:11:21 +0000 (16:11 -0400)]
remove unnecessary PaX detection

Rust no longer has support for JIT compilation, so it doesn't currently
require a PaX MPROTECT exception. The extended attributes are preferred
over modifying the binaries so it's not actually going to work on most
systems like this anyway.

If JIT compilation ends up being supported again, it should handle this
by *always* applying the exception via an extended attribute without
performing auto-detection of PaX on the host. The `paxctl` tool is only
necessary with the older method involving modifying the ELF binary.

10 years agoAudit usage of NativeMutex
Alex Crichton [Thu, 12 Jun 2014 18:40:13 +0000 (11:40 -0700)]
Audit usage of NativeMutex

Once a native mutex has been used once, it is never allowed to be moved again.
This is because some pthreads implementations take pointers inside the mutex
itself.

This commit adds stern wording around the methods on native mutexes, and fixes
one use case in the codebase. The Mutex type in libsync was susceptible to
movement, so the inner static mutex is now boxed to ensure that the address of
the native mutex is constant.

10 years agorustc: [T, ..N] and [T, ..N+1] are not the same
Alex Crichton [Thu, 12 Jun 2014 17:27:44 +0000 (10:27 -0700)]
rustc: [T, ..N] and [T, ..N+1] are not the same

This commit fixes a bug in the calculation of the hash of a type which didn't
factor in the length of a constant-sized vector. As a result of this, a type
placed into an Any of a fixed length could be peeled out with any other fixed
length in a safe manner.

10 years agoClarify `Any` docs
P1start [Thu, 12 Jun 2014 07:54:03 +0000 (19:54 +1200)]
Clarify `Any` docs

The `Any` docs previously did not state that only `'static` types implement it.

10 years agoFix the unused struct field lint for struct variants
Jakub Wieczorek [Thu, 12 Jun 2014 06:38:30 +0000 (08:38 +0200)]
Fix the unused struct field lint for struct variants

Fixes #14837.

10 years agoRemove typo on collections::treemap::UnionItems
Renato Riccieri Santos Zannon [Thu, 12 Jun 2014 06:36:46 +0000 (03:36 -0300)]
Remove typo on collections::treemap::UnionItems

The docstring stated it was a intersection iterator, when in fact it is the union iterator

10 years agoconfigure: Don't sync unused submodules
Alex Crichton [Thu, 12 Jun 2014 01:54:14 +0000 (18:54 -0700)]
configure: Don't sync unused submodules

If the compiler is built with --{llvm,jemalloc,libuv}-root, then the configure
script can skip updating these submodules.

Closes #14822

10 years agolibsyntax: Allow `+` to separate trait bounds from objects.
Patrick Walton [Wed, 11 Jun 2014 19:14:38 +0000 (12:14 -0700)]
libsyntax: Allow `+` to separate trait bounds from objects.

RFC #27.

After a snapshot, the old syntax will be removed.

This can break some code that looked like `foo as &Trait:Send`. Now you
will need to write `foo as (&Trait+Send)`.

Closes #12778.

[breaking-change]

10 years agostd: Rebase better errors on master
Alex Crichton [Wed, 11 Jun 2014 17:24:04 +0000 (10:24 -0700)]
std: Rebase better errors on master

10 years agoImprove error messages for io::fs
Yehuda Katz [Tue, 3 Jun 2014 19:33:18 +0000 (12:33 -0700)]
Improve error messages for io::fs

10 years agolibrustc: Fix the issue with labels shadowing variable names by making
Patrick Walton [Tue, 10 Jun 2014 20:54:13 +0000 (13:54 -0700)]
librustc: Fix the issue with labels shadowing variable names by making
the leading quote part of the identifier for the purposes of hygiene.

This adopts @jbclements' solution to #14539.

I'm not sure if this is a breaking change or not.

Closes #12512.

[breaking-change]

10 years agoauto merge of #14604 : nikomatsakis/rust/issue-5527-namespace-substs, r=pcwalton
bors [Fri, 13 Jun 2014 19:02:11 +0000 (19:02 +0000)]
auto merge of #14604 : nikomatsakis/rust/issue-5527-namespace-substs, r=pcwalton

The current setup is to have a single vector of type parameters in
scope at any one time. We then have to concatenate the parameters from
the impl/trait with those of the method. This makes a lot of things
awkward, most notably associated fns ("static fns"). This branch
restructures the substitutions into three distinct namespaces (type,
self, fn). This makes most of the "type parameter management"
trivial. This also sets us up to support UFCS (though I haven't made
any particular changes in that direction in this patch).

Along the way, this patch fixes a few miscellaneous bits of code cleanup:

1. Patch resolve to detect references to out-of-scope type parameters,
   rather than checking for "out of bound" indices during substitution
   (fixes #14603).

2. Move def out of libsyntax into librustc where it belongs. I should have
   moved DefId too, but didn't.

3. Permit homogeneous tuples like `(T, T, T)` to be used as fixed-length
   vectors like `[T, ..3]`. This is awfully handy, though public facing.
   I suppose it requires an RFC.

4. Add some missing tests.

cc #5527

r? @pcwalton or @pnkfelix

10 years agolibrustc: Forbid enum-to-float casts.
Patrick Walton [Fri, 13 Jun 2014 18:14:04 +0000 (11:14 -0700)]
librustc: Forbid enum-to-float casts.

Closes #14794.

If you're casting from an enum to a float, cast through an integer
first.

[breaking-change]

10 years agoIntroduce VecPerParamSpace and use it to represent sets of types and
Niko Matsakis [Sat, 31 May 2014 22:53:13 +0000 (18:53 -0400)]
Introduce VecPerParamSpace and use it to represent sets of types and
parameters

This involves numerous substeps:

1. Treat Self same as any other parameter.
2. No longer compute offsets for method parameters.
3. Store all generic types (both trait/impl and method) with a method,
   eliminating odd discrepancies.
4. Stop doing unspeakable things to static methods and instead just use
   the natural types, now that we can easily add the type parameters from
   trait into the method's polytype.
5. No doubt some more. It was hard to separate these into distinct commits.

Fixes #13564

10 years agoAdd Bitwise::{swap_bytes, rotate_left, rotate_right} methods
Brendan Zabarauskas [Fri, 13 Jun 2014 04:19:17 +0000 (21:19 -0700)]
Add Bitwise::{swap_bytes, rotate_left, rotate_right} methods

10 years agoauto merge of #14831 : alexcrichton/rust/format-intl, r=brson
bors [Fri, 13 Jun 2014 14:42:03 +0000 (14:42 +0000)]
auto merge of #14831 : alexcrichton/rust/format-intl, r=brson

* The select/plural methods from format strings are removed
* The # character no longer needs to be escaped
* The \-based escapes have been removed
* '{{' is now an escape for '{'
* '}}' is now an escape for '}'

Closes #14810
[breaking-change]

10 years agoauto merge of #13222 : nick29581/rust/dxr4, r=brson
bors [Fri, 13 Jun 2014 09:57:06 +0000 (09:57 +0000)]
auto merge of #13222 : nick29581/rust/dxr4, r=brson

Adds a -Z flag `save-analysis` which runs after the analysis phase of the compiler and saves a bunch of info into a CSV file for the crate. This is designed to work with the DXR code browser, but is frontend-independent, that is this info should be useful for all kinds of code browsers, IDEs, or other tools.

I need to squash commits before landing (there will probably be a fair few to come), please ignore them for now and just comment on the changes.

10 years agoDump results of analysis phase as CSV
Nick Cameron [Wed, 5 Feb 2014 04:31:33 +0000 (17:31 +1300)]
Dump results of analysis phase as CSV

Adds the option -Zsave-analysis which will dump the results of syntax and type checking into CSV files. These can be interpreted by tools such as DXR to provide semantic information about Rust programs for code search, cross-reference, etc.

Authored by Nick Cameron and Peter Elmers (@pelmers; including enums, type parameters/generics).

10 years agoThere should be no metadata to read on iOS
Valerii Hiora [Fri, 13 Jun 2014 08:41:00 +0000 (11:41 +0300)]
There should be no metadata to read on iOS

10 years agoadded get_mut() for [T]
bachm [Sun, 8 Jun 2014 15:05:32 +0000 (17:05 +0200)]
added get_mut() for [T]

10 years agoCosmetic fixes & comments
Valerii Hiora [Fri, 13 Jun 2014 07:18:12 +0000 (10:18 +0300)]
Cosmetic fixes & comments

10 years agoauto merge of #14858 : alexcrichton/rust/no-jemalloc-on-travis, r=thestinger
bors [Fri, 13 Jun 2014 04:22:01 +0000 (04:22 +0000)]
auto merge of #14858 : alexcrichton/rust/no-jemalloc-on-travis, r=thestinger

Turns out they don't have the `je_` prefix, so we can't use the system-installed
jemalloc.

10 years agoauto merge of #14819 : michaelwoerister/rust/unique_type_id, r=alexcrichton
bors [Fri, 13 Jun 2014 01:52:02 +0000 (01:52 +0000)]
auto merge of #14819 : michaelwoerister/rust/unique_type_id, r=alexcrichton

With this change, rustc creates a unique type identifier for types in debuginfo. These type identifiers are used by LLVM to correctly handle link-time-optimization scenarios but also help rustc with dealing with inlining from other crates. For more information, see the documentation block at the top of librustc/middle/trans/debuginfo.rs and also [my blog post about the topic](http://michaelwoerister.github.io/2014/06/05/rust-debuginfo-and-unique-type-identifiers.html). This should fix the LTO issues that have been popping up lately.

The changes to the debuginfo module's inner workings are also improved by this. Metadata uniquing of pointer types is not handled explicitly instead of relying on LLVM doing the right thing behind the scenes, and region parameters on types should not lead to metadata duplication anymore.

There are two things that I'd like to get some feedback on:
1. IDs for named items consist of two parts: The [Strict Version Hash](https://github.com/mozilla/rust/blob/0.10/src/librustc/back/svh.rs#L11) of their defining crate and the AST node id of their definition within that crate. My question is: Is the SVH a good choice for identifying the crate? Is it even going to stay? The [crate-id RFC](https://github.com/rust-lang/rfcs/pull/109) got me confused.
2. Unique Type Identifiers can be arbitrary strings and right now the format is rather verbose. For debugging this is nice, because one can infer a lot about a type from the type id alone (it's more or less a signature). For deeply nested generics, id strings could get rather long though. One option to limit the id size would be to use some hashcode instead of the full id (anything that avoids collision as much as possible). Another option would be to use a more compact representation, like ty_encode. This reduces size but also readability.
Since these ID's only show up in LLVM IR, I'm inclined to just leave in the verbose format for now, and only act if sizes of rlibs become a problem.

10 years agoauto merge of #14816 : theptrk/rust/unclear-comment, r=huonw
bors [Fri, 13 Jun 2014 00:07:05 +0000 (00:07 +0000)]
auto merge of #14816 : theptrk/rust/unclear-comment, r=huonw

The old comment left it unclear if this is creating a random value or doing a check as to whether or not the generator is available or some other operation.

See: http://stackoverflow.com/questions/24153311/when-is-rng-gen-not-true

10 years agotravis: Don't use a local jemalloc
Alex Crichton [Thu, 12 Jun 2014 23:12:37 +0000 (16:12 -0700)]
travis: Don't use a local jemalloc

Turns out they don't have the `je_` prefix, so we can't use the system-installed
jemalloc.

10 years agoRelicense shootout-binarytrees.rs
Guillaume Pinot [Thu, 12 Jun 2014 21:41:48 +0000 (23:41 +0200)]
Relicense shootout-binarytrees.rs

Everyone agreed.

Related to #14248, close #14720

10 years agoauto merge of #14813 : cmr/rust/once-docs-unsafe, r=alexcrichton
bors [Thu, 12 Jun 2014 21:22:01 +0000 (21:22 +0000)]
auto merge of #14813 : cmr/rust/once-docs-unsafe, r=alexcrichton

10 years agoRelicense shootout-pidigits.rs
Guillaume Pinot [Thu, 12 Jun 2014 20:47:40 +0000 (22:47 +0200)]
Relicense shootout-pidigits.rs

Everyone agreed.

Related to #14248, close #14718

10 years agoauto merge of #14811 : forticulous/rust/refcell-show, r=alexcrichton
bors [Thu, 12 Jun 2014 19:36:53 +0000 (19:36 +0000)]
auto merge of #14811 : forticulous/rust/refcell-show, r=alexcrichton

Show impl for RefCell and friends

10 years agoBetter dylib skipping based on Alex Crichton code
Valerii Hiora [Wed, 11 Jun 2014 07:48:17 +0000 (10:48 +0300)]
Better dylib skipping based on Alex Crichton code

10 years agoBasic iOS support
Valerii Hiora [Mon, 5 May 2014 07:07:49 +0000 (10:07 +0300)]
Basic iOS support

10 years agoDisable generating split-stack code
Valerii Hiora [Mon, 12 May 2014 17:03:34 +0000 (20:03 +0300)]
Disable generating split-stack code

Allows to compile for archs which do not have (or have limited)
segmented stack support like embedded.

10 years agoRuntime support for arm on iOS
Valerii Hiora [Mon, 5 May 2014 07:08:34 +0000 (10:08 +0300)]
Runtime support for arm on iOS

10 years agoPlatform configuration
Valerii Hiora [Mon, 5 May 2014 07:05:11 +0000 (10:05 +0300)]
Platform configuration

FIXME: avoid using Xcode build and switch to a patched libuv

10 years agoUpdated deps
Valerii Hiora [Fri, 6 Jun 2014 14:34:48 +0000 (17:34 +0300)]
Updated deps