]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoUpdate doc comment for Int trait
Brendan Zabarauskas [Tue, 17 Jun 2014 18:09:20 +0000 (11:09 -0700)]
Update doc comment for Int trait

10 years agoShorten endian conversion method names
Brendan Zabarauskas [Tue, 17 Jun 2014 22:47:31 +0000 (15:47 -0700)]
Shorten endian conversion method names

The consensus on #14917 was that the proposed names were too long.

10 years agoRemove `#[stable]` attribute from free-standing endian conversions and mark them...
Brendan Zabarauskas [Mon, 16 Jun 2014 21:33:45 +0000 (14:33 -0700)]
Remove `#[stable]` attribute from free-standing endian conversions and mark them as deprecated

10 years agoMerge the Bitwise and ByteOrder traits into the Int trait
Brendan Zabarauskas [Mon, 16 Jun 2014 18:25:47 +0000 (11:25 -0700)]
Merge the Bitwise and ByteOrder traits into the Int trait

This reduces the complexity of the trait hierarchy.

10 years agoFix comment formatting
Brendan Zabarauskas [Mon, 16 Jun 2014 07:22:51 +0000 (00:22 -0700)]
Fix comment formatting

10 years agoUse ByteOrder methods instead of free-standing functions
Brendan Zabarauskas [Sun, 15 Jun 2014 06:11:33 +0000 (23:11 -0700)]
Use ByteOrder methods instead of free-standing functions

10 years agoAdd a ByteOrder trait for abstracting over endian conversions
Brendan Zabarauskas [Sun, 15 Jun 2014 05:53:55 +0000 (22:53 -0700)]
Add a ByteOrder trait for abstracting over endian conversions

The `Bitwise::swap_bytes` method was also moved into the `ByteOrder` trait. This was because it works on the byte level rather than the bit level.

10 years agoAdd commands :RustEmitIr and :RustEmitAsm
Kevin Ballard [Fri, 30 May 2014 23:35:10 +0000 (16:35 -0700)]
Add commands :RustEmitIr and :RustEmitAsm

10 years agoWrite documentation for the Rust vim plugin
Kevin Ballard [Fri, 30 May 2014 07:06:52 +0000 (00:06 -0700)]
Write documentation for the Rust vim plugin

10 years agoRename :Run and :Expand to :RustRun and :RustExpand
Kevin Ballard [Fri, 30 May 2014 06:43:52 +0000 (23:43 -0700)]
Rename :Run and :Expand to :RustRun and :RustExpand

10 years agovim: Add :Run and :Expand commands
Kevin Ballard [Tue, 27 May 2014 22:00:22 +0000 (15:00 -0700)]
vim: Add :Run and :Expand commands

Define a command :Run to compile and run the current file. This supports
unnamed buffers (by writing to a temporary file). See the comment above
the command definition for notes on usage.

Define <D-r> and <D-R> mappings for :Run to make it easier to invoke in
MacVim.

Define a command :Expand to display the --pretty expanded output for the
current file. This can be configured to use different pretty types. See
the comment above the command definition for notes on usage.

Create an autoload file and put function definitions there to speed up
load time.

10 years agoauto merge of #14854 : jakub-/rust/issue-10991, r=pcwalton
bors [Wed, 18 Jun 2014 20:51:46 +0000 (20:51 +0000)]
auto merge of #14854 : jakub-/rust/issue-10991, r=pcwalton

Fixes #10991.

10 years agoauto merge of #14879 : Ryman/rust/resolve_super_hint_cut, r=alexcrichton
bors [Wed, 18 Jun 2014 18:06:42 +0000 (18:06 +0000)]
auto merge of #14879 : Ryman/rust/resolve_super_hint_cut, r=alexcrichton

10 years agoauto merge of #14873 : pnkfelix/rust/fsk-dataflow-revisions, r=nikomatsakis
bors [Wed, 18 Jun 2014 16:16:42 +0000 (16:16 +0000)]
auto merge of #14873 : pnkfelix/rust/fsk-dataflow-revisions, r=nikomatsakis

