]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #14994 : nick29581/rust/comments, r=bstrie
bors [Wed, 18 Jun 2014 08:56:43 +0000 (08:56 +0000)]
auto merge of #14994 : nick29581/rust/comments, r=bstrie

Plus a few other misc style things.

10 years agoauto merge of #14992 : nathantypanski/rust/collect-docs, r=huonw
bors [Wed, 18 Jun 2014 05:26:38 +0000 (05:26 +0000)]
auto merge of #14992 : nathantypanski/rust/collect-docs, r=huonw

This updates the documentation for result::collect() and
option::collect() to use the new-style syntax for owned pointers and
vectors.

closes #14991

10 years agochange ~[] -> Vec for collect()
Nathan Typanski [Wed, 18 Jun 2014 01:55:42 +0000 (21:55 -0400)]
change ~[] -> Vec for collect()

This updates the documentation for result::collect() and
option::collect() to use the new-style syntax for vectors, instead of
the old ~[].

Also updates the code blocks for these docs so they will be tested
automatically.

closes #14991

10 years agoWrap debuginfo.rs at 80 columns.
Nick Cameron [Wed, 18 Jun 2014 03:07:26 +0000 (15:07 +1200)]
Wrap debuginfo.rs at 80 columns.

Plus a few other misc style things.

10 years agoauto merge of #14880 : SimonSapin/rust/byte-literals, r=alexcrichton
bors [Wed, 18 Jun 2014 02:06:37 +0000 (02:06 +0000)]
auto merge of #14880 : SimonSapin/rust/byte-literals, r=alexcrichton

See #14646 (tracking issue) and rust-lang/rfcs#69.

This does not close the tracking issue, as the `bytes!()` macro still needs to be removed. It will be later, after a snapshot is made with the changes in this PR, so that the new syntax can be used when bootstrapping the compiler.

