]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRegression test for #15034
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #15034

Closes #15034.

9 years agoRegression test for #14227
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #14227

Closes #14227.

9 years agoRegression test for #14386
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #14386

Closes #14386.

9 years agoRegression tests for #13853
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression tests for #13853

Closes #13853, #14889.

9 years agoRegression test for #13808
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #13808

Closes #13808.

9 years agoRegression test for #13665
Tamir Duberstein [Tue, 23 Dec 2014 05:20:31 +0000 (21:20 -0800)]
Regression test for #13665

Closes #13665.

9 years agoRegression test for #13655
Tamir Duberstein [Tue, 23 Dec 2014 05:09:40 +0000 (21:09 -0800)]
Regression test for #13655

Closes #13655.

9 years agoRegression test for simple case of #9197
Tamir Duberstein [Tue, 23 Dec 2014 04:21:43 +0000 (20:21 -0800)]
Regression test for simple case of #9197

9 years agoRegression test for #8874
Tamir Duberstein [Tue, 23 Dec 2014 04:15:43 +0000 (20:15 -0800)]
Regression test for #8874

Closes #8874.

9 years agoUpdate test for #5543
Tamir Duberstein [Tue, 23 Dec 2014 02:45:18 +0000 (18:45 -0800)]
Update test for #5543

Closes #5543.

9 years agoRegression test for #3902
Tamir Duberstein [Mon, 22 Dec 2014 20:38:04 +0000 (12:38 -0800)]
Regression test for #3902

Closes #3902.

9 years agoauto merge of #20136 : eddyb/rust/format-args, r=alexcrichton
bors [Sun, 28 Dec 2014 03:11:48 +0000 (03:11 +0000)]
auto merge of #20136 : eddyb/rust/format-args, r=alexcrichton

We have the technology: no longer do you need to write closures to use `format_args!`.
This is a `[breaking-change]`, as it forces you to clean up old hacks - if you had code like this:
```rust
format_args!(fmt::format, "{} {} {}", a, b, c)
format_args!(|args| { w.write_fmt(args) }, "{} {} {}", x, y, z)
```
change it to this:
```rust
fmt::format(format_args!("{} {} {}", a, b, c))
w.write_fmt(format_args!("{} {} {}", x, y, z))
```
To allow them to be called with `format_args!(...)` directly, several functions were modified to
take `fmt::Arguments` by value instead of by reference. Also, `fmt::Arguments` derives `Copy`
now in order to preserve all usecases that were previously possible.

9 years agoFallout of changing format_args!(f, args) to f(format_args!(args)).
Eduard Burtescu [Sat, 27 Dec 2014 21:57:43 +0000 (23:57 +0200)]
Fallout of changing format_args!(f, args) to f(format_args!(args)).

9 years agosyntax: change format_args! to produce fmt::Arguments instead of calling a function...
Eduard Burtescu [Sun, 21 Dec 2014 09:28:18 +0000 (11:28 +0200)]
syntax: change format_args! to produce fmt::Arguments instead of calling a function with them.

9 years agosyntax: use std::string::String unqualified in format.
Eduard Burtescu [Sat, 20 Dec 2014 21:37:25 +0000 (23:37 +0200)]
syntax: use std::string::String unqualified in format.

9 years agosyntax: turn the match-call generated by format_args inside-out.
Eduard Burtescu [Sat, 20 Dec 2014 19:57:47 +0000 (21:57 +0200)]
syntax: turn the match-call generated by format_args inside-out.

9 years agosyntax: format: put static arrays in their own blocks to avoid needing a wrapper...
Eduard Burtescu [Fri, 19 Dec 2014 14:16:16 +0000 (16:16 +0200)]
syntax: format: put static arrays in their own blocks to avoid needing a wrapper block.

9 years agosyntax: format: remove unused method_statics field.
Eduard Burtescu [Thu, 18 Dec 2014 23:31:02 +0000 (01:31 +0200)]
syntax: format: remove unused method_statics field.

9 years agoauto merge of #19916 : SimonSapin/rust/ascii-reform, r=sfackler
bors [Sat, 27 Dec 2014 21:51:43 +0000 (21:51 +0000)]
auto merge of #19916 : SimonSapin/rust/ascii-reform, r=sfackler

Implements [RFC 486](https://github.com/rust-lang/rfcs/pull/486). Fixes #19908.

* Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401
* Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`.
* As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`.

[breaking-change]

9 years agoauto merge of #20244 : japaric/rust/bc-no-move, r=nikomatsakis
bors [Sat, 27 Dec 2014 15:28:36 +0000 (15:28 +0000)]
auto merge of #20244 : japaric/rust/bc-no-move, r=nikomatsakis

closes #19141
closes #20193
closes #20228

---

Currently whenever we encounter `let f = || {/* */}`, we *always* type check the RHS as a *boxed* closure. This is wrong when the RHS is `move || {/* */}` (because boxed closures can't capture by value) and generates all sort of badness during trans (see issues above). What we *should* do is always type check `move || {/* */}` as an *unboxed* closure, but ~~I *think* (haven't tried)~~ (2) this is not feasible right now because we have a limited form of kind (`Fn` vs `FnMut` vs `FnOnce`) inference that only works when there is an expected type (1).

In this PR, I've chosen to generate a type error whenever `let f = move || {/* */}` is encountered. The error asks the user to annotate the kind of the unboxed closure (e.g. `move |:| {/* */}`). Once annotated, the compiler will type check the RHS as an unboxed closure which is what the user wants.

r? @nikomatsakis

(1) AIUI it only triggers in this scenario:

``` rust
fn is_uc<F>(_: F) where F: FnOnce() {}

fn main() {
    is_uc(|| {});  // type checked as unboxed closure with kind `FnOnce`
}
```

(2) I checked, and it's not possible because `check_unboxed_closure` expects a `kind` argument, but we can't supply that argument in this case (i.e. `let f = || {}`, what's the kind?). We could force the `FnOnce` kind in that case, but that's ad hoc. We should try to infer the kind depending on how the closure is used afterwards, but there is no inference mechanism to do that (at least, not right now).

9 years agoauto merge of #20119 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
bors [Sat, 27 Dec 2014 13:11:48 +0000 (13:11 +0000)]
auto merge of #20119 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis

More work on opt-in built in traits. `Send` and `Sync` are not opt-in, `OwnedPtr` renamed to `UniquePtr` and the `Send` and `Sync` traits are now unsafe.

NOTE: This likely needs to be rebased on top of the yet-to-land snapshot.

r? @nikomatsakis

cc #13231

9 years agoMake trait's impls consistent for unix/windows
Flavio Percoco [Sat, 27 Dec 2014 12:00:20 +0000 (13:00 +0100)]
Make trait's impls consistent for unix/windows

9 years agoImplement Sync/Send for windows' UnixStream
Flavio Percoco [Sat, 27 Dec 2014 10:02:47 +0000 (11:02 +0100)]
Implement Sync/Send for windows' UnixStream

9 years agoauto merge of #20238 : barosl/rust/regex-repeater-panic, r=huonw
bors [Sat, 27 Dec 2014 09:21:48 +0000 (09:21 +0000)]
auto merge of #20238 : barosl/rust/regex-repeater-panic, r=huonw

This bug has also affected the `regex!` macro, which has caused an ICE when such an invalid expression is provided.

Fixes #20208.

9 years agoauto merge of #20158 : nikomatsakis/rust/fn-inference-refactor, r=eddyb
bors [Sat, 27 Dec 2014 06:58:35 +0000 (06:58 +0000)]
auto merge of #20158 : nikomatsakis/rust/fn-inference-refactor, r=eddyb

Various refactorings simplifying the mem-categorization and regionck interface. This is working towards an improvement for closure-and-upvar-mode inference.

r? @eddyb

9 years agoauto merge of #20143 : csouth3/rust/vecmap-reserve, r=Gankro
bors [Sat, 27 Dec 2014 04:41:53 +0000 (04:41 +0000)]
auto merge of #20143 : csouth3/rust/vecmap-reserve, r=Gankro

Implement `reserve_len` and `reserve_len_exact` for `VecMap` in accordance with rust-lang/rfcs#509.

9 years agoauto merge of #19254 : nick29581/rust/dxr-glob, r=pcwalton
bors [Sat, 27 Dec 2014 00:48:41 +0000 (00:48 +0000)]
auto merge of #19254 : nick29581/rust/dxr-glob, r=pcwalton

There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import.

r?

9 years agoRebasing changes
Nick Cameron [Thu, 25 Dec 2014 22:01:16 +0000 (11:01 +1300)]
Rebasing changes

9 years agoImplement Sync/Send for windows TCP types
Flavio Percoco [Fri, 26 Dec 2014 22:01:47 +0000 (23:01 +0100)]
Implement Sync/Send for windows TCP types

9 years agoauto merge of #20133 : apasel422/rust/binary_heap, r=alexcrichton
bors [Fri, 26 Dec 2014 21:51:48 +0000 (21:51 +0000)]
auto merge of #20133 : apasel422/rust/binary_heap, r=alexcrichton

Some more tidying up.

9 years agoFix fallout
Nick Cameron [Fri, 28 Nov 2014 03:02:33 +0000 (16:02 +1300)]
Fix fallout

9 years agosave-analysis: emit names of items that a glob import actually imports.
Nick Cameron [Sun, 23 Nov 2014 09:29:41 +0000 (22:29 +1300)]
save-analysis: emit names of items that a glob import actually imports.

There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import.

[breaking-change]

Import shadowing of single/list imports by globs is now forbidden. An interesting case is where a glob import imports a re-export (`pub use`) of a single import. This still counts as a single import for the purposes of shadowing .You can usually fix any bustage by re-ordering such imports. A single import may still shadow (override) a glob import or the prelude.

9 years agoImplement RaceBox for StdinReader
Flavio Percoco [Wed, 24 Dec 2014 16:40:40 +0000 (17:40 +0100)]
Implement RaceBox for StdinReader

9 years agoAdd a Racy type to bench tests
Flavio Percoco [Wed, 24 Dec 2014 11:59:23 +0000 (12:59 +0100)]
Add a Racy type to bench tests

9 years agoImplement Sync/Send for ArcInner and Weak
Flavio Percoco [Wed, 24 Dec 2014 08:48:11 +0000 (09:48 +0100)]
Implement Sync/Send for ArcInner and Weak

9 years agoImpl Sync/Send for Rawlink
Flavio Percoco [Tue, 23 Dec 2014 20:42:54 +0000 (21:42 +0100)]
Impl Sync/Send for Rawlink

9 years agoMake Barrier and Condvar Sync/Send
Flavio Percoco [Tue, 23 Dec 2014 19:21:14 +0000 (20:21 +0100)]
Make Barrier and Condvar Sync/Send

9 years agoKeep track of the whole error chain
Flavio Percoco [Tue, 23 Dec 2014 09:57:44 +0000 (10:57 +0100)]
Keep track of the whole error chain

9 years agoRelax `Arc` bounds don't require Sync+Send
Flavio Percoco [Mon, 22 Dec 2014 16:15:51 +0000 (17:15 +0100)]
Relax `Arc` bounds don't require Sync+Send

Besides the above making sense, it'll also allow us to make `RacyCell`
private and use UnsafeCell instead.

9 years agoRename `UniquePtr` to `Unique`
Flavio Percoco [Mon, 22 Dec 2014 13:25:58 +0000 (14:25 +0100)]
Rename `UniquePtr` to `Unique`

Mostly following the convention in RFC 356

9 years agoImplement `Sync` for some windows sys types
Flavio Percoco [Mon, 22 Dec 2014 13:13:24 +0000 (14:13 +0100)]
Implement `Sync` for some windows sys types

9 years agoMove RacyCell to `std::comm`
Flavio Percoco [Mon, 22 Dec 2014 11:29:46 +0000 (12:29 +0100)]
Move RacyCell to `std::comm`

RacyCell is not exactly what we'd like as a final implementation for
this. Therefore, we're moving it under `std::comm` and also making it
private.

9 years agoMake Send and Sync traits unsafe
Flavio Percoco [Sun, 21 Dec 2014 23:49:42 +0000 (00:49 +0100)]
Make Send and Sync traits unsafe

9 years agoRename `OwnedPtr` to `UniquePtr`
Flavio Percoco [Sun, 21 Dec 2014 23:01:20 +0000 (00:01 +0100)]
Rename `OwnedPtr` to `UniquePtr`

9 years agoRequire types to opt-in Sync
Flavio Percoco [Sat, 6 Dec 2014 16:39:25 +0000 (11:39 -0500)]
Require types to opt-in Sync

9 years agotypeck: boxed closures can't capture by value
Jorge Aparicio [Fri, 26 Dec 2014 14:19:37 +0000 (09:19 -0500)]
typeck: boxed closures can't capture by value

closes #19141
closes #20193
closes #20228

9 years agoauto merge of #20218 : alexcrichton/rust/jemalloc-sections, r=luqmana
bors [Fri, 26 Dec 2014 06:31:47 +0000 (06:31 +0000)]
auto merge of #20218 : alexcrichton/rust/jemalloc-sections, r=luqmana

It's quite possible that small programs don't use all of jemalloc, and building
with -ffunction-sections and -fdata-sections allows the linker (via
--gc-sections) to strip out all unused code at link time. This decreases the
size of a "hello world" executable for me from 716K to 482K with no measurable
impact on link time. After this patch jemalloc is still the largest portion of
our hello world executables, but this helps cut down on the size at least
somewhat!

9 years agoPrevent Regex::new() from panicking when a non-AST item is repeated
Barosl Lee [Fri, 26 Dec 2014 04:46:39 +0000 (13:46 +0900)]
Prevent Regex::new() from panicking when a non-AST item is repeated

This bug has also affected the regex! macro, which has caused an ICE
when such an invalid expression is provided.

Fixes #20208.

9 years agoauto merge of #20183 : japaric/rust/doctests, r=alexcrichton
bors [Fri, 26 Dec 2014 03:01:42 +0000 (03:01 +0000)]
auto merge of #20183 : japaric/rust/doctests, r=alexcrichton

#20075 introduced a bug where unmarked code fences weren't considered as doctests. This PR fixes the logic.

---

This passed `check-stage1-rustdoc`, and I manually checked that:

``` rust
//! ```
//! println!("Hello")
//! ```
//!
//! ``` rust
//! println!("Hello")
//! ```
//!
//! ``` sh
//! println!("Hello")
//! ```
//!
//! ``` ignore
//! println!("Hello")
//! ```
```

Generated:

``` rust
running 3 tests
test _2 ... ignored
test _0 ... ok
test _1 ... ok
```

I'd love to add that as a test, but I have no idea how to do that with our testing infrastructure. If anyone knows how, do let me know!

r? @alexcrichton
@seanmonstar feedback?

9 years agoFix up remaining usage of `to_ascii`.
Simon Sapin [Fri, 26 Dec 2014 00:17:30 +0000 (01:17 +0100)]
Fix up remaining usage of `to_ascii`.

9 years agoauto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichton
bors [Thu, 25 Dec 2014 18:01:36 +0000 (18:01 +0000)]
auto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichton

Add support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.

9 years agoFix up remaining usage of `to_ascii`.
Simon Sapin [Thu, 25 Dec 2014 14:26:16 +0000 (15:26 +0100)]
Fix up remaining usage of `to_ascii`.

9 years agoauto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton
bors [Thu, 25 Dec 2014 14:21:47 +0000 (14:21 +0000)]
auto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton

... really this time `:)`

I went for the simpler fix after all since it turned out to become a bit too complicated to extract the current iteration value from its containing `Option` with the different memory layouts it can have. It's also what we already do for match bindings.

I also extended the new test case to include the "simple identifier" case.

Fixes #20127, fixes #19732

9 years agoMove mem-categorization more things to use TYPER for the method origin
Niko Matsakis [Tue, 9 Dec 2014 18:20:25 +0000 (13:20 -0500)]
Move mem-categorization more things to use TYPER for the method origin

9 years agoRemove `McResult` from the mem-categorization interface.
Niko Matsakis [Wed, 3 Dec 2014 18:30:02 +0000 (13:30 -0500)]
Remove `McResult` from the mem-categorization interface.

9 years agoExtend Typer interface to include `expr_ty_adjusted` so that we can
Niko Matsakis [Wed, 3 Dec 2014 18:06:48 +0000 (13:06 -0500)]
Extend Typer interface to include `expr_ty_adjusted` so that we can
remove another direct dependency on tcx from euv.

9 years agoRemove the regionck impl of Typer and just use fcx. This requires
Niko Matsakis [Wed, 3 Dec 2014 18:06:21 +0000 (13:06 -0500)]
Remove the regionck impl of Typer and just use fcx. This requires
modifying fcx to remove type variables where possible, but that's it.

9 years agoUse the typer in ExprUseVisitor and do not hard code to tcx
Niko Matsakis [Wed, 3 Dec 2014 18:04:49 +0000 (13:04 -0500)]
Use the typer in ExprUseVisitor and do not hard code to tcx

9 years agostd::ascii: Use u8 methods rather than the maps directly.
Simon Sapin [Sun, 7 Dec 2014 02:00:08 +0000 (02:00 +0000)]
std::ascii: Use u8 methods rather than the maps directly.

9 years agoRemove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.
Simon Sapin [Sun, 7 Dec 2014 01:55:34 +0000 (01:55 +0000)]
Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.

As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char.

[breaking-change]

9 years agoauto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton
bors [Thu, 25 Dec 2014 05:11:36 +0000 (05:11 +0000)]
auto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton

9 years agomk: Build jemalloc with -ffunction-sections
Alex Crichton [Thu, 25 Dec 2014 04:20:01 +0000 (20:20 -0800)]
mk: Build jemalloc with -ffunction-sections

It's quite possible that small programs don't use all of jemalloc, and building
with -ffunction-sections and -fdata-sections allows the linker (via
--gc-sections) to strip out all unused code at link time. This decreases the
size of a "hello world" executable for me from 716K to 482K with no measurable
impact on link time. After this patch jemalloc is still the largest portion of
our hello world executables, but this helps cut down on the size at least
somewhat!

9 years agoauto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton
bors [Thu, 25 Dec 2014 01:01:42 +0000 (01:01 +0000)]
auto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton

We render HRTB and the unboxed closure trait sugar (the so-called
"parenthesized" notation) where appropriate. Also address the new
`for` syntax on the old closures.

9 years agoauto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton
bors [Wed, 24 Dec 2014 20:47:12 +0000 (20:47 +0000)]
auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton

According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]

9 years agoauto merge of #19813 : barosl/rust/autoderef-type-inference-ice, r=pnkfelix
bors [Wed, 24 Dec 2014 18:37:07 +0000 (18:37 +0000)]
auto merge of #19813 : barosl/rust/autoderef-type-inference-ice, r=pnkfelix

`check::autoderef()` returns a `ty_err` when it fails to infer the type. `probe::probe()` should respect this failure and fail together to prevent further corruption.

Fixes #19692.
Fixes #19583.
Fixes #19297.

9 years agoRename to_ascii_{lower,upper} to to_ascii_{lower,upper}case, per #14401
Simon Sapin [Fri, 5 Dec 2014 17:57:42 +0000 (09:57 -0800)]
Rename to_ascii_{lower,upper} to to_ascii_{lower,upper}case, per #14401

[breaking-change]

9 years agorustdoc: Use Fn trait sugar for external paths
Tom Jakubowski [Wed, 17 Dec 2014 10:39:10 +0000 (02:39 -0800)]
rustdoc: Use Fn trait sugar for external paths

Fix #19909

9 years agorustdoc: Use unboxed closure sugar
Tom Jakubowski [Tue, 16 Dec 2014 20:40:43 +0000 (12:40 -0800)]
rustdoc: Use unboxed closure sugar

This unfortunately leaves sugaring Fn/FnMut/FnOnce on cross-crate
re-exports for future work.

cc #19909

9 years agorustdoc: render higher-rank trait bounds
Tom Jakubowski [Tue, 16 Dec 2014 16:50:52 +0000 (08:50 -0800)]
rustdoc: render higher-rank trait bounds

Fix #19915

9 years agorustdoc: render `for<>` on old closure lifetimes
Tom Jakubowski [Tue, 16 Dec 2014 14:32:52 +0000 (06:32 -0800)]
rustdoc: render `for<>` on old closure lifetimes

9 years agoauto merge of #20060 : Aatch/rust/enum-repr, r=alexcrichton
bors [Wed, 24 Dec 2014 16:21:23 +0000 (16:21 +0000)]
auto merge of #20060 : Aatch/rust/enum-repr, r=alexcrichton

The previous behaviour of using the smallest type possible caused LLVM
to treat padding too conservatively, causing poor codegen. This commit
changes the behaviour to use an alignment-sized integer as the
discriminant. This keeps types the same size, but helps LLVM understand
the data structure a little better, resulting in better codegen.

9 years agoclean up `BinaryHeap` code
Andrew Paseltiner [Mon, 22 Dec 2014 12:13:09 +0000 (07:13 -0500)]
clean up `BinaryHeap` code

9 years agoAddress code review nits
Jared Roesch [Wed, 24 Dec 2014 08:58:21 +0000 (00:58 -0800)]
Address code review nits

9 years agoauto merge of #19858 : nick29581/rust/ranges, r=aturon
bors [Wed, 24 Dec 2014 06:31:13 +0000 (06:31 +0000)]
auto merge of #19858 : nick29581/rust/ranges, r=aturon

Closes #19794

r? @aturon for the first patch
r? @nikomatsakis for the rest

9 years agorustdoc: unmarked code fences are doctests too
Jorge Aparicio [Wed, 24 Dec 2014 02:47:32 +0000 (21:47 -0500)]
rustdoc: unmarked code fences are doctests too

9 years agoauto merge of #19758 : tbu-/rust/pr_fp_name, r=alexcrichton
bors [Tue, 23 Dec 2014 22:21:10 +0000 (22:21 +0000)]
auto merge of #19758 : tbu-/rust/pr_fp_name, r=alexcrichton

This is a [breaking-change].

9 years agoSupport all variants of WherePredicate
Jared Roesch [Tue, 23 Dec 2014 09:08:00 +0000 (01:08 -0800)]
Support all variants of WherePredicate

Adds support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.

9 years agoReview changes
Nick Cameron [Tue, 16 Dec 2014 03:25:33 +0000 (16:25 +1300)]
Review changes

9 years agoTests
Nick Cameron [Mon, 15 Dec 2014 01:23:00 +0000 (14:23 +1300)]
Tests

9 years agoType checking and trans for ranges
Nick Cameron [Mon, 15 Dec 2014 00:17:11 +0000 (13:17 +1300)]
Type checking and trans for ranges

9 years agoAdd syntax for ranges
Nick Cameron [Sat, 13 Dec 2014 05:41:02 +0000 (18:41 +1300)]
Add syntax for ranges

9 years agoAdd lang items for ranges.
Nick Cameron [Sat, 13 Dec 2014 04:19:54 +0000 (17:19 +1300)]
Add lang items for ranges.

9 years agoAdd structs for ranges to core::ops.
Nick Cameron [Sat, 13 Dec 2014 03:58:48 +0000 (16:58 +1300)]
Add structs for ranges to core::ops.

9 years agoauto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis
bors [Tue, 23 Dec 2014 18:01:22 +0000 (18:01 +0000)]
auto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis

This fixes a few corner cases with expected type propagation, e.g.:
```rust
fn take_int_slice(_: &[int]) {}
take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
```
```rust
<anon>:2:28: 2:36 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                    ^~~~~~~~
<anon>:2:46: 2:54 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                                      ^~~~~~~~
```
Right now we unpack the expected `&[int]` and pass down `[int]`, forcing
rvalue expressions to take unsized types, which causes mismatch errors.
Instead, I replaced that expectation with a weaker hint, for the unsized
cases - a hint is still required to infer the integer literals' types, above.

Fixes #20169.

9 years agoRename and namespace `FPCategory`
Tobias Bucher [Mon, 22 Dec 2014 21:50:57 +0000 (22:50 +0100)]
Rename and namespace `FPCategory`

Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the
naming convention

This is a [breaking-change].

Existing code like this:
```
use std::num::{FPCategory, FPNaN};
```
should be adjusted to this:
```
use std::num::FpCategory as Fp
```

In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.

9 years agorustc_typeck: don't expect rvalues to have unsized types.
Eduard Burtescu [Tue, 23 Dec 2014 11:30:36 +0000 (13:30 +0200)]
rustc_typeck: don't expect rvalues to have unsized types.

9 years agodebuginfo: Add test case for destructured for-loop variable.
Michael Woerister [Fri, 19 Dec 2014 11:46:04 +0000 (12:46 +0100)]
debuginfo: Add test case for destructured for-loop variable.

9 years agodebuginfo: Clean the debuginfo module up a bit.
Michael Woerister [Fri, 19 Dec 2014 10:37:49 +0000 (11:37 +0100)]
debuginfo: Clean the debuginfo module up a bit.

9 years agodebuginfo: Create debuginfo for for-loop variables again.
Michael Woerister [Fri, 19 Dec 2014 08:48:28 +0000 (09:48 +0100)]
debuginfo: Create debuginfo for for-loop variables again.

9 years agoMerge pull request #20155 from tbu-/pr_vecmap_fiximpls
bors [Tue, 23 Dec 2014 09:31:26 +0000 (09:31 +0000)]
Merge pull request #20155 from tbu-/pr_vecmap_fiximpls

Fix `collections::VecMap`'s `PartialEq` implementation

Reviewed-by: Gankro
9 years agoMerge pull request #20153 from brianloveswords/patch-1
bors [Tue, 23 Dec 2014 09:31:26 +0000 (09:31 +0000)]
Merge pull request #20153 from brianloveswords/patch-1

Update complement-bugreport.md

Reviewed-by: alexcrichton
9 years agoMerge pull request #20001 from huonw/speeling2
bors [Tue, 23 Dec 2014 09:31:25 +0000 (09:31 +0000)]
Merge pull request #20001 from huonw/speeling2

Fix some spelling errors.

Reviewed-by: nick29581
9 years agoMerge pull request #19886 from brson/rustup
bors [Tue, 23 Dec 2014 09:31:25 +0000 (09:31 +0000)]
Merge pull request #19886 from brson/rustup

rustup: Don't do verbose tarball extraction

Reviewed-by: alexcrichton
9 years agoRename include_bin! to include_bytes!
Chris Wong [Sun, 21 Dec 2014 21:57:09 +0000 (10:57 +1300)]
Rename include_bin! to include_bytes!

According to [RFC 344][], methods that return `&[u8]` should have names
ending in `bytes`. Though `include_bin!` is a macro not a method, it
seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning
when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]

9 years agoMake alignment-forcing case work the same on 64 and 32-bit platforms
James Miller [Tue, 23 Dec 2014 07:40:11 +0000 (20:40 +1300)]
Make alignment-forcing case work the same on 64 and 32-bit platforms

9 years agoFix some spelling errors.
Huon Wilson [Thu, 18 Dec 2014 23:10:37 +0000 (15:10 -0800)]
Fix some spelling errors.

9 years agoauto merge of #20145 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 23 Dec 2014 02:41:48 +0000 (02:41 +0000)]
auto merge of #20145 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoFix `collections::VecMap`'s `PartialEq` implementation
Tobias Bucher [Tue, 23 Dec 2014 00:49:33 +0000 (01:49 +0100)]
Fix `collections::VecMap`'s `PartialEq` implementation

Previously it took capacity into account.

Additionally remove the `ne` implementation of `RingBuf` which is the default
one anyway.

9 years agoUpdate complement-bugreport.md
Brian J Brennan [Tue, 23 Dec 2014 00:43:57 +0000 (19:43 -0500)]
Update complement-bugreport.md

`--version=verbose` doesn't exist anymore, `--version --verbose` is the way to do that now.

9 years agoAdd enum size cases to type-sizes test
James Miller [Sat, 20 Dec 2014 10:00:50 +0000 (23:00 +1300)]
Add enum size cases to type-sizes test