]> git.lizzy.rs Git - rust.git/log
rust.git
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 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

10 years agoauto merge of #14492 : alexcrichton/rust/totaleq, r=pnkfelix
bors [Thu, 29 May 2014 17:01:37 +0000 (10:01 -0700)]
auto merge of #14492 : alexcrichton/rust/totaleq, r=pnkfelix

This is a transitionary step towards completing #12517. This change modifies the
compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand
to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord).

After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot
of that, TotalEq/TotalOrd will be renamed to Eq/Ord.

10 years agoauto merge of #14488 : SimonSapin/rust/patch-11, r=alexcrichton
bors [Thu, 29 May 2014 14:51:40 +0000 (07:51 -0700)]
auto merge of #14488 : SimonSapin/rust/patch-11, r=alexcrichton

According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.

10 years agoauto merge of #14487 : arielb1/rust/fix-13933, r=alexcrichton
bors [Thu, 29 May 2014 13:11:39 +0000 (06:11 -0700)]
auto merge of #14487 : arielb1/rust/fix-13933, r=alexcrichton

Fix issue #13933 in a few files. A more complete fix would require core::raw::MutSlice.

10 years agodebuginfo: Make DWARF representation of enums uniform.
Michael Woerister [Thu, 15 May 2014 13:33:51 +0000 (15:33 +0200)]
debuginfo: Make DWARF representation of enums uniform.

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).

10 years agodebuginfo: Add documentation comments to debuginfo.rs
Michael Woerister [Thu, 15 May 2014 12:13:33 +0000 (14:13 +0200)]
debuginfo: Add documentation comments to debuginfo.rs

Conflicts:
src/librustc/middle/trans/debuginfo.rs

10 years agoRevert erroneous fix to tutorial
Randati [Thu, 29 May 2014 12:11:53 +0000 (15:11 +0300)]
Revert erroneous fix to tutorial

10 years agoauto merge of #14481 : alexcrichton/rust/no-format-strbuf, r=sfackler
bors [Thu, 29 May 2014 10:31:39 +0000 (03:31 -0700)]
auto merge of #14481 : alexcrichton/rust/no-format-strbuf, r=sfackler

* Removes `format_strbuf!()`

10 years agoauto merge of #14506 : luqmana/rust/fc, r=alexcrichton
bors [Thu, 29 May 2014 08:51:51 +0000 (01:51 -0700)]
auto merge of #14506 : luqmana/rust/fc, r=alexcrichton

This used to be clang only but accidentally became the default for everyone.

10 years agoauto merge of #14472 : huonw/rust/native-lib-warnings, r=alexcrichton
bors [Thu, 29 May 2014 07:16:41 +0000 (00:16 -0700)]
auto merge of #14472 : huonw/rust/native-lib-warnings, r=alexcrichton

rustc: clarify warning about native deps for a staticlib.

This adjusts the "unlinked native library" warning one receives when
compiling with `crate_type="staticlib"`. The warning is just trying to
tell the user that they need to link against these libraries, but the
old text wasn't making this obvious, the new text says this explicitly.

10 years agoremove /build from .gitignore since there is build/
Heather [Thu, 29 May 2014 06:39:14 +0000 (23:39 -0700)]
remove /build from .gitignore since there is build/

10 years agoauto merge of #14477 : alexcrichton/rust/issue-14456, r=brson
bors [Thu, 29 May 2014 05:41:38 +0000 (22:41 -0700)]
auto merge of #14477 : alexcrichton/rust/issue-14456, r=brson

When spawning a process, stdio file descriptors can be configured to be ignored,
which basically means that they'll be closed. Currently this is done by
literally closing the file descriptors in the child, but this can have adverse
side effects if the child process then opens a new file descriptor, assigning it
to a stdio number.

To work around the problems of the child, this commit alters the process
spawning code to map stdio fds to /dev/null on unix (and a similar equivalent on
windows) when they are specified as being ignored. This should allow spawned
programs to have more expected behavior when opening new files.

Closes #14456

10 years agoReplace StrAllocating.into_owned() with .into_string()
Kevin Ballard [Thu, 29 May 2014 03:45:44 +0000 (20:45 -0700)]
Replace StrAllocating.into_owned() with .into_string()

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 #14451 : alexcrichton/rust/issue-14442, r=brson
bors [Thu, 29 May 2014 03:01:37 +0000 (20:01 -0700)]
auto merge of #14451 : alexcrichton/rust/issue-14442, r=brson