10 years agoauto merge of #14869 : nick29581/rust/tstore, r=nmatsakis
bors [Wed, 18 Jun 2014 00:16:37 +0000 (00:16 +0000)]
auto merge of #14869 : nick29581/rust/tstore, r=nmatsakis

Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types.
Also addresses (but doesn't close) #12470.
Part of the work towards DST (#12938).

10 years agoFix expected error message in a test.
Simon Sapin [Tue, 17 Jun 2014 22:40:57 +0000 (00:40 +0200)]
Fix expected error message in a test.

The change is a result of the char/string parsing refactor.

10 years agoauto merge of #14956 : nathantypanski/rust/master, r=alexcrichton
bors [Tue, 17 Jun 2014 22:31:41 +0000 (22:31 +0000)]
auto merge of #14956 : nathantypanski/rust/master, r=alexcrichton

Closes #14329

Recent-ish uses of `find_linkage_metas` from my `git grep` output are [here](https://gist.github.com/nathantypanski/b9d2d453718a22765f5c), for those interested who wish to tread through the history.

10 years agoRemove TraitStore from ty_trait
Nick Cameron [Wed, 11 Jun 2014 05:18:57 +0000 (17:18 +1200)]
Remove TraitStore from ty_trait

Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types.
Also addresses (but doesn't close) #12470.
Part of the work towards DST (#12938).

[breaking-change] lifetime parameters in `&mut trait` are now invariant. They used to be contravariant.

10 years agoFix some violations of stronger guarantees for mutable borrows.
Simon Sapin [Tue, 17 Jun 2014 22:06:26 +0000 (00:06 +0200)]
Fix some violations of stronger guarantees for mutable borrows.

See 159e27aebb940926ccf1bad0b2b12087d36ad903

10 years agoRefactor backslash-escape parsing to share similar code.
Simon Sapin [Tue, 17 Jun 2014 15:58:13 +0000 (17:58 +0200)]
Refactor backslash-escape parsing to share similar code.

Move into a new syntax::parse::lexer::StringReader method the code
that was almost duplicated for parsing backslash-escapes in
byte, byte string, char, and string literals.

10 years agoDocument the byte, byte string, and raw byte string literals.
Simon Sapin [Fri, 13 Jun 2014 19:26:37 +0000 (20:26 +0100)]
Document the byte, byte string, and raw byte string literals.

10 years agoAdd br##"xx"## raw byte string literals.
Simon Sapin [Fri, 13 Jun 2014 17:56:24 +0000 (18:56 +0100)]
Add br##"xx"## raw byte string literals.

10 years agoAdd a b"xx" byte string literal of type &'static [u8].
Simon Sapin [Sat, 7 Jun 2014 14:32:01 +0000 (15:32 +0100)]
Add a b"xx" byte string literal of type &'static [u8].

10 years agoAdd a b'x' byte literal of type u8.
Simon Sapin [Fri, 6 Jun 2014 15:04:04 +0000 (16:04 +0100)]
Add a b'x' byte literal of type u8.

10 years agoauto merge of #14977 : pcwalton/rust/address-insignificant-reform, r=brson
bors [Tue, 17 Jun 2014 20:41:38 +0000 (20:41 +0000)]
auto merge of #14977 : pcwalton/rust/address-insignificant-reform, r=brson

`#[inline(never)]` is used.

Closes #8958.

This can break some code that relied on the addresses of statics
being distinct; add `#[inline(never)]` to the affected statics.

[breaking-change]

r? @brson

10 years agoauto merge of #14976 : luqmana/rust/focwtc, r=pcwalton
bors [Tue, 17 Jun 2014 18:56:35 +0000 (18:56 +0000)]
auto merge of #14976 : luqmana/rust/focwtc, r=pcwalton

Fixes #14959.

10 years agolibrustc: Make addresses of immutable statics insignificant unless
Patrick Walton [Thu, 12 Jun 2014 05:31:02 +0000 (22:31 -0700)]
librustc: Make addresses of immutable statics insignificant unless
`#[inline(never)]` is used.

Closes #8958.

This can break some code that relied on the addresses of statics
being distinct; add `#[inline(never)]` to the affected statics.

[breaking-change]

10 years agolibrustc: Check regions for overloaded calls.
Luqman Aden [Tue, 17 Jun 2014 18:14:06 +0000 (14:14 -0400)]
librustc: Check regions for overloaded calls.

10 years agoauto merge of #14957 : alexcrichton/rust/rustdoc-fixups, r=huonw
bors [Tue, 17 Jun 2014 16:26:33 +0000 (16:26 +0000)]
auto merge of #14957 : alexcrichton/rust/rustdoc-fixups, r=huonw

Fixing some of rustdoc's rendering to use newer syntaxes rather than older
syntaxes.

10 years agorustdoc: Remove outdated syntax
Alex Crichton [Tue, 17 Jun 2014 05:14:21 +0000 (22:14 -0700)]
rustdoc: Remove outdated syntax

Fixing some of rustdoc's rendering to use newer syntaxes rather than older
syntaxes.

10 years agoauto merge of #14970 : nkoep/rust/patch-1, r=huonw
bors [Tue, 17 Jun 2014 13:36:35 +0000 (13:36 +0000)]
auto merge of #14970 : nkoep/rust/patch-1, r=huonw

Compiling a crate with `rustc --crate-type=lib` produces an rlib file, not a shared object. The latter is only produced for `--crate-type=dylib`.

10 years agotutorial.md: tiny correction for --crate-type=lib
Niklas Koep [Tue, 17 Jun 2014 13:28:59 +0000 (15:28 +0200)]
tutorial.md: tiny correction for --crate-type=lib

Compiling a crate with `rustc --crate-type=lib` produces an rlib file, not a shared object. The latter is only produced for `--crate-type=dylib`.

10 years agoauto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix
bors [Tue, 17 Jun 2014 08:16:27 +0000 (08:16 +0000)]
auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix

This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.

10 years agoauto merge of #14945 : alexcrichton/rust/issue-14940, r=brson
bors [Tue, 17 Jun 2014 06:31:28 +0000 (06:31 +0000)]
auto merge of #14945 : alexcrichton/rust/issue-14940, r=brson

This just takes a similar approach to reading stdin on windows by artificially
limiting the size of the buffers going in and out.

Closes #14940

10 years agostd: Chunk writing to stdout on windows
Alex Crichton [Mon, 16 Jun 2014 22:11:13 +0000 (15:11 -0700)]
std: Chunk writing to stdout on windows

This just takes a similar approach to reading stdin on windows by artificially
limiting the size of the buffers going in and out.

Closes #14940

10 years agolibsyntax: remove dead code find_linkage_metas
Nathan Typanski [Tue, 17 Jun 2014 04:21:47 +0000 (00:21 -0400)]
libsyntax: remove dead code find_linkage_metas

Closes #14329

10 years agoauto merge of #14947 : zwarich/rust/check-loans-not-restrictions, r=nikomatsakis
bors [Tue, 17 Jun 2014 04:46:26 +0000 (04:46 +0000)]
auto merge of #14947 : zwarich/rust/check-loans-not-restrictions, r=nikomatsakis

Now that features like `const` are gone, we can remove the concept of restrictions from borrowck and just track loans and their restricted paths.

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 agoRename check_for_assignment_to_restricted_or_frozen_location
Cameron Zwarich [Mon, 16 Jun 2014 22:40:21 +0000 (15:40 -0700)]
Rename check_for_assignment_to_restricted_or_frozen_location

Rename check_for_assignment_to_restricted_or_frozen_location to
check_for_assignment_to_borrowed_path.

10 years agoSwitch to each_in_scope_loan_affecting_path
Cameron Zwarich [Mon, 16 Jun 2014 22:40:21 +0000 (15:40 -0700)]
Switch to each_in_scope_loan_affecting_path

The last remaining use of each_in_scope_restriction in
check_for_assignment_to_restricted_or_frozen_location is using the
pattern captured by each_in_scope_loan_affecting_path, so it can be
removed.

10 years agoAlways check assigned loan paths to the top of the path
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Always check assigned loan paths to the top of the path

Currently, check_for_assignment_to_restricted_or_frozen_location bails
out early when looking for loaned base paths when it hits an McDeclared
or McImmutable extension. With the current type system, this is actually
irrelevant, since mutation can only occur given a unique mutable access
path, forcing the same requirement on each base path.

10 years agoRemove an unused return value
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove an unused return value

The only caller of check_for_assignment_to_restricted_or_frozen_location
isn't checking its return value, so we can remove it and simplify the
internal logic of the function.

10 years agoCall mark_variable_as_used_mut even after assignment errors
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Call mark_variable_as_used_mut even after assignment errors

It doesn't actually matter if we call mark_variable_as_used_mut when the
assignment was invalid, since the variable was still used mutably.

10 years agoAdd a new each_in_scope_loan_affecting_path helper function
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Add a new each_in_scope_loan_affecting_path helper function

Add a helper function that generalizes the loan path restriction
strategy used by analyze_restrictions_on_use.

10 years agoRemove Restriction
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove Restriction

The Restriction struct now consists of a single Rc<LoanPath> field, so
it can be replaced with Rc<LoanPath>.

10 years agoRemove RestrictionSet
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove RestrictionSet

Now that RestrictionSet is no longer being used for anything meaningful,
it can be removed, along with any other associated functions and
RestrictionSet fields of other types.

10 years agoRemove an unused bkcerr_code constructor parameter
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove an unused bkcerr_code constructor parameter

The RestrictionSet parameter of the err_borrowed_pointer_too_short
constructor isn't  actually used, so it can be removed.

10 years agoRemove the last actual usage of RestrictionSet
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove the last actual usage of RestrictionSet

Switch to checking BorrowKind values of loans instead of their
RestrictionSet values. This was the last code that made a decision
based on a RestrictionSet.

10 years agoMake a new compatible_borrow_kinds helper function
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Make a new compatible_borrow_kinds helper function

Move the `incompatible` helper function from analyze_restrictions_on_use
to the file scope and invert its meaning to account for future uses.

10 years agoRemove an unused closure parameter
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove an unused closure parameter

Remove the unused &Restriction parameter of each_in_scope_restriction's
op parameter.

10 years agoRemove a pointless check for intersection with RESTR_MUTATE
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove a pointless check for intersection with RESTR_MUTATE

Now that all loans restrict mutation, there's no point in checking for
intersection with RESTR_MUTATE.

10 years agoRemove comments that no longer apply after the removal of `const`
Cameron Zwarich [Mon, 16 Jun 2014 22:40:20 +0000 (15:40 -0700)]
Remove comments that no longer apply after the removal of `const`

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