]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoUpdate README file for src/ directory
Piotr Jawniak [Sat, 31 May 2014 17:44:34 +0000 (19:44 +0200)]
Update README file for src/ directory

10 years agoauto merge of #14609 : aturon/rust/issue-12882, r=alexcrichton
bors [Tue, 3 Jun 2014 03:51:30 +0000 (20:51 -0700)]
auto merge of #14609 : aturon/rust/issue-12882, r=alexcrichton

10 years agoauto merge of #14605 : jakub-/rust/pattern-matching-refactor, r=pcwalton
bors [Tue, 3 Jun 2014 02:01:32 +0000 (19:01 -0700)]
auto merge of #14605 : jakub-/rust/pattern-matching-refactor, r=pcwalton

I've been working around these parts of code and it seems like it could use a bit of a refactor. This is the first step.

10 years agoauto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichton
bors [Tue, 3 Jun 2014 00:16:31 +0000 (17:16 -0700)]
auto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichton

Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly. `norust` as a negative statement is a bad
tag.

This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.

Also fix markdown.rs to not highlight non-rust code.

Amends the documentation to reflect the new
behaviour.

10 years agoauto merge of #14598 : alexcrichton/rust/triage, r=huonw
bors [Mon, 2 Jun 2014 22:26:29 +0000 (15:26 -0700)]
auto merge of #14598 : alexcrichton/rust/triage, r=huonw

Closes #10764

10 years agoDocument failure cases for `char_at` and friends.
Aaron Turon [Mon, 2 Jun 2014 22:22:17 +0000 (15:22 -0700)]
Document failure cases for `char_at` and friends.

10 years agoauto merge of #14509 : klutzy/rust/de-pub-use-glob, r=alexcrichton
bors [Mon, 2 Jun 2014 19:46:31 +0000 (12:46 -0700)]
auto merge of #14509 : klutzy/rust/de-pub-use-glob, r=alexcrichton

This patchset removes `pub use` usage except for `test/`.
cc #11870

10 years agoRemove further code duplication
Jakub Wieczorek [Mon, 2 Jun 2014 18:49:44 +0000 (20:49 +0200)]
Remove further code duplication

10 years agoImprove code reuse in check_match::specialize()
Jakub Wieczorek [Mon, 2 Jun 2014 15:18:23 +0000 (17:18 +0200)]
Improve code reuse in check_match::specialize()

10 years agotest: Add tests for closed issue #10764
Alex Crichton [Mon, 2 Jun 2014 08:03:30 +0000 (01:03 -0700)]
test: Add tests for closed issue #10764

Closes #10764

10 years agosyntax: Remove use of `pub use` globs
klutzy [Thu, 29 May 2014 03:19:05 +0000 (12:19 +0900)]
syntax: Remove use of `pub use` globs

`quote_expr!` now injects two more (priv) `use` globs.
This may cause extra unused_imports warning.

10 years agodoc: Remove use of `pub use` globs
klutzy [Thu, 29 May 2014 06:17:00 +0000 (15:17 +0900)]
doc: Remove use of `pub use` globs

10 years agodocs: Stop using `notrust`
Florian Gilcher [Mon, 2 Jun 2014 10:37:54 +0000 (12:37 +0200)]
docs: Stop using `notrust`

Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly.

This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.

Also fix markdown.rs to not highlight non-rust code.

10 years agoauto merge of #14596 : Sawyer47/rust/encodable-fix, r=alexcrichton
bors [Mon, 2 Jun 2014 08:06:39 +0000 (01:06 -0700)]
auto merge of #14596 : Sawyer47/rust/encodable-fix, r=alexcrichton

Closes #14021

10 years agoFix deriving Encodable trait for unit structs
Piotr Jawniak [Sun, 1 Jun 2014 12:16:11 +0000 (14:16 +0200)]
Fix deriving Encodable trait for unit structs

Closes #14021

10 years agoauto merge of #14569 : skade/rust/rustdoc-robust-langstring-parsing, r=alexcrichton
bors [Mon, 2 Jun 2014 05:01:36 +0000 (22:01 -0700)]
auto merge of #14569 : skade/rust/rustdoc-robust-langstring-parsing, r=alexcrichton

This changes the parsing of the language string
in code examples so that unrecognized examples
are not considered Rust code. This was, for example,
the case when a code example was marked `sh` for shell
code.

This relieves authors of having to mark those samples
as `notrust`.