Fix #6298.  Fix  #13767.

This also includes some drive by fixes for some other issues, noted in the commits.

I still need to integrate regression tests for some cases that I noticed were missing from our unit test suite (i.e. things that compiling rustc exposes that should have been exposed when doing `make check-stage1`).  So do not land this yet, until I get the chance to add those tests.

I just wanted to get the review process started soon, since this has been long in the coming.

10 years agoAdapt test case to match current set of emitted warnings. (or lack
Felix S. Klock II [Wed, 18 Jun 2014 13:27:49 +0000 (15:27 +0200)]
Adapt test case to match current set of emitted warnings.  (or lack
thereof.)

PR 14739 injected the new message that this removes from one test
case: borrowck-vec-pattern-loan-from-mut.rs

When reviewing the test case, I was not able to convince myself that
the error message was a legitimate thing to start emitting.  Niko did
not see an obvious reason for it either, so I am going to remove it
and wait for someone (maybe Cameron Zwarich) to explain to me why we
should be emitting it.

10 years agoRegression tests for flowgraph construction bug on ExprWhile.
Felix S. Klock II [Tue, 17 Jun 2014 13:38:50 +0000 (15:38 +0200)]
Regression tests for flowgraph construction bug on ExprWhile.

10 years agosome extra test cases to cover in the borrow checker.
Felix S. Klock II [Tue, 17 Jun 2014 12:52:11 +0000 (14:52 +0200)]
some extra test cases to cover in the borrow checker.

10 years agofix typo in borrowck doc.
Felix S. Klock II [Tue, 10 Jun 2014 12:22:48 +0000 (14:22 +0200)]
fix typo in borrowck doc.

10 years agoEnsure dataflow of a proc never looks at blocks from closed-over context.
Felix S. Klock II [Fri, 13 Jun 2014 15:19:29 +0000 (17:19 +0200)]
Ensure dataflow of a proc never looks at blocks from closed-over context.

Details: in a program like:
```
type T = proc(int) -> int; /* 4 */

pub fn outer(captured /* pat 16 */: T) -> T {
    (proc(x /* pat 23 */) {
        ((captured /* 29 */).foo((x /* 30 */)) /* 28 */)
    } /* block 27 */ /* 20 */)
} /* block 19 */ /* 12 */
```
the `captured` arg is moved from the outer fn into the inner proc (id=20).

The old dataflow analysis for flowed_move_data_moves, when looking at
the inner proc, would attempt to add a kill bit for `captured` at the
end of its scope; the problem is that it thought the end of the
`captured` arg's scope was the outer fn (id=12), even though at that
point in the analysis, the `captured` arg's scope should now be
restricted to the proc itself (id=20).

This patch fixes handling of upvars so that dataflow of a fn/proc
should never attempts to add a gen or kill bit to any NodeId outside
of the current fn/proc.  It accomplishes this by adding an `LpUpvar`
variant to `borrowck::LoanPath`, so for cases like `captured` above
will carry both their original `var_id`, as before, as well as the
`NodeId` for the closure that is capturing them.

As a drive-by fix to another occurrence of a similar bug that
nikomatsakis pointed out to me earlier, this also fixes
`gather_loans::compute_kill_scope` so that it computes the kill scope
of the `captured` arg to be block 27; that is, the block for the proc
itself (id=20).

(This is an updated version that generalizes the new loan path variant
to cover all upvars, and thus renamed the variant from `LpCopiedUpvar`
to just `LpUpvar`.)

10 years agomiddle::cfg code cleanup.
Felix S. Klock II [Wed, 21 May 2014 12:48:33 +0000 (14:48 +0200)]
middle::cfg code cleanup.

Namely:

 1. Now that cfg mod is used for dataflow, we do not need to turn on
    the `allow(deadcode)` to placate the linter.

 2. remove dead struct defn.

10 years agoRevise dataflow to do a cfg-driven walk.
Felix S. Klock II [Wed, 21 May 2014 12:49:16 +0000 (14:49 +0200)]
Revise dataflow to do a cfg-driven walk.

Fix #6298.

This is instead of the prior approach of emulating cfg traversal
privately by traversing AST in same way).