This avoids having to perform conversions from `*u8` to `&'static str` which can
suck in a good deal of code.

Closes #14442

10 years agoDon't enable libcpp for llvm by default.
Luqman Aden [Thu, 29 May 2014 00:04:14 +0000 (17:04 -0700)]
Don't enable libcpp for llvm by default.

10 years agoauto merge of #14476 : luqmana/rust/docs, r=alexcrichton
bors [Thu, 29 May 2014 01:21:34 +0000 (18:21 -0700)]
auto merge of #14476 : luqmana/rust/docs, r=alexcrichton

We were still generating compiler docs even with --disable-docs passed.

cc @pnkfelix

10 years agoauto merge of #14465 : Ryman/rust/patch-1, r=alexcrichton
bors [Wed, 28 May 2014 23:01:36 +0000 (16:01 -0700)]
auto merge of #14465 : Ryman/rust/patch-1, r=alexcrichton

10 years agoauto merge of #14298 : kmcallister/rust/pattern-macros, r=huonw
bors [Wed, 28 May 2014 21:21:40 +0000 (14:21 -0700)]
auto merge of #14298 : kmcallister/rust/pattern-macros, r=huonw

First commit is an unrelated fix for a test suite warning I introduced last week.

10 years agoTest pattern macros
Keegan McAllister [Mon, 19 May 2014 22:14:23 +0000 (15:14 -0700)]
Test pattern macros

10 years agoParse macros in patterns
Keegan McAllister [Mon, 19 May 2014 22:03:48 +0000 (15:03 -0700)]
Parse macros in patterns

Fixes #6830.

10 years agoExpand macros in patterns
Keegan McAllister [Mon, 19 May 2014 20:59:35 +0000 (13:59 -0700)]
Expand macros in patterns

10 years agoAdd patterns to MacResult
Keegan McAllister [Mon, 19 May 2014 20:32:51 +0000 (13:32 -0700)]
Add patterns to MacResult

10 years agoAdd AST node for pattern macros
Keegan McAllister [Mon, 19 May 2014 20:29:41 +0000 (13:29 -0700)]
Add AST node for pattern macros

10 years agoSilence warning in RefCell test suite
Keegan McAllister [Mon, 19 May 2014 22:12:07 +0000 (15:12 -0700)]
Silence warning in RefCell test suite

10 years agoauto merge of #14464 : Sawyer47/rust/issue-12925, r=alexcrichton
bors [Wed, 28 May 2014 19:41:40 +0000 (12:41 -0700)]
auto merge of #14464 : Sawyer47/rust/issue-12925, r=alexcrichton

This is an attempt of fixing #12925.

This PR moves almost all trait implementations for primitive types ((), bool, char, i*, u*, f*) near trait definitions. Only Float trait implementations weren't moved because they heavily rely on constants defined in f32.rs and f64.rs.

Some trait implementations had cfg(not(test)) attribute. I suspect it's because of issue 2912.
Still, someone who knows the problem better should probably check this code.

Closes #12925

10 years agoauto merge of #13738 : buttslol/rust/armv7-support, r=alexcrichton
bors [Wed, 28 May 2014 18:06:42 +0000 (11:06 -0700)]
auto merge of #13738 : buttslol/rust/armv7-support, r=alexcrichton

This was required to get ./configure to work on my armv7 test machine.

I haven't found anything sane to feature gate `hf` on that's pokable from the context of the configure script.

It also seems that gcc doesn't work on armv7 by default (rust wants to pass it `-m32` which isn't supported), would it be preferential to make the default `--enable-clang` on arm, or remove the `-m32` flag on that platform?

10 years agorustc: Accept PartialOrd/PartialOrdEq for Eq/Ord
Alex Crichton [Wed, 28 May 2014 17:00:00 +0000 (10:00 -0700)]
rustc: Accept PartialOrd/PartialOrdEq for Eq/Ord

This is a transitionary step towards completing #12517. This change modifies the
compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand
to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord).

After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot
of that, TotalEq/TotalOrd will be renamed to Eq/Ord.

10 years agoIssue #13933: Remove transmute_mut from Arc
Ariel Ben-Yehuda [Wed, 28 May 2014 11:09:50 +0000 (14:09 +0300)]
Issue #13933: Remove transmute_mut from Arc

directly use the internal pointer instead.