Also adds recognition of the positive marker `rust`.

By default, unmarked examples are still considered rust.

10 years agoauto merge of #14591 : klutzy/rust/issue-9205, r=thestinger
bors [Mon, 2 Jun 2014 03:26:39 +0000 (20:26 -0700)]
auto merge of #14591 : klutzy/rust/issue-9205, r=thestinger

Fixes #9205.

10 years agotest: Enable #9205-related tests on windows
klutzy [Mon, 2 Jun 2014 03:08:19 +0000 (12:08 +0900)]
test: Enable #9205-related tests on windows

Fixes #9205.

10 years agorustdoc: make langstring parsing more robust
Florian Gilcher [Sat, 31 May 2014 22:33:32 +0000 (00:33 +0200)]
rustdoc: make langstring parsing more robust

This changes the parsing of the language string
in code examples so that unrecognized examples
are not considered Rust code. This was, for example,
the case when a code example was marked `sh` for shell
code.

This relieves authors of having to mark those samples
as `notrust`.

Also adds recognition of the positive marker `rust`.

By default, unmarked examples are still considered rust.

If any rust-specific tags are seen, code is considered
rust unless marked as "notrust".

Adds test cases for the detection logic.

10 years agoauto merge of #14579 : alexcrichton/rust/more-eq-renamings, r=thestinger
bors [Sun, 1 Jun 2014 17:36:39 +0000 (10:36 -0700)]
auto merge of #14579 : alexcrichton/rust/more-eq-renamings, r=thestinger

This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.

In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.

This continues the work of #12517, continuing the work in #14534. This patch accomplishes the final rename of `TotalEq` to `TotalOrd`. I wanted to get this patch landed ASAP so we don't have to deal much with "where did `Eq` and `Ord` go?"

I have yet to do another pruning pass over the compiler to change all usage of `PartialEq` to `Eq` where appropriate. I will do this soon as well.

10 years agostd: Drop Total from Total{Eq,Ord}
Alex Crichton [Sat, 31 May 2014 17:43:52 +0000 (10:43 -0700)]
std: Drop Total from Total{Eq,Ord}

This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.

In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.

[breaking-change]

10 years agoauto merge of #14580 : utkarshkukreti/rust/fix-docs-for-result-map, r=alexcrichton
bors [Sun, 1 Jun 2014 11:36:38 +0000 (04:36 -0700)]
auto merge of #14580 : utkarshkukreti/rust/fix-docs-for-result-map, r=alexcrichton

`reader.read_line()` includes trailing newline char, which makes
`from_str` always return `None`.

10 years agoauto merge of #14578 : huonw/rust/as_slice-cheatsheet, r=sfackler
bors [Sun, 1 Jun 2014 09:36:39 +0000 (02:36 -0700)]
auto merge of #14578 : huonw/rust/as_slice-cheatsheet, r=sfackler

doc: add an `.as_slice` example to the cheatsheet.

A lot of questions about this on IRC and stackoverflow.

10 years agoauto merge of #14571 : bnoordhuis/rust/libtest-check-isatty, r=alexcrichton
bors [Sun, 1 Jun 2014 07:56:42 +0000 (00:56 -0700)]
auto merge of #14571 : bnoordhuis/rust/libtest-check-isatty, r=alexcrichton

Fixes #14570.

10 years agoFix docs for `core::result::Result::map`.
Utkarsh Kukreti [Sat, 31 May 2014 19:50:52 +0000 (01:20 +0530)]
Fix docs for `core::result::Result::map`.

`reader.read_line()` includes trailing newline char, which makes
`from_str` always return `None`.

10 years agoauto merge of #14513 : alexcrichton/rust/rustdoc-primitives, r=huonw
bors [Sun, 1 Jun 2014 06:16:42 +0000 (23:16 -0700)]
auto merge of #14513 : alexcrichton/rust/rustdoc-primitives, r=huonw

This is currently rebased on top of #14478, but that's just to preemptively avoid rebase conflicts and to provide a better preview. This can land independently of that PR.

This change crates a dedicated page in rustdoc for primitive types to outline everything you can do with them (at least in a basic way).

* Preview - http://people.mozilla.org/~acrichton/doc/
* Exhibit A - http://people.mozilla.org/~acrichton/doc/std/#primitives
* Exhibit B - http://people.mozilla.org/~acrichton/doc/std/primitive.str.html
* Exhibit C - http://people.mozilla.org/~acrichton/doc/std/primitive.slice.html