Of special note, this removes a special case handling of `ExprParen`
that was actually injecting a bug (since it was acting like an
expression like `(*func)()` was consuming `*func` *twice*: once from
`(*func)` and again from `*func`).  nikomatsakis was the first one to
point out that it might suffice to simply have the outer `ExprParen`
do the consumption of the contents (alone).

(This version has been updated to incorporate feedback from Niko's
review of PR 14873.)

10 years agoNodeIndex should derive `Show`.
Felix S. Klock II [Wed, 21 May 2014 12:48:03 +0000 (14:48 +0200)]
NodeIndex should derive `Show`.

10 years agoBug fixes for flowgraph construction.
Felix S. Klock II [Tue, 20 May 2014 16:49:19 +0000 (18:49 +0200)]
Bug fixes for flowgraph construction.

1. After recursively processing an ExprWhile, need to pop loop_scopes
   the same way we do for ExprLoop.

2. Proposed fix for flowgraph handling of ExprInlineAsm: we need to
   represent the flow into the subexpressions of an `asm!` block.

10 years agoauto merge of #14984 : thestinger/rust/libc, r=alexcrichton
bors [Wed, 18 Jun 2014 14:26:42 +0000 (14:26 +0000)]
auto merge of #14984 : thestinger/rust/libc, r=alexcrichton

10 years agoauto merge of #14990 : tomjakubowski/rust/emacs-fix-attribute-highlight, r=pnkfelix
bors [Wed, 18 Jun 2014 12:36:42 +0000 (12:36 +0000)]
auto merge of #14990 : tomjakubowski/rust/emacs-fix-attribute-highlight, r=pnkfelix

This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking and fix some minor nits.

10 years agoauto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw
bors [Wed, 18 Jun 2014 10:46:41 +0000 (10:46 +0000)]
auto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw

Commits have the descriptions.

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 agostd: Remove dual export of `Show`
Alex Crichton [Wed, 18 Jun 2014 08:13:53 +0000 (01:13 -0700)]
std: Remove dual export of `Show`

Closes #14996

10 years agorustdoc: Don't inject `extern crate std`.
Alex Crichton [Wed, 18 Jun 2014 08:07:59 +0000 (01:07 -0700)]
rustdoc: Don't inject `extern crate std`.

No need to duplicate the compiler's work!

Closes #14999

10 years agorustdoc: Fix testing indented code blocks
Alex Crichton [Wed, 18 Jun 2014 08:04:35 +0000 (01:04 -0700)]
rustdoc: Fix testing indented code blocks

The collapse/unindent passes were run in the wrong order, generating different
markdown for indented tests.

10 years agofix signatures of mmap-related functions from libc
Daniel Micay [Tue, 17 Jun 2014 21:14:55 +0000 (17:14 -0400)]
fix signatures of mmap-related functions from libc

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 agorustc: reduce redundant resolve errors.
Kevin Butler [Thu, 5 Jun 2014 21:37:52 +0000 (22:37 +0100)]
rustc: reduce redundant resolve errors.

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 agoemacs: Remove outdated references to ~ in tests
Tom Jakubowski [Tue, 17 Jun 2014 23:42:42 +0000 (16:42 -0700)]
emacs: Remove outdated references to ~ in tests

10 years agoemacs: Add shebang to test script
Tom Jakubowski [Tue, 17 Jun 2014 23:39:40 +0000 (16:39 -0700)]
emacs: Add shebang to test script

10 years agoemacs: Don't overwrite font lock for attributes
Tom Jakubowski [Tue, 17 Jun 2014 12:25:30 +0000 (05:25 -0700)]
emacs: Don't overwrite font lock for attributes

This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking.

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 agorustc: Add self/super hint for extern crate resolve errors.
Kevin Butler [Wed, 4 Jun 2014 22:55:10 +0000 (23:55 +0100)]
rustc: Add self/super hint for extern crate resolve errors.

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]