10 years agoauto merge of #14437 : Sawyer47/rust/utf16-items, r=alexcrichton
bors [Wed, 28 May 2014 16:26:42 +0000 (09:26 -0700)]
auto merge of #14437 : Sawyer47/rust/utf16-items, r=alexcrichton

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

10 years agoIssue #13933: Remove transmute_mut from IO
Ariel Ben-Yehuda [Wed, 28 May 2014 10:47:30 +0000 (13:47 +0300)]
Issue #13933: Remove transmute_mut from IO

The IO libraries casted self to mut so they can pass it to seek(SEEK_CUR, 0).
Fix this by introducing a private seek function that takes &self
  - of course one should be careful with it if he lacks an
    exclusive reference to self.

10 years agostd: Remove format_strbuf!()
Alex Crichton [Wed, 28 May 2014 03:44:58 +0000 (20:44 -0700)]
std: Remove format_strbuf!()

This was only ever a transitionary macro.

10 years agoMove trait impls for primitives near trait definition
Piotr Jawniak [Mon, 26 May 2014 17:33:04 +0000 (19:33 +0200)]
Move trait impls for primitives near trait definition

Closes #12925

10 years agoauto merge of #14463 : SergioBenitez/rust/deprecation-fix, r=alexcrichton
bors [Wed, 28 May 2014 14:46:45 +0000 (07:46 -0700)]
auto merge of #14463 : SergioBenitez/rust/deprecation-fix, r=alexcrichton

The deprecation warning text for mem::move_val_init was incorrect. It should point users to `overwrite` instead of itself.

10 years agoDoc: `static mut` is unsafe too
Simon Sapin [Wed, 28 May 2014 13:19:25 +0000 (14:19 +0100)]
Doc: `static mut` is unsafe too

According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.

10 years agoauto merge of #14458 : huonw/rust/rustdoc-cross-crate-link-path, r=alexcrichton
bors [Wed, 28 May 2014 13:06:47 +0000 (06:06 -0700)]
auto merge of #14458 : huonw/rust/rustdoc-cross-crate-link-path, r=alexcrichton

Previously this was adding one-too-many `..`s to the path for the
`gotosrc=...` links for local crates. Also, the `root_path` already ends
in `/`s so a trailing / shouldn't be added after the root (some servers
treat `...//...` different to `.../...` including the one running
doc.rust-lang.org).

10 years agorustdoc: cross-crate source links are one level lower.
Huon Wilson [Tue, 27 May 2014 12:52:00 +0000 (22:52 +1000)]
rustdoc: cross-crate source links are one level lower.

Previously this was adding one-too-many `..`s to the path for the
`gotosrc=...` links for local crates. Also, the `root_path` already ends
in `/`s so a trailing / shouldn't be added after the root (some servers
treat `...//...` different to `.../...` including the one running
doc.rust-lang.org).

10 years agoauto merge of #14459 : seanmonstar/rust/select-docs, r=alexcrichton
bors [Wed, 28 May 2014 11:21:42 +0000 (04:21 -0700)]
auto merge of #14459 : seanmonstar/rust/select-docs, r=alexcrichton

10 years agoauto merge of #14455 : crabtw/rust/mips, r=alexcrichton
bors [Wed, 28 May 2014 09:41:44 +0000 (02:41 -0700)]
auto merge of #14455 : crabtw/rust/mips, r=alexcrichton

Because IPv4 address conversion doesn't consider big-endian target, I add functions to handle that.
These function names may need to be changed, but I can't come up with a good one.

10 years agoRename UTF16Item[s] to Utf16Item[s]
Piotr Jawniak [Sun, 25 May 2014 15:35:30 +0000 (17:35 +0200)]
Rename UTF16Item[s] to Utf16Item[s]

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

[breaking-change]

10 years agoauto merge of #14454 : omasanori/rust/cfg_cxx, r=alexcrichton
bors [Wed, 28 May 2014 08:06:45 +0000 (01:06 -0700)]
auto merge of #14454 : omasanori/rust/cfg_cxx, r=alexcrichton

10 years agoconfigure: setup triples on hf arm platforms
Richo Healey [Wed, 28 May 2014 06:42:35 +0000 (23:42 -0700)]
configure: setup triples on hf arm platforms

10 years agoconfigure: Only use -m32 on x86-* 32 bit systems
Richo Healey [Wed, 28 May 2014 06:37:46 +0000 (23:37 -0700)]
configure: Only use -m32 on x86-* 32 bit systems

10 years agoconfigure: Move clang's libcpp out into flag
Richo Healey [Wed, 28 May 2014 06:32:07 +0000 (23:32 -0700)]
configure: Move clang's libcpp out into flag

10 years agoauto merge of #14452 : alexcrichton/rust/issue-14438, r=huonw
bors [Wed, 28 May 2014 06:26:47 +0000 (23:26 -0700)]
auto merge of #14452 : alexcrichton/rust/issue-14438, r=huonw

This commit alters rustdoc to keep a hash set of known inlined items which is a
whitelist for generating URLs to.

Closes #14438

10 years agoRename PatUniq to PatBox. Fixes part of #13910.
Ahmed Charles [Tue, 27 May 2014 00:55:54 +0000 (17:55 -0700)]
Rename PatUniq to PatBox. Fixes part of #13910.

10 years agoauto merge of #14364 : alexcrichton/rust/libdebug, r=brson
bors [Wed, 28 May 2014 04:46:46 +0000 (21:46 -0700)]
auto merge of #14364 : alexcrichton/rust/libdebug, r=brson

This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]

10 years agoMove std::{reflect,repr,Poly} to a libdebug crate
Alex Crichton [Thu, 22 May 2014 18:28:01 +0000 (11:28 -0700)]
Move std::{reflect,repr,Poly} to a libdebug crate

This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]

10 years agorustdoc: Only link to local inlined foreign items
Alex Crichton [Tue, 27 May 2014 04:51:59 +0000 (21:51 -0700)]
rustdoc: Only link to local inlined foreign items

This commit alters rustdoc to keep a hash set of known inlined items which is a
whitelist for generating URLs to.

Closes #14438

10 years agoauto merge of #14387 : alan-andrade/rust/remove_managed_boxes_and_gc, r=brson
bors [Wed, 28 May 2014 02:31:46 +0000 (19:31 -0700)]
auto merge of #14387 : alan-andrade/rust/remove_managed_boxes_and_gc, r=brson

My main goals were:
- be clear when we talk about "references" and "pointers"
- remove Managed boxes completely and the concept of GC.

https://github.com/mozilla/rust/issues/13987

10 years agonative: Ignore stdio fds with /dev/null
Alex Crichton [Tue, 27 May 2014 19:08:27 +0000 (12:08 -0700)]
native: Ignore stdio fds with /dev/null

When spawning a process, stdio file descriptors can be configured to be ignored,
which basically means that they'll be closed. Currently this is done by
literally closing the file descriptors in the child, but this can have adverse
side effects if the child process then opens a new file descriptor, assigning it
to a stdio number.

To work around the problems of the child, this commit alters the process
spawning code to map stdio fds to /dev/null on unix (and a similar equivalent on
windows) when they are specified as being ignored. This should allow spawned
programs to have more expected behavior when opening new files.

Closes #14456

10 years agoauto merge of #14414 : richo/rust/features/nerf_unused_string_fns, r=alexcrichton
bors [Wed, 28 May 2014 00:46:48 +0000 (17:46 -0700)]
auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, r=alexcrichton

This should block on #14323

10 years agomk: Don't build any docs with --disable-docs.
Luqman Aden [Wed, 28 May 2014 00:17:17 +0000 (20:17 -0400)]
mk: Don't build any docs with --disable-docs.

10 years agoauto merge of #14447 : erickt/rust/show-treemap, r=kballard
bors [Tue, 27 May 2014 23:11:39 +0000 (16:11 -0700)]
auto merge of #14447 : erickt/rust/show-treemap, r=kballard

This is a hodge podge of a couple small cleanup commits. It implements `Show` for `TreeMap` and `TreeSet`, and some removal of commented out code.

10 years agorustc: clarify warning about native deps for a staticlib.
Huon Wilson [Tue, 27 May 2014 22:49:07 +0000 (08:49 +1000)]
rustc: clarify warning about native deps for a staticlib.

This adjusts the "unlinked native library" warning one receives when
compiling with `crate_type="staticlib"`. The warning is just trying to
tell the user that they need to link against these libraries, but the
old text wasn't making this obvious; the new text says this explicitly.

10 years agoauto merge of #14444 : huonw/rust/nice-for-errors, r=alexcrichton
bors [Tue, 27 May 2014 21:36:40 +0000 (14:36 -0700)]
auto merge of #14444 : huonw/rust/nice-for-errors, r=alexcrichton

Change `for` desugaring & make refutable pattern errors more precise

This changes for to desugar to the `let`-based pattern match as described in #14390, and adjusts the compiler to use this information for error messages that even mention that it's in a `for` loop.

Also, it makes the compiler record the exact positions of refutable parts of a pattern, to point to exactly them in error messages.

10 years agorust manual: supertraits seperator is wrong
Ryman [Tue, 27 May 2014 20:40:50 +0000 (21:40 +0100)]
rust manual: supertraits seperator is wrong

10 years agoauto merge of #14435 : P1start/rust/str-docs-fix, r=sfackler
bors [Tue, 27 May 2014 20:01:40 +0000 (13:01 -0700)]
auto merge of #14435 : P1start/rust/str-docs-fix, r=sfackler

This tweaks the `std::str` docs to compensate for the recent shift from `~str` to `String`.

10 years agodoc: Fix link to string
Richo Healey [Tue, 27 May 2014 18:37:30 +0000 (11:37 -0700)]
doc: Fix link to string

This was missed in 553074506ecd139eb961fb91eb33ad9fd0183acb

10 years agostd: Rename strbuf operations to string
Richo Healey [Sun, 25 May 2014 10:17:19 +0000 (03:17 -0700)]
std: Rename strbuf operations to string

[breaking-change]

10 years agoauto merge of #14428 : alexcrichton/rust/issue-14422, r=pcwalton
bors [Tue, 27 May 2014 18:26:40 +0000 (11:26 -0700)]
auto merge of #14428 : alexcrichton/rust/issue-14422, r=pcwalton

This ensures that a public typedef to a private item is ensured to be public in
terms of linkage. This affects both the visibility of the library's symbols as
well as other lints based on privacy (dead_code for example).

Closes #14421
Closes #14422

10 years agoFixed deprecation warning text for mem::move_val_init and its associated comment.
Sergio Benitez [Tue, 27 May 2014 18:15:34 +0000 (14:15 -0400)]
Fixed deprecation warning text for mem::move_val_init and its associated comment.

10 years agostd: Remove String's to_owned
Richo Healey [Sun, 25 May 2014 10:10:11 +0000 (03:10 -0700)]
std: Remove String's to_owned

10 years agocollections: implement Show for Tree{Map,Set}
Erick Tryzelaar [Tue, 27 May 2014 17:38:52 +0000 (10:38 -0700)]
collections: implement Show for Tree{Map,Set}

10 years agocollections: add Show impl test for HashMap
Erick Tryzelaar [Mon, 26 May 2014 22:20:39 +0000 (15:20 -0700)]
collections: add Show impl test for HashMap

10 years agoserialize: Remove old commented out code
Erick Tryzelaar [Sat, 17 May 2014 15:32:55 +0000 (08:32 -0700)]
serialize: Remove old commented out code

10 years agofix MIPS target
Jyun-Yan You [Tue, 27 May 2014 09:00:50 +0000 (17:00 +0800)]
fix MIPS target

10 years agorustc: Account for typedefs in privacy
Alex Crichton [Sun, 25 May 2014 21:43:30 +0000 (14:43 -0700)]
rustc: Account for typedefs in privacy

This ensures that a public typedef to a private item is ensured to be public in
terms of linkage. This affects both the visibility of the library's symbols as
well as other lints based on privacy (dead_code for example).

Closes #14421
Closes #14422

10 years agostd: change select! docs from 'ports' to 'receivers'
Sean McArthur [Tue, 27 May 2014 14:20:06 +0000 (07:20 -0700)]
std: change select! docs from 'ports' to 'receivers'

10 years agoUse clang++ for CXX when --enable-clang.
OGINO Masanori [Tue, 27 May 2014 09:48:32 +0000 (18:48 +0900)]
Use clang++ for CXX when --enable-clang.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #14429 : sanrodari/rust/patch-1, r=sfackler
bors [Tue, 27 May 2014 09:16:32 +0000 (02:16 -0700)]
auto merge of #14429 : sanrodari/rust/patch-1, r=sfackler

10 years agorustc: Use rust strings for failure arguments
Alex Crichton [Mon, 26 May 2014 17:33:18 +0000 (10:33 -0700)]
rustc: Use rust strings for failure arguments

This avoids having to perform conversions from `*u8` to `&'static str` which can
suck in a good deal of code.

Closes #14442