]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agolibstd: set baseline stability levels.
Aaron Turon [Tue, 1 Jul 2014 00:22:40 +0000 (17:22 -0700)]
libstd: set baseline stability levels.

Earlier commits have established a baseline of `experimental` stability
for all crates under the facade (so their contents are considered
experimental within libstd). Since `experimental` is `allow` by
default, we should use the same baseline stability for libstd itself.

This commit adds `experimental` tags to all of the modules defined in
`std`, and `unstable` to `std` itself.

10 years agoauto merge of #15238 : aochagavia/rust/json, r=alexcrichton
bors [Mon, 30 Jun 2014 21:16:32 +0000 (21:16 +0000)]
auto merge of #15238 : aochagavia/rust/json, r=alexcrichton

### Breaking changes:

* **Removed unnecessary `box` from enum variant (`Object(Box<Object>)` becomes `Object(Object)`)**
* **Deprecated `Encoder::str_encode`**

### Other changes:

* Tried to make the code more idiomatic
* Renamed the `wr` field of the `Encoder` and `PrettyEncoder` structs to `writer`
* Replaced some `from_utf8` by `from_utf8_owned` to avoid unnecessary allocations
* Removed unnecessary `unsafe` code
* Added `encode` and `decode` shortcut functions
* Implemented `FromStr` for `Json`
* Implemented `ToJson` for tuples of arity up to 12
* Fixed some details in the documentation

### Questions

* ~~The `encode` shortcut function does the same as the `Encoder::str_encode` function. It seems wrong to me that two functions do exactly the same. Should we deprecate `Encoder::str_encode`?~~
* ~~Do we really want the ToJson trait for tuples? At the moment we have it for (), (A, B), (A, B, C). I would like to remove them.~~
* ~~We are using `String` as key in the `TreeMap` representing a `Json` object. It would be better to use `&str`, but this would require to annotate lots of lifetimes. Is there any easy solution for this?~~
* There is a lot of duplicated code (`PrettyEncoder` copies about 50 lines from `Encoder`). In an OO language this could be solved very elegantly by using inheritance and overriding. What can we do here to reduce the amount of boilerplate?

[breaking-change]

10 years agoImplement ToJson for all tuples
Adolfo Ochagavía [Sun, 29 Jun 2014 09:33:45 +0000 (11:33 +0200)]
Implement ToJson for all tuples

10 years agoFix issues in librustdoc
Adolfo Ochagavía [Sat, 28 Jun 2014 17:28:29 +0000 (19:28 +0200)]
Fix issues in librustdoc

10 years agoFix issue with tests
Adolfo Ochagavía [Sat, 28 Jun 2014 15:27:29 +0000 (17:27 +0200)]
Fix issue with tests

10 years agoFix issues in libtest
Adolfo Ochagavía [Sat, 28 Jun 2014 14:37:28 +0000 (16:37 +0200)]
Fix issues in libtest

10 years agoFix JSON documentation
Adolfo Ochagavía [Sat, 28 Jun 2014 13:59:45 +0000 (15:59 +0200)]
Fix JSON documentation

Fixed some errors, removed some code examples and added usage of the
`encode` and `decode` functions.

10 years agoImplement FromStr for Json
Adolfo Ochagavía [Sat, 28 Jun 2014 13:39:49 +0000 (15:39 +0200)]
Implement FromStr for Json

10 years agoAdd `encode` and `decode` shortcut functions
Adolfo Ochagavía [Sat, 28 Jun 2014 13:33:37 +0000 (15:33 +0200)]
Add `encode` and `decode` shortcut functions

Now you can just use `json::encode` and `json::decode`, which is very
practical

**Deprecated `Encoder::str_encode` in favor of `json::encode`**

[breaking-change]

10 years agoRemoved unnecessary Box
Adolfo Ochagavía [Sat, 28 Jun 2014 12:41:40 +0000 (14:41 +0200)]
Removed unnecessary Box

10 years agoJSON cleanup
Adolfo Ochagavía [Sat, 28 Jun 2014 12:34:58 +0000 (14:34 +0200)]
JSON cleanup

* Tried to make the code more idiomatic
* Renamed the `wr` field of the `Encoder` and `PrettyEncoder` structs to `writer`
* Replaced some `from_utf8` by `from_utf8_owned` to avoid unnecessary allocations
* Removed unnecessary `unsafe` code

10 years agoauto merge of #14613 : schmee/rust/utf16-iterator, r=huonw
bors [Mon, 30 Jun 2014 19:26:35 +0000 (19:26 +0000)]
auto merge of #14613 : schmee/rust/utf16-iterator, r=huonw