Please don't hesitate to be nitpickity, it's easy to overlook a thing here or there!

10 years agosyntax: Fix an accidental hyperlink in a comment
Alex Crichton [Thu, 29 May 2014 22:52:23 +0000 (15:52 -0700)]
syntax: Fix an accidental hyperlink in a comment

10 years agorustdoc: Don't inline tuple struct constructors
Alex Crichton [Thu, 29 May 2014 22:52:03 +0000 (15:52 -0700)]
rustdoc: Don't inline tuple struct constructors

These don't actually point to anything, so there's no need to inline them.

10 years agorustdoc: Fix cross-crate links to reexported items
Alex Crichton [Thu, 29 May 2014 20:50:47 +0000 (13:50 -0700)]
rustdoc: Fix cross-crate links to reexported items

Cross crate links can target items which are not rendered in the documentation.
If the item is reexported at a higher level, the destination of the link (a
concatenation of the fully qualified name) may actually lead to nowhere. This
fixes this problem by altering rustdoc to emit pages which redirect to the local
copy of the reexported structure.

cc #14515
Closes #14137

10 years agodoc: Fix a number of broken links
Alex Crichton [Thu, 29 May 2014 16:58:09 +0000 (09:58 -0700)]
doc: Fix a number of broken links

cc #14515

10 years agorustdoc: Suck in all impls from external crates
Alex Crichton [Thu, 29 May 2014 08:35:44 +0000 (01:35 -0700)]
rustdoc: Suck in all impls from external crates

There is currently no way to query all impls for a type from an external crate,
and with primitive types in play this is also quite difficult. Instead of
filtering, just suck in all impls from upstream crates into the local AST, and
have them get stripped later.

This will allow population of all implementations of traits for primitive types,
as well as filling in some corner cases with inlining documentation in other
cases.

10 years agorustdoc: Filter inlining private external items
Alex Crichton [Thu, 29 May 2014 07:26:17 +0000 (00:26 -0700)]
rustdoc: Filter inlining private external items

This prevents structures like RcBox from showing up in the documentation

10 years agorustdoc: Create anchor pages for primitive types
Alex Crichton [Thu, 29 May 2014 02:53:37 +0000 (19:53 -0700)]
rustdoc: Create anchor pages for primitive types

This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]`
attribute. This attribute indicates that the current module is the "owner" of
the primitive type `foo`. For rustdoc, this means that the doc-comment for the
module is the doc-comment for the primitive type, plus a signal to all
downstream crates that hyperlinks for primitive types will be directed at the
crate containing the `#[doc]` directive.

Additionally, rustdoc will favor crates closest to the one being documented
which "implements the primitive type". For example, documentation of libcore
links to libcore for primitive types, but documentation for libstd and beyond
all links to libstd for primitive types.

This change involves no compiler modifications, it is purely a rustdoc change.
The landing pages for the primitive types primarily serve to show a list of
implemented traits for the primitive type itself.

The primitive types documented includes both strings and slices in a semi-ad-hoc
way, but in a way that should provide at least somewhat meaningful
documentation.

Closes #14474

10 years agorustdoc: Fill in external type parameters correctly
Alex Crichton [Thu, 29 May 2014 06:14:08 +0000 (23:14 -0700)]
rustdoc: Fill in external type parameters correctly

Type parameters were filled in for some areas, but not all. This commit unifies
the two code paths to fill in type parameters everywhere.

Closes #14508

10 years agorustdoc: Stringify more named lifetimes
Alex Crichton [Wed, 28 May 2014 01:07:08 +0000 (18:07 -0700)]
rustdoc: Stringify more named lifetimes

cc #14462

10 years agorustdoc: Show all implementors of traits
Alex Crichton [Wed, 28 May 2014 00:52:40 +0000 (17:52 -0700)]
rustdoc: Show all implementors of traits

When inlining documentation across crates, primitive implementors of traits were
not shown. This commit tweaks the infrastructure to treat primitive and
Path-like impls the same way, displaying all implementors everywhere.

cc #14462

10 years agorustdoc: Freeze the cache ASAP
Alex Crichton [Wed, 28 May 2014 00:15:10 +0000 (17:15 -0700)]
rustdoc: Freeze the cache ASAP

The cache is going to be used earlier in the HTML generation process, which
means that it needs to get into TLS as soon as possible.

10 years agorustdoc: Refactor structure of html::run
Alex Crichton [Wed, 28 May 2014 00:12:48 +0000 (17:12 -0700)]
rustdoc: Refactor structure of html::run

Instead of one giant function, this breaks it up into several smaller functions
which have explicit dependencies among one another.

There are no code changes as a result of this commit.

10 years agoauto merge of #14561 : jakub-/rust/issue-11319, r=alexcrichton
bors [Sun, 1 Jun 2014 04:41:46 +0000 (21:41 -0700)]
auto merge of #14561 : jakub-/rust/issue-11319, r=alexcrichton

Fixes #11319

10 years agodoc: add an `.as_slice` example to the cheatsheet.
Huon Wilson [Sun, 1 Jun 2014 04:11:01 +0000 (14:11 +1000)]
doc: add an `.as_slice` example to the cheatsheet.

A lot of questions about this on IRC and stackoverflow.

10 years agoauto merge of #14567 : cburgdorf/rust/patch-2, r=brson
bors [Sun, 1 Jun 2014 03:01:45 +0000 (20:01 -0700)]
auto merge of #14567 : cburgdorf/rust/patch-2, r=brson

This rewrites the example to also be more aligned with
the same example given in the main tutorial.

10 years agoauto merge of #14566 : cburgdorf/rust/patch-1, r=cmr
bors [Sun, 1 Jun 2014 00:51:44 +0000 (17:51 -0700)]
auto merge of #14566 : cburgdorf/rust/patch-1, r=cmr

Renamed `owned_box` to `on_the_heap` to use a consistent
naming across the tutorial and the life time guide.
Also it makes the example easier to grasp.

10 years agoFix example in lifetime guide
Christoph Burgdorf [Sat, 31 May 2014 21:41:50 +0000 (23:41 +0200)]
Fix example in lifetime guide

This rewrites the example to also be more aligned with
the same example given in the main tutorial.

10 years agoRename variable in tutorial
Christoph Burgdorf [Sat, 31 May 2014 21:33:03 +0000 (23:33 +0200)]
Rename variable in tutorial

Renamed `owned_box` to `on_the_heap` to use a consistent
naming across the tutorial and the life time guide.
Also it makes the example easier to grasp.

10 years agolibtest: Only colorize output if stdout is a tty
Ben Noordhuis [Sat, 31 May 2014 19:55:18 +0000 (21:55 +0200)]
libtest: Only colorize output if stdout is a tty

Fixes #14570.

10 years agoMake the match arm type mismatch message point to the arm's span
Jakub Wieczorek [Fri, 30 May 2014 22:16:33 +0000 (00:16 +0200)]
Make the match arm type mismatch message point to the arm's span

Fixes #11319

10 years agoauto merge of #14562 : jakub-/rust/issue-14541, r=alexcrichton
bors [Sat, 31 May 2014 18:21:38 +0000 (11:21 -0700)]
auto merge of #14562 : jakub-/rust/issue-14541, r=alexcrichton

Fixes #14541

10 years agoauto merge of #14565 : fhartwig/rust/master, r=sfackler
bors [Sat, 31 May 2014 16:36:39 +0000 (09:36 -0700)]
auto merge of #14565 : fhartwig/rust/master, r=sfackler

10 years agoFix broken markup in query_to_str documentation
Florian Hartwig [Sat, 31 May 2014 15:46:35 +0000 (17:46 +0200)]
Fix broken markup in query_to_str documentation

10 years agoauto merge of #14563 : dotdash/rust/clone_kill, r=huonw
bors [Sat, 31 May 2014 14:56:39 +0000 (07:56 -0700)]
auto merge of #14563 : dotdash/rust/clone_kill, r=huonw

By dropping the intermediate vector that holds the relevant candidates
including duplicates and directly building the vector that has the
duplicates removed we can eliminate quite a few allocations. This
reduces the times for type checking by 5-10% (measured with libstd,
libsyntax and librustc).

10 years agoauto merge of #14557 : zwarich/rust/missing-comment, r=alexcrichton
bors [Sat, 31 May 2014 13:16:40 +0000 (06:16 -0700)]
auto merge of #14557 : zwarich/rust/missing-comment, r=alexcrichton

For some reason, I had this comment in my local tree but not in the
branch I sent with the PR.

10 years agoRemove unnecessary allocations / clones during method lookup
Björn Steinbrink [Sat, 31 May 2014 12:21:39 +0000 (14:21 +0200)]
Remove unnecessary allocations / clones during method lookup

By dropping the intermediate vector that holds the relevant candidates
including duplicates and directly building the vector that has the
duplicates removed we can eliminate quite a few allocations. This
reduces the times for type checking by 5-10% (measured with libstd,
libsyntax and librustc).

10 years agoauto merge of #14556 : sfackler/rust/kill-workcache, r=alexcrichton
bors [Sat, 31 May 2014 11:26:40 +0000 (04:26 -0700)]
auto merge of #14556 : sfackler/rust/kill-workcache, r=alexcrichton

This was only ever used by rustpkg and is very unmaintained.

[breaking-change]

10 years agoUse RHS's struct def ID for error messages in pattern matching
Jakub Wieczorek [Fri, 30 May 2014 15:38:15 +0000 (17:38 +0200)]
Use RHS's struct def ID for error messages in pattern matching

Fixes #14541

10 years agoauto merge of #14555 : tomjakubowski/rust/fix-snappy-link, r=alexcrichton
bors [Sat, 31 May 2014 09:46:38 +0000 (02:46 -0700)]
auto merge of #14555 : tomjakubowski/rust/fix-snappy-link, r=alexcrichton

Google have migrated snappy to GitHub.

10 years agoauto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichton
bors [Sat, 31 May 2014 08:06:40 +0000 (01:06 -0700)]
auto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichton

I removed all remaining deprecated owned vectors from the docs. All example tests pass.

10 years agoRemove libworkcache
Steven Fackler [Sat, 31 May 2014 05:04:32 +0000 (22:04 -0700)]
Remove libworkcache

This was only ever used by rustpkg and is very unmaintained.

[breaking-change]

10 years agoauto merge of #14544 : aturon/rust/issue-14352, r=alexcrichton
bors [Sat, 31 May 2014 06:01:43 +0000 (23:01 -0700)]
auto merge of #14544 : aturon/rust/issue-14352, r=alexcrichton

Adds a platform-specific function, `split_paths` to the `os` module. This
function can be used to parse PATH-like environment variables according to
local platform conventions.

Closes #14352.

10 years agoAdd a comment missing from 5aff0e7
Cameron Zwarich [Sat, 31 May 2014 05:31:05 +0000 (22:31 -0700)]
Add a comment missing from 5aff0e7

For some reason, I had this comment in my local tree but not in the
branch I sent with the PR.

10 years agoRemove deprecated owned vector from tutorial.
Jonathan Reem [Sat, 31 May 2014 02:19:52 +0000 (19:19 -0700)]
Remove deprecated owned vector from tutorial.

10 years agoRemove deprecated owned vector from rust.md
Jonathan Reem [Sat, 31 May 2014 02:15:10 +0000 (19:15 -0700)]
Remove deprecated owned vector from rust.md

10 years agoRemove deprecated owned vector from macro guide.
Jonathan Reem [Sat, 31 May 2014 02:05:47 +0000 (19:05 -0700)]
Remove deprecated owned vector from macro guide.

10 years agoRemove deprecated owned vector from intro.
Jonathan Reem [Sat, 31 May 2014 02:03:17 +0000 (19:03 -0700)]
Remove deprecated owned vector from intro.

10 years agoRemove deprecated owned vector from complement cheatsheet.
Jonathan Reem [Sat, 31 May 2014 01:49:48 +0000 (18:49 -0700)]
Remove deprecated owned vector from complement cheatsheet.

10 years agoFix outgoing link to snappy in the FFI guide
Tom Jakubowski [Sat, 31 May 2014 04:27:47 +0000 (21:27 -0700)]
Fix outgoing link to snappy in the FFI guide

Google have migrated snappy to GitHub.

10 years agoauto merge of #14534 : alexcrichton/rust/snapshots, r=sfackler
bors [Sat, 31 May 2014 04:21:39 +0000 (21:21 -0700)]
auto merge of #14534 : alexcrichton/rust/snapshots, r=sfackler

This is part 2 of the saga of renaming the Partial/Total equality and comparison traits.

10 years agoAdd os::split_paths
Aaron Turon [Fri, 30 May 2014 17:31:20 +0000 (10:31 -0700)]
Add os::split_paths

Adds a platform-specific function, `split_paths` to the `os` module. This
function can be used to parse PATH-like environment variables according to
local platform conventions.

Closes #14352.

10 years agosyntax: Prepare for Total{Eq,Ord} => {Eq,Ord}
Alex Crichton [Fri, 30 May 2014 03:57:18 +0000 (20:57 -0700)]
syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}

This commit adds the groundwork for the renaming of the Total{Eq,Ord} traits.
After this commit hits a snapshot, the traits can be renamed.

10 years agoauto merge of #14547 : reem/rust/remove-owned-vec-docs, r=alexcrichton
bors [Fri, 30 May 2014 23:01:35 +0000 (16:01 -0700)]
auto merge of #14547 : reem/rust/remove-owned-vec-docs, r=alexcrichton

The last example in the containers and iterators guide had a superfluous owned vector in it. Everything works fine without it, so I removed it to avoid confusion.

10 years agostd: Rename {Eq,Ord} to Partial{Eq,Ord}
Alex Crichton [Fri, 30 May 2014 00:45:07 +0000 (17:45 -0700)]
std: Rename {Eq,Ord} to Partial{Eq,Ord}

This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]

10 years agoRegister new snapshots
Alex Crichton [Fri, 30 May 2014 00:32:50 +0000 (17:32 -0700)]
Register new snapshots

10 years agoauto merge of #14546 : SimonSapin/rust/patch-13, r=alexcrichton
bors [Fri, 30 May 2014 21:21:37 +0000 (14:21 -0700)]
auto merge of #14546 : SimonSapin/rust/patch-13, r=alexcrichton

CC @alexcrichton
Closes #14545

10 years agoauto merge of #14536 : zwarich/rust/issue-14498, r=luqmana
bors [Fri, 30 May 2014 19:41:39 +0000 (12:41 -0700)]
auto merge of #14536 : zwarich/rust/issue-14498, r=luqmana

Make check_for_assignment_to_restricted_or_frozen_location treat
mutation through an owning pointer the same way it treats mutation
through an &mut pointer, where mutability must be inherited from the
base path.

I also included GC pointers in this check, as that is what the
corresponding code in gather_loans/restrictions.rs does, but I don't
think there is a way to test this with the current language.

Fixes #14498.

10 years agoRemove deprecated owned vector from iterator example.
Jonathan Reem [Fri, 30 May 2014 19:18:52 +0000 (12:18 -0700)]
Remove deprecated owned vector from iterator example.

10 years agoIgnore /build even if it’s a symlink, but only at top-level.
Simon Sapin [Fri, 30 May 2014 18:37:31 +0000 (11:37 -0700)]
Ignore /build even if it’s a symlink, but only at top-level.

10 years agoauto merge of #14520 : Ryman/rust/SnakeCaseLint, r=alexcrichton
bors [Fri, 30 May 2014 18:01:37 +0000 (11:01 -0700)]
auto merge of #14520 : Ryman/rust/SnakeCaseLint, r=alexcrichton

This enforces `snake_case` for functions and methods only. Might be worth extending it to fields and locals too at some point in the future.

A number of breaking changes each detailed in the attached commits.

10 years agowindows: Allow snake_case errors for now.
Kevin Butler [Fri, 30 May 2014 16:07:16 +0000 (17:07 +0100)]
windows: Allow snake_case errors for now.

10 years agolibrustc: Fix snake case errors.
Kevin Butler [Wed, 28 May 2014 19:36:05 +0000 (20:36 +0100)]
librustc: Fix snake case errors.

A number of functions/methods have been moved or renamed to align
better with rust standard conventions.

rustc::back::link::WriteOutputFile => write_output_file
rustc::middle::ty::EmptyBuiltinBounds => empty_builtin_bounds
rustc::middle::ty::AllBuiltinBounds => all_builtin_bounds
rustc::middle::liveness::IrMaps => IrMaps::new
rustc::middle::liveness::Liveness => Liveness::new
rustc::middle::resolve::NameBindings => NameBindings::new
rustc::middle::resolve::PrimitiveTypeTable => PrimitiveTypeTable::new
rustc::middle::resolve::Resolver => Resolver::new
rustc::middle::trans::datum::Datum => Datum::new
rustc::middle::trans::datum::DatumBlock => DatumBlock::new
rustc::middle::trans::datum::Rvalue => Rvalue::new
rustc::middle::typeck::infer::new_ValsAndBindings => ::infer::unify::ValsAndBindings::new
rustc::middle::typeck::infer::region_inference::RegionVarBindings => RegionVarBindings::new

[breaking-change]

10 years agolib{serialize, uuid}: Fix snake case errors.
Kevin Butler [Mon, 26 May 2014 01:32:04 +0000 (02:32 +0100)]
lib{serialize, uuid}: Fix snake case errors.

A number of functions/methods have been moved or renamed to align
better with rust standard conventions.

serialize::ebml::reader::Doc => seriaize::ebml::Doc::new
serialize::ebml::reader::Decoder => Decoder::new
serialize::ebml::writer::Encoder => Encoder::new

[breaking-change]

10 years agolib{std,core,debug,rustuv,collections,native,regex}: Fix snake_case errors.
Kevin Butler [Mon, 26 May 2014 00:12:43 +0000 (01:12 +0100)]
lib{std,core,debug,rustuv,collections,native,regex}: Fix snake_case errors.

A number of functions/methods have been moved or renamed to align
better with rust standard conventions.

std::reflect::MovePtrAdaptor => MovePtrAdaptor::new
debug::reflect::MovePtrAdaptor => MovePtrAdaptor::new
std::repr::ReprVisitor => ReprVisitor::new
debug::repr::ReprVisitor => ReprVisitor::new
rustuv::homing::HomingIO.go_to_IO_home => go_to_io_home

[breaking-change]

10 years agolibsyntax: Fix snake_case errors.
Kevin Butler [Sun, 25 May 2014 23:27:36 +0000 (00:27 +0100)]
libsyntax: Fix snake_case errors.

A number of functions/methods have been moved or renamed to align
better with rust standard conventions.

syntax::ext::mtwt::xorPush => xor_push
syntax::parse::parser::Parser => Parser::new

[breaking-change]

10 years agorustc: Add lint for snake_case functions & methods.
Kevin Butler [Sun, 25 May 2014 22:23:41 +0000 (23:23 +0100)]
rustc: Add lint for snake_case functions & methods.

10 years agoauto merge of #14535 : sfackler/rust/bitv-show, r=alexcrichton
bors [Fri, 30 May 2014 15:26:36 +0000 (08:26 -0700)]
auto merge of #14535 : sfackler/rust/bitv-show, r=alexcrichton

Closes #14531

10 years agoauto merge of #14524 : ahmedcharles/rust/to_string, r=alexcrichton
bors [Fri, 30 May 2014 13:01:41 +0000 (06:01 -0700)]
auto merge of #14524 : ahmedcharles/rust/to_string, r=alexcrichton

10 years agoauto merge of #14522 : aturon/rust/make_unique, r=alexcrichton,alexcrichton,me
bors [Fri, 30 May 2014 11:21:41 +0000 (04:21 -0700)]
auto merge of #14522 : aturon/rust/make_unique, r=alexcrichton,alexcrichton,me

This patch makes `Arc::make_unique` examine the number of weak
references as well as strong references, which is required for safety.

It also adds a `make_unique` method to the `Rc` type for consistency.

Closes #14521.

10 years agoauto merge of #14517 : lucy/rust/issue-14499, r=alexcrichton
bors [Fri, 30 May 2014 09:11:45 +0000 (02:11 -0700)]
auto merge of #14517 : lucy/rust/issue-14499, r=alexcrichton

Fixes #8537
Fixes #14499 (duplicate of #8537)

Old:
```rust
test.rs:2  pub extern "xxxxx" fn add(x: int, y: int) -> int {
                              ^~
```

New:
```rust
test.rs:2  pub extern "xxxxx" fn add(x: int, y: int) -> int {
                      ^~~~~~~
```

10 years agoauto merge of #14514 : Randati/rust/patch-1, r=huonw
bors [Fri, 30 May 2014 07:31:44 +0000 (00:31 -0700)]
auto merge of #14514 : Randati/rust/patch-1, r=huonw

10 years agoauto merge of #14511 : Sawyer47/rust/osrng-rename, r=alexcrichton
bors [Fri, 30 May 2014 05:56:44 +0000 (22:56 -0700)]
auto merge of #14511 : Sawyer47/rust/osrng-rename, r=alexcrichton

According to Rust's style guide acronyms in type names should be
CamelCase.

[breaking-change]

10 years agoFix the handling of assignments to owning pointer paths in check_loans
Cameron Zwarich [Fri, 30 May 2014 04:17:49 +0000 (21:17 -0700)]
Fix the handling of assignments to owning pointer paths in check_loans

Make check_for_assignment_to_restricted_or_frozen_location treat
mutation through an owning pointer the same way it treats mutation
through an &mut pointer, where mutability must be inherited from the
base path.

I also included GC pointers in this check, as that is what the
corresponding code in gather_loans/restrictions.rs does, but I don't
think there is a way to test this with the current language.

Fixes #14498.

10 years agoRename OSRng to OsRng
Piotr Jawniak [Fri, 30 May 2014 04:37:31 +0000 (06:37 +0200)]
Rename OSRng to OsRng

According to Rust's style guide acronyms in type names should be
CamelCase.

[breaking-change]

10 years agoImplement Show for Bitv{,Set}
Steven Fackler [Fri, 30 May 2014 04:29:06 +0000 (21:29 -0700)]
Implement Show for Bitv{,Set}

Closes #14531

10 years agoauto merge of #14512 : Heather/rust/patch-1, r=alexcrichton
bors [Fri, 30 May 2014 04:16:41 +0000 (21:16 -0700)]
auto merge of #14512 : Heather/rust/patch-1, r=alexcrichton

10 years agoauto merge of #14510 : kballard/rust/rename_strallocating_into_owned, r=alexcrichton
bors [Fri, 30 May 2014 02:31:42 +0000 (19:31 -0700)]
auto merge of #14510 : kballard/rust/rename_strallocating_into_owned, r=alexcrichton

We already have into_string(), but it was implemented in terms of
into_owned(). Flip it around and deprecate into_owned().

Remove a few spurious calls to .into_owned() that existed in libregex
and librustdoc.

10 years agoauto merge of #14427 : alexcrichton/rust/librand, r=huonw
bors [Thu, 29 May 2014 23:41:42 +0000 (16:41 -0700)]
auto merge of #14427 : alexcrichton/rust/librand, r=huonw

This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box<T>` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for libcore to not depend on
  liballoc.  Additionally, other pointer types like Rc<T> and Arc<T> were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`,
   but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice
   structure now has a lifetime associated with it.

cc #13851

[breaking-change]

10 years agostd: Recreate a `rand` module
Alex Crichton [Sun, 25 May 2014 08:39:37 +0000 (01:39 -0700)]
std: Recreate a `rand` module

This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box<T>` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for librand to not depend on
  liballoc.  Additionally, other pointer types like Rc<T> and Arc<T> were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`,
  but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice
  structure now has a lifetime associated with it.

* The `sample` method on `Rng` has been moved to a top-level function in the
  `rand` module due to its dependence on `Vec`.

cc #13851

[breaking-change]

10 years agoauto merge of #14486 : michaelwoerister/rust/unified_enum_rep, r=luqmana
bors [Thu, 29 May 2014 21:41:42 +0000 (14:41 -0700)]
auto merge of #14486 : michaelwoerister/rust/unified_enum_rep, r=luqmana

So far the DWARF information for enums was different for regular enums, univariant enums, Option-like enums, etc. Regular enums were encoded as unions of structs, while the other variants were encoded as bare structs. With the changes in this PR all enums are encoded as unions so that debuggers can reconstruct if something originally was a struct, a univariant enum, or an Option-like enum.  For the latter case, information about the *Null* variant is encoded into the union field name. This information can then be used by the debugger to print a `None` value actually as `None` instead of `Some(0x0)`.

The changes in this PR should also fix the regression reported in #14385 and #14411, but I want to close these only after I have confirmation from the original reporters that the issues are actually fixed for them.

10 years agoMake Arc::make_unique check weak refs; add make_unique to Rc
Aaron Turon [Thu, 29 May 2014 18:49:01 +0000 (11:49 -0700)]
Make Arc::make_unique check weak refs; add make_unique to Rc

This patch makes `Arc::make_unique` examine the number of weak
references as well as strong references, which is required for safety.

It also adds a `make_unique` method to the `Rc` type for consistency.

Closes #14521.

10 years agoChange to_owned() to to_string().
Ahmed Charles [Thu, 29 May 2014 18:59:53 +0000 (11:59 -0700)]
Change to_owned() to to_string().

10 years agoauto merge of #14483 : ahmedcharles/rust/patbox, r=alexcrichton
bors [Thu, 29 May 2014 19:11:40 +0000 (12:11 -0700)]
auto merge of #14483 : ahmedcharles/rust/patbox, r=alexcrichton

10 years agosyntax: Fix span on illegal ABI errors
lucy [Thu, 29 May 2014 12:40:41 +0000 (14:40 +0200)]
syntax: Fix span on illegal ABI errors

Fixes #8537
Fixes #14499