Closes #14358.

~~The tests are not yet moved to `utf16_iter`, so this probably won't compile. I'm submitting this PR anyway so it can be reviewed and since it was mentioned in #14611.~~ EDIT: Tests now use `utf16_iter`.

This deprecates `.to_utf16`. `x.to_utf16()` should be replaced by either `x.utf16_iter().collect::<Vec<u16>>()` (the type annotation may be optional), or just `x.utf16_iter()` directly, if it can be used in an iterator context.

[breaking-change]

cc @huonw

10 years agoAdd `utf16_units`
John Schmidt [Sat, 31 May 2014 11:02:29 +0000 (13:02 +0200)]
Add `utf16_units`

This deprecates `.to_utf16`. `x.to_utf16()` should be replaced by either
`x.utf16_units().collect::<Vec<u16>>()` (the type annotation may be optional), or
just `x.utf16_units()` directly, if it can be used in an iterator context.

Closes #14358

[breaking-change]

10 years agoauto merge of #15275 : sfackler/rust/distcheck, r=alexcrichton
bors [Mon, 30 Jun 2014 16:36:33 +0000 (16:36 +0000)]
auto merge of #15275 : sfackler/rust/distcheck, r=alexcrichton

libcoretest wasn't being included which broke the verification of the
tarball.

10 years agoFix distcheck
Steven Fackler [Mon, 30 Jun 2014 16:13:09 +0000 (09:13 -0700)]
Fix distcheck

libcoretest wasn't being included which broke the verification of the
tarball.

10 years agoauto merge of #15267 : ruud-v-a/rust/patch-1, r=huonw
bors [Mon, 30 Jun 2014 14:06:31 +0000 (14:06 +0000)]
auto merge of #15267 : ruud-v-a/rust/patch-1, r=huonw

[This commit](https://github.com/rust-lang/rust/commit/25fe2cadb10db1a54cefbd1520708d4397874bc3#diff-04c6e90faac2675aa89e2176d2eec7d8R57) forgot to remove one line.

10 years agoauto merge of #15259 : steveklabnik/rust/patch-3, r=alexcrichton
bors [Mon, 30 Jun 2014 12:16:30 +0000 (12:16 +0000)]
auto merge of #15259 : steveklabnik/rust/patch-3, r=alexcrichton

It wasn't clear if we needed to install Hello World or Cargo.

10 years agoauto merge of #15262 : zecozephyr/rust/15620, r=luqmana
bors [Mon, 30 Jun 2014 10:26:28 +0000 (10:26 +0000)]
auto merge of #15262 : zecozephyr/rust/15620, r=luqmana

Fixes #15260

10 years agofix typo in readme
Ruud van Asseldonk [Mon, 30 Jun 2014 09:17:25 +0000 (11:17 +0200)]
fix typo in readme

10 years agoauto merge of #15237 : zzmp/rust/feat/markdown-in-crate-documentation, r=huonw
bors [Mon, 30 Jun 2014 07:31:29 +0000 (07:31 +0000)]
auto merge of #15237 : zzmp/rust/feat/markdown-in-crate-documentation, r=huonw

This makes the `in-header`, `markdown-before-content`, and `markdown-after-content` options available to `rustdoc` when generating documentation for any crate.

Before, these options were only available when creating documentation *from* markdown. Now, they are available when generating documentation from source.

This also updates the `rustdoc -h` output to reflect these changes. It does not update the `man rustdoc` page, nor does it update the documentation in [the `rustdoc` manual](http://doc.rust-lang.org/rustdoc.html).

10 years agoAllow external html in rustdoc for crates.
zzmp [Sat, 28 Jun 2014 10:35:25 +0000 (03:35 -0700)]
Allow external html in rustdoc for crates.

Updated documentation to reflect md->html.
Modularized external file loading.

10 years agolibrustc: Don't ICE on binding same field multiple times in struct
Jonathan Bailey [Mon, 30 Jun 2014 05:29:33 +0000 (22:29 -0700)]
librustc: Don't ICE on binding same field multiple times in struct
pattern.

10 years agoauto merge of #15030 : sfackler/rust/partial-cmp, r=huonw
bors [Mon, 30 Jun 2014 05:36:25 +0000 (05:36 +0000)]
auto merge of #15030 : sfackler/rust/partial-cmp, r=huonw

I ended up altering the semantics of Json's PartialOrd implementation.
It used to be the case that Null < Null, but I can't think of any reason
for an ordering other than the default one so I just switched it over to
using the derived implementation.

This also fixes broken `PartialOrd` implementations for `Vec` and
`TreeMap`.

# Note
This isn't ready to merge yet since libcore tests are broken as you end up with 2 versions of `Option`. The rest should be reviewable though.

RFC: 0028-partial-cmp

10 years agoImplement RFC#28: Add PartialOrd::partial_cmp
Steven Fackler [Wed, 18 Jun 2014 06:25:51 +0000 (23:25 -0700)]
Implement RFC#28: Add PartialOrd::partial_cmp

I ended up altering the semantics of Json's PartialOrd implementation.
It used to be the case that Null < Null, but I can't think of any reason
for an ordering other than the default one so I just switched it over to
using the derived implementation.

This also fixes broken `PartialOrd` implementations for `Vec` and
`TreeMap`.

RFC: 0028-partial-cmp

10 years agoauto merge of #15256 : erickt/rust/optimizations, r=alexcrichton
bors [Mon, 30 Jun 2014 03:46:25 +0000 (03:46 +0000)]
auto merge of #15256 : erickt/rust/optimizations, r=alexcrichton

The bug #11084 causes `option::collect` and `result::collect` about twice as slower as it should because llvm is having some trouble optimizing away the scan closure. This gets rid of it so now those functions perform equivalent to a hand written version.

This also adds an impl of `Default` for `Rc` along the way.

10 years agoauto merge of #15254 : alex/rust/patch-1, r=alexcrichton
bors [Mon, 30 Jun 2014 01:56:26 +0000 (01:56 +0000)]
auto merge of #15254 : alex/rust/patch-1, r=alexcrichton

This makes the docs ever-so-slightly easier to read.

10 years agoit -> Cargo
Steve Klabnik [Mon, 30 Jun 2014 01:51:41 +0000 (21:51 -0400)]
it -> Cargo

It wasn't clear if we needed to install Hello World or Cargo.

10 years agoauto merge of #15245 : sfackler/rust/coretest, r=alexcrichton
bors [Sun, 29 Jun 2014 23:36:43 +0000 (23:36 +0000)]
auto merge of #15245 : sfackler/rust/coretest, r=alexcrichton

Libcore's test infrastructure is complicated by the fact that many lang
items are defined in the crate. The current approach (realcore/realstd
imports) is hacky and hard to work with (tests inside of core::cmp
haven't been run for months!).

Moving tests to a separate crate does mean that they can only test the
public API of libcore, but I don't feel that that is too much of an
issue. The only tests that I had to get rid of were some checking the
various numeric formatters, but those are also exercised through normal
format! calls in other tests.

10 years agoExtract tests from libcore to a separate crate
Steven Fackler [Sat, 28 Jun 2014 20:57:36 +0000 (13:57 -0700)]
Extract tests from libcore to a separate crate

Libcore's test infrastructure is complicated by the fact that many lang
items are defined in the crate. The current approach (realcore/realstd
imports) is hacky and hard to work with (tests inside of core::cmp
haven't been run for months!).

Moving tests to a separate crate does mean that they can only test the
public API of libcore, but I don't feel that that is too much of an
issue. The only tests that I had to get rid of were some checking the
various numeric formatters, but those are also exercised through normal
format! calls in other tests.

10 years agoauto merge of #15252 : alexcrichton/rust/issue-15231, r=pcwalton
bors [Sun, 29 Jun 2014 21:41:45 +0000 (21:41 +0000)]
auto merge of #15252 : alexcrichton/rust/issue-15231, r=pcwalton

When cloning a stream, the data is already guaranteed to be in a consistent
state, so there's no need to perform a zeroing. This prevents segfaults as seen
in #15231

Closes #15231

10 years agoauto merge of #15234 : pcwalton/rust/integer-fallback-and-casts, r=alexcrichton
bors [Sun, 29 Jun 2014 19:46:46 +0000 (19:46 +0000)]
auto merge of #15234 : pcwalton/rust/integer-fallback-and-casts, r=alexcrichton

This will break code that looks like:

    let mut x = 0;
    while ... {
        x += 1;
    }
    println!("{}", x);

Change that code to:

    let mut x = 0i;
    while ... {
        x += 1;
    }
    println!("{}", x);

Closes #15201.

[breaking-change]

r? @alexcrichton

10 years agocore: optimize {option,result}::collect
Erick Tryzelaar [Mon, 23 Jun 2014 23:27:54 +0000 (19:27 -0400)]
core: optimize {option,result}::collect

The bug #11084 causes these collect functions to run about
twice as slow as they should because llvm is having trouble
optimizing away the closure for some reason. This patch works
around that performance bug by using a simple adapter iterator
explicitly for capturing if the outer iterator returns an
error.

10 years agoalloc: impl Default for Rc
Erick Tryzelaar [Mon, 23 Jun 2014 23:09:19 +0000 (19:09 -0400)]
alloc: impl Default for Rc

10 years agocollections: minor cleanup
Erick Tryzelaar [Mon, 23 Jun 2014 23:01:03 +0000 (19:01 -0400)]
collections: minor cleanup

10 years agolibrustc: Remove the fallback to `int` for integers and `f64` for
Patrick Walton [Fri, 27 Jun 2014 19:30:25 +0000 (12:30 -0700)]
librustc: Remove the fallback to `int` for integers and `f64` for
floating point numbers for real.

This will break code that looks like:

    let mut x = 0;
    while ... {
        x += 1;
    }
    println!("{}", x);

Change that code to:

    let mut x = 0i;
    while ... {
        x += 1;
    }
    println!("{}", x);

Closes #15201.

[breaking-change]

10 years agoWrap two code examples in backticks
Alex Gaynor [Sun, 29 Jun 2014 18:11:03 +0000 (11:11 -0700)]
Wrap two code examples in backticks

This makes the docs ever-so-slightly easier to read.

10 years agoauto merge of #15246 : Sawyer47/rust/rand-doc-fix, r=alexcrichton
bors [Sun, 29 Jun 2014 17:51:39 +0000 (17:51 +0000)]
auto merge of #15246 : Sawyer47/rust/rand-doc-fix, r=alexcrichton

Documentation didn't match with parameter name.
Changes name of parameter in docs and function to 'amount'.

10 years agorustuv: Don't zero-out data on clones
Alex Crichton [Sun, 29 Jun 2014 16:38:07 +0000 (09:38 -0700)]
rustuv: Don't zero-out data on clones

When cloning a stream, the data is already guaranteed to be in a consistent
state, so there's no need to perform a zeroing. This prevents segfaults as seen
in #15231

Closes #15231

10 years agoauto merge of #15249 : aochagavia/rust/rand, r=huonw
bors [Sun, 29 Jun 2014 13:11:36 +0000 (13:11 +0000)]
auto merge of #15249 : aochagavia/rust/rand, r=huonw

10 years agoauto merge of #14904 : huonw/rust/cstr-remove-withref, r=alexcrichton
bors [Sun, 29 Jun 2014 11:21:39 +0000 (11:21 +0000)]
auto merge of #14904 : huonw/rust/cstr-remove-withref, r=alexcrichton

10 years agoc_str: move `.unwrap` & document it more clearly.
Huon Wilson [Sat, 14 Jun 2014 22:42:55 +0000 (08:42 +1000)]
c_str: move `.unwrap` & document it more clearly.

This should be called rarely, but it was placed first in the list of
methods, making it very tempting to call.

10 years agoc_str: replace .with_ref with .as_ptr throughout the codebase.
Huon Wilson [Sat, 14 Jun 2014 12:50:07 +0000 (22:50 +1000)]
c_str: replace .with_ref with .as_ptr throughout the codebase.

10 years agoc_str: add `.as_ptr` & `.as_mut_ptr` to replace `.with_[mut_]ref`.
Huon Wilson [Sat, 14 Jun 2014 12:46:50 +0000 (22:46 +1000)]
c_str: add `.as_ptr` & `.as_mut_ptr` to replace `.with_[mut_]ref`.

These forms return the pointer directly, rather than the added
indirection, indentation, and inefficiencies of the closures in
`.with_ref` and `.with_mut_ref`. The two closure functions are
deprecated.

Replace

    foo(c_str.with_ref(|p| p))

    c_str.with_ref(|p| {
        foo(p);
        bar(p);
    })

with

    foo(c_str.as_ptr())

    let p = c_str.as_ptr();
    foo(p);
    bar(p);

This change does mean that one has to be careful to avoid writing `let p
= x.to_c_str().as_ptr();` since the `CString` will be freed at the end
of the statement. Previously, `with_ref` was used (and `as_ptr` avoided)
for this reason, but Rust has strongly moved away from closures to more
RAII-style code, and most uses of `.with_ref` where in the form
`.with_ref(|p| p)` anyway, that is, they were exactly `.as_ptr`.

[breaking-change]

10 years agorand: Small fix in parameter name
Piotr Jawniak [Sun, 29 Jun 2014 07:32:19 +0000 (09:32 +0200)]
rand: Small fix in parameter name

Documentation didn't match with parameter name.
Changes name of parameter in docs and function to 'amount'.

10 years agoImpl Rand for tuples of arity 11 and 12
Adolfo Ochagavía [Sun, 29 Jun 2014 09:44:25 +0000 (11:44 +0200)]
Impl Rand for tuples of arity 11 and 12

10 years agoauto merge of #15241 : arjantop/rust/maybeownedvector-improvements, r=alexcrichton
bors [Sun, 29 Jun 2014 00:31:30 +0000 (00:31 +0000)]
auto merge of #15241 : arjantop/rust/maybeownedvector-improvements, r=alexcrichton

10 years agoauto merge of #15210 : luqmana/rust/windoc, r=alexcrichton
bors [Sat, 28 Jun 2014 22:06:35 +0000 (22:06 +0000)]
auto merge of #15210 : luqmana/rust/windoc, r=alexcrichton

Getting rust to build on windows can be a bit annoying in setting up all the toolchains and whatnot. The whole process is made much easier by using msys2 so let's document that prominently right on the README.

10 years agoauto merge of #15208 : alexcrichton/rust/snapshots, r=pcwalton
bors [Sat, 28 Jun 2014 20:11:34 +0000 (20:11 +0000)]
auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwalton

This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.

10 years agoRename all raw pointers as necessary
Alex Crichton [Wed, 25 Jun 2014 19:47:34 +0000 (12:47 -0700)]
Rename all raw pointers as necessary

10 years agoImplementation of common traits for MaybeOwnedVector
Arjan Topolovec [Sat, 28 Jun 2014 18:20:49 +0000 (20:20 +0200)]
Implementation of common traits for MaybeOwnedVector

10 years agoauto merge of #15191 : pcwalton/rust/variance-in-trait-matching, r=huonw
bors [Sat, 28 Jun 2014 18:21:34 +0000 (18:21 +0000)]
auto merge of #15191 : pcwalton/rust/variance-in-trait-matching, r=huonw

I believe that #5781 got fixed by the DST work. It duplicated the
variance inference work in #12828. Therefore, all that is left in #5781
is adding a test.

Closes #5781.

r? @huonw

10 years agolibrustc: Match trait self types exactly.
Patrick Walton [Thu, 26 Jun 2014 01:18:13 +0000 (18:18 -0700)]
librustc: Match trait self types exactly.

This can break code that looked like:

    impl Foo for Box<Any> {
        fn f(&self) { ... }
    }

    let x: Box<Any + Send> = ...;
    x.f();

Change such code to:

    impl Foo for Box<Any> {
        fn f(&self) { ... }
    }

    let x: Box<Any> = ...;
    x.f();

That is, upcast before calling methods.

This is a conservative solution to #5781. A more proper treatment (see
the xfail'd `trait-contravariant-self.rs`) would take variance into
account. This change fixes the soundness hole.

Some library changes had to be made to make this work. In particular,
`Box<Any>` is no longer showable, and only `Box<Any+Send>` is showable.
Eventually, this restriction can be lifted; for now, it does not prove
too onerous, because `Any` is only used for propagating the result of
task failure.

This patch also adds a test for the variance inference work in #12828,
which accidentally landed as part of DST.

Closes #5781.

[breaking-change]

10 years agoauto merge of #15214 : tbu-/rust/pr_doc_vecinsert, r=huonw
bors [Sat, 28 Jun 2014 14:31:37 +0000 (14:31 +0000)]
auto merge of #15214 : tbu-/rust/pr_doc_vecinsert, r=huonw

10 years agoAdd remark and an example about the bounds of `Vec::insert`
Tobias Bucher [Fri, 27 Jun 2014 08:51:56 +0000 (10:51 +0200)]
Add remark and an example about the bounds of `Vec::insert`

10 years agoauto merge of #15235 : Sawyer47/rust/issue-12552, r=huonw
bors [Sat, 28 Jun 2014 09:16:35 +0000 (09:16 +0000)]
auto merge of #15235 : Sawyer47/rust/issue-12552, r=huonw

Closes #12552

10 years agoAdd test for issue #12552
Piotr Jawniak [Sat, 28 Jun 2014 07:29:24 +0000 (09:29 +0200)]
Add test for issue #12552

Closes #12552

10 years agoauto merge of #15233 : jbclements/rust/match-var-hygiene-etc, r=cmr
bors [Sat, 28 Jun 2014 05:21:34 +0000 (05:21 +0000)]
auto merge of #15233 : jbclements/rust/match-var-hygiene-etc, r=cmr

This PR includes two big things and a bunch of little ones.

1) It enables hygiene for variables bound by 'match' expressions.
2) It fixes a bug discovered indirectly (#15221), wherein fold traversal failed to visit nonterminal nodes.
3) It fixes a small bug in the macro tutorial.

It also adds tests for the first two, and makes a bunch of small comment improvements and cleanup.

10 years agocomments only
John Clements [Fri, 27 Jun 2014 23:11:18 +0000 (16:11 -0700)]
comments only

10 years agoadjust fold to fold over interpolated items/exprs/etc.
John Clements [Fri, 27 Jun 2014 23:10:23 +0000 (16:10 -0700)]
adjust fold to fold over interpolated items/exprs/etc.

Closes #15221

10 years agolooks like a cut-n-paste error in unused code
John Clements [Fri, 27 Jun 2014 23:07:25 +0000 (16:07 -0700)]
looks like a cut-n-paste error in unused code

10 years agosimplified test case
John Clements [Fri, 27 Jun 2014 21:41:32 +0000 (14:41 -0700)]
simplified test case

10 years agoremoved incomplete comment
John Clements [Fri, 27 Jun 2014 21:12:13 +0000 (14:12 -0700)]
removed incomplete comment

as written, I don't believe this comment was helpful; I think it's
better just to steer the reader toward a general understanding of
hygiene.

10 years agoadded unit and standalone test for 15221, extra debugging output
John Clements [Fri, 27 Jun 2014 20:10:47 +0000 (13:10 -0700)]
added unit and standalone test for 15221, extra debugging output

10 years agoundo helpful attempt to spell-check
John Clements [Fri, 27 Jun 2014 19:57:48 +0000 (12:57 -0700)]
undo helpful attempt to spell-check

Yes, that word is spelled \'memoization\'

10 years agomake tests hygienic...
John Clements [Fri, 27 Jun 2014 00:41:43 +0000 (17:41 -0700)]
make tests hygienic...

... and possibly totally pointless. Specifically, fixing
these to make their macros hygienic may mean that they no
longer test the thing that they were supposed to test.

10 years agoremove trailing whitespace
John Clements [Thu, 26 Jun 2014 23:53:33 +0000 (16:53 -0700)]
remove trailing whitespace

10 years agohygiene for match-bound vars now implemented
John Clements [Thu, 26 Jun 2014 23:49:13 +0000 (16:49 -0700)]
hygiene for match-bound vars now implemented

Closes #9384

10 years agoimprove match test case to include guard
John Clements [Thu, 26 Jun 2014 22:37:45 +0000 (15:37 -0700)]
improve match test case to include guard

10 years agoremove unnecessary abstraction
John Clements [Thu, 26 Jun 2014 22:37:18 +0000 (15:37 -0700)]
remove unnecessary abstraction

10 years agocleanup and shiny new more-functional interface
John Clements [Thu, 26 Jun 2014 21:39:54 +0000 (14:39 -0700)]
cleanup and shiny new more-functional interface

10 years agoWIP match hygiene, compiles
John Clements [Thu, 26 Jun 2014 20:19:34 +0000 (13:19 -0700)]
WIP match hygiene, compiles

10 years agoget rid of needless wrapper function
John Clements [Thu, 26 Jun 2014 20:18:52 +0000 (13:18 -0700)]
get rid of needless wrapper function

10 years agoreplaced ignore-pretty with no-pretty-expanded
John Clements [Thu, 26 Jun 2014 02:41:16 +0000 (19:41 -0700)]
replaced ignore-pretty with no-pretty-expanded

Per @acrichto's suggestion, use the more narrowly focused exclusion.

10 years agomake fold_attribute part of Folder trait
John Clements [Thu, 26 Jun 2014 01:15:07 +0000 (18:15 -0700)]
make fold_attribute part of Folder trait

10 years agoworking on hygiene
John Clements [Wed, 25 Jun 2014 22:20:01 +0000 (15:20 -0700)]
working on hygiene

10 years agoauto merge of #15226 : luqmana/rust/abol, r=pcwalton
bors [Fri, 27 Jun 2014 21:11:31 +0000 (21:11 +0000)]
auto merge of #15226 : luqmana/rust/abol, r=pcwalton

This was causing a ton of leaks in macro expansion.

10 years agolibrustc: Schedule cleanups properly when coercing to a &Trait.
Luqman Aden [Fri, 27 Jun 2014 20:54:18 +0000 (16:54 -0400)]
librustc: Schedule cleanups properly when coercing to a &Trait.

10 years agoauto merge of #15212 : huonw/rust/struct-paren-lint, r=alexcrichton
bors [Fri, 27 Jun 2014 17:56:26 +0000 (17:56 +0000)]
auto merge of #15212 : huonw/rust/struct-paren-lint, r=alexcrichton

rustc: update the unnecessary parens lint for struct literals.

Things like `match X { x: 1 } { ... }` now need to be written with
parentheses, so the lint should avoid warning in cases like that.

10 years agoauto merge of #15213 : Sawyer47/rust/issue-11677, r=huonw
bors [Fri, 27 Jun 2014 13:11:24 +0000 (13:11 +0000)]
auto merge of #15213 : Sawyer47/rust/issue-11677, r=huonw

This code used to cause an ICE

Closes #11677

10 years agoauto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw
bors [Fri, 27 Jun 2014 11:26:25 +0000 (11:26 +0000)]
auto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw

This diff will look better once bors takes care of https://github.com/rust-lang/rust/pull/15183

@brson and I talked about it, and, if I commit this skeleton, I can submit PRs for each portion, without doing this silly "builds on previous PRs" stuff, and it shouldn't cause conflicts.

This lays out what I think the guide should cover, and in what order.  I haven't picked a cohesive project yet that shows all this off, but I think this progression of concepts is appropriate.

10 years agoauto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-referen...
bors [Fri, 27 Jun 2014 09:41:27 +0000 (09:41 +0000)]
auto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-reference-to-a-new-concept-2, r=huonw

This is the same patch as submitted to https://github.com/rust-lang/rust/issues/13570 and https://github.com/rust-lang/rust/pull/14124, but with @pnkfelix's comment (https://github.com/rust-lang/rust/pull/14124#issuecomment-42797536) addressed, and with reflow as a separate commit. I'm submitting it in case @steveklabnik hasn't yet merged a rewrite of the tutorial (https://github.com/rust-lang/rust/issues/13570#issuecomment-46864789), in which case this patch might as well be merged into the old tutorial.

10 years agoAdd test for #11677
Piotr Jawniak [Fri, 27 Jun 2014 09:30:51 +0000 (11:30 +0200)]
Add test for #11677

This code used to cause an ICE

Closes #11677

10 years agoSkeleton outline of the guide.
Steve Klabnik [Fri, 27 Jun 2014 00:46:12 +0000 (20:46 -0400)]
Skeleton outline of the guide.

10 years agorustc: update the unnecessary parens lint for struct literals.
Huon Wilson [Tue, 24 Jun 2014 23:00:46 +0000 (09:00 +1000)]
rustc: update the unnecessary parens lint for struct literals.

Things like `match X { x: 1 } { ... }` now need to be written with
parentheses, so the lint should avoid warning in cases like that.

10 years agoauto merge of #15183 : steveklabnik/rust/hello_cargo, r=huonw
bors [Fri, 27 Jun 2014 02:41:24 +0000 (02:41 +0000)]
auto merge of #15183 : steveklabnik/rust/hello_cargo, r=huonw

Built on top of https://github.com/rust-lang/rust/pull/15181. https://github.com/steveklabnik/rust/commit/e52719291183d7b4f691a1997c69fd75b8101b07 is the only new commit, you may want to review that separately.

I'm not sure if the car analogy is too glib.

10 years agoAdd one more ignore.
Steve Klabnik [Fri, 27 Jun 2014 01:57:46 +0000 (21:57 -0400)]
Add one more ignore.

Thanks @huonw

10 years agoFix windows run instructions
Steve Klabnik [Fri, 27 Jun 2014 00:49:27 +0000 (20:49 -0400)]
Fix windows run instructions

Thank you, @stormbrew!

10 years agoauto merge of #15206 : omasanori/rust/use-reexported, r=alexcrichton
bors [Fri, 27 Jun 2014 00:21:24 +0000 (00:21 +0000)]
auto merge of #15206 : omasanori/rust/use-reexported, r=alexcrichton

We use re-exported pathes (e.g. std::io::Command) and original ones
(e.g. std::io::process::Command) together in examples now. Using
re-exported ones consistently avoids confusion.

10 years agoREADME: Add instructions for building on windows.
Luqman Aden [Fri, 27 Jun 2014 00:07:44 +0000 (20:07 -0400)]
README: Add instructions for building on windows.

10 years agoauto merge of #15190 : pcwalton/rust/proc-upvars, r=alexcrichton
bors [Thu, 26 Jun 2014 22:21:23 +0000 (22:21 +0000)]
auto merge of #15190 : pcwalton/rust/proc-upvars, r=alexcrichton

Since procs do not have lifetime bounds, we must do this to maintain
safety.

This can break code that incorrectly captured references in procedure
types. Change such code to not do this, perhaps with a trait object
instead.

Closes #14036.

[breaking-change]

r? @alexcrichton

10 years agolibrustc: Ensure that proc upvars have static lifetime.
Patrick Walton [Thu, 26 Jun 2014 01:10:50 +0000 (18:10 -0700)]
librustc: Ensure that proc upvars have static lifetime.

Since procs do not have lifetime bounds, we must do this to maintain
safety.

This can break code that incorrectly captured references in procedure
types. Change such code to not do this, perhaps with a trait object
instead.

A better solution would be to add higher-rank lifetime support to procs.
However, this would be a lot of work for a feature we want to remove in
favor of unboxed closures. The corresponding "real fix" is #15067.

Closes #14036.

[breaking-change]

10 years agostd::io: Use re-exported pathes in examples.
OGINO Masanori [Thu, 26 Jun 2014 20:22:26 +0000 (05:22 +0900)]
std::io: Use re-exported pathes in examples.

We use re-exported pathes (e.g. std::io::Command) and original ones
(e.g. std::io::process::Command) together in examples now. Using
re-exported ones consistently avoids confusion.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoC macros, not C++ templates.
Steve Klabnik [Thu, 26 Jun 2014 20:58:20 +0000 (16:58 -0400)]
C macros, not C++ templates.

@cmr rightfully points out that C macros are worse, and share the
same name.

10 years agoFix missing word and some grammar
Steve Klabnik [Thu, 26 Jun 2014 19:46:36 +0000 (15:46 -0400)]
Fix missing word and some grammar

Thanks @chris-morgan and @P1start! :heart:

10 years agoauto merge of #14886 : alexcrichton/rust/rt-improvements, r=brson
bors [Thu, 26 Jun 2014 19:46:25 +0000 (19:46 +0000)]
auto merge of #14886 : alexcrichton/rust/rt-improvements, r=brson

Most of the comments are available on the Task structure itself, but this commit
is aimed at making FFI-style usage of Rust tasks a little nicer.

Primarily, this commit enables re-use of tasks across multiple invocations. The
method `run` will no longer unconditionally destroy the task itself. Rather, the
task will be internally re-usable if the closure specified did not fail. Once a
task has failed once it is considered poisoned and it can never be used again.

Along the way I tried to document shortcomings of the current method of tearing
down a task, opening a few issues as well. For now none of the behavior is a
showstopper, but it's useful to acknowledge it. Also along the way I attempted
to remove as much `unsafe` code as possible, opting for safer abstractions.

10 years agoNote that macros != templates
Steve Klabnik [Thu, 26 Jun 2014 19:44:29 +0000 (15:44 -0400)]
Note that macros != templates

Good call, @chris-morgan and @cmr!

10 years agoClarify which curly is being referred to
Steve Klabnik [Thu, 26 Jun 2014 19:41:46 +0000 (15:41 -0400)]
Clarify which curly is being referred to

Thanks @chris-morgan

10 years agoTIL PATHEXT
Steve Klabnik [Thu, 26 Jun 2014 19:40:52 +0000 (15:40 -0400)]
TIL PATHEXT

Thanks @chris-morgan :heart:

10 years agorustrt: Reorganize task usage
Alex Crichton [Fri, 13 Jun 2014 23:03:41 +0000 (16:03 -0700)]
rustrt: Reorganize task usage

Most of the comments are available on the Task structure itself, but this commit
is aimed at making FFI-style usage of Rust tasks a little nicer.

Primarily, this commit enables re-use of tasks across multiple invocations. The
method `run` will no longer unconditionally destroy the task itself. Rather, the
task will be internally re-usable if the closure specified did not fail. Once a
task has failed once it is considered poisoned and it can never be used again.

Along the way I tried to document shortcomings of the current method of tearing
down a task, opening a few issues as well. For now none of the behavior is a
showstopper, but it's useful to acknowledge it. Also along the way I attempted
to remove as much `unsafe` code as possible, opting for safer abstractions.

10 years agoMove note about $ up
Steve Klabnik [Thu, 26 Jun 2014 19:39:30 +0000 (15:39 -0400)]
Move note about $ up

Thanks @chris-morgan :heart: