]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRegister new snapshots
Alex Crichton [Fri, 29 Aug 2014 21:33:08 +0000 (14:33 -0700)]
Register new snapshots

9 years agoauto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmr
bors [Fri, 29 Aug 2014 15:41:20 +0000 (15:41 +0000)]
auto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmr

Previously, this caused methods of re-exported types to not be inserted into
the search index. This fix may introduce some false positives, but in my
testing they appear as orphaned methods and end up not being inserted into the
final search index at a later stage.

Fixes issue #11943

9 years agoauto merge of #16838 : nick29581/rust/dst-bug-4, r=pnkfelix,nikomatsakis
bors [Fri, 29 Aug 2014 13:56:29 +0000 (13:56 +0000)]
auto merge of #16838 : nick29581/rust/dst-bug-4, r=pnkfelix,nikomatsakis

Don't double free embedded, unsized slices.

Merge/rebase error from DST. Thanks to @eddyb for finding.

Closes #16826 (I hope)

r?

9 years agoauto merge of #16762 : huonw/rust/for-error-nice, r=alexcrichton
bors [Fri, 29 Aug 2014 08:21:26 +0000 (08:21 +0000)]
auto merge of #16762 : huonw/rust/for-error-nice, r=alexcrichton

- print the type of `x` in `for ... in x` in the "does not implement Iterator" message
- avoid printing that message if `x` has a type error

9 years agoDon't double free embedded, unsized slices
Nick Cameron [Fri, 29 Aug 2014 06:37:45 +0000 (18:37 +1200)]
Don't double free embedded, unsized slices

Thanks to @eddyb for finding the bug.

Closes #16826 (I hope)

9 years agoAvoid flow-on Iterator error for `for ... in [ty err] {}`.
Huon Wilson [Tue, 26 Aug 2014 12:45:00 +0000 (22:45 +1000)]
Avoid flow-on Iterator error for `for ... in [ty err] {}`.

This squashes the

> `for` loop expression has type `[type error]` which does not implement
> the `Iterator` trait

message that one received when writing `for ... in x` where was
previously found to have a type error.

Fixes #16042.

9 years agoMention type of `for` exprs that don't implement Iterator.
Huon Wilson [Tue, 26 Aug 2014 12:09:38 +0000 (22:09 +1000)]
Mention type of `for` exprs that don't implement Iterator.

This improves the error message by telling the user the exact type of
`x` if it doesn't implement `Iterator` in `for ... in x {}`.

Closes #16043.

9 years agoauto merge of #16770 : cburgdorf/rust/patch_overloaded_calls_hint, r=alexcrichton
bors [Fri, 29 Aug 2014 04:56:18 +0000 (04:56 +0000)]
auto merge of #16770 : cburgdorf/rust/patch_overloaded_calls_hint, r=alexcrichton

9 years agoauto merge of #16768 : nham/rust/libcollections_test_cleanup, r=alexcrichton
bors [Fri, 29 Aug 2014 02:26:28 +0000 (02:26 +0000)]
auto merge of #16768 : nham/rust/libcollections_test_cleanup, r=alexcrichton

unused imports.

This is mostly converting uses of `push_back`, `pop_back`, `shift` and `unshift` to `push`, `pop`, `remove` and `insert`.

9 years agoauto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichton
bors [Thu, 28 Aug 2014 23:56:20 +0000 (23:56 +0000)]
auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichton

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

# Changes to `core::option`

Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues.

However, a few methods have been deprecated, either due to lack of use or redundancy:

* `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap)
* `filtered` and `while`
* `mutate` and `mutate_or_set`
* `collect`: this functionality is being moved to a new `FromIterator` impl.

# Changes to `core::result`

Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues.

* `collect`: this functionality is being moved to a new `FromIterator` impl.
* `fold_` is deprecated due to lack of use
* Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants.

Due to deprecations, this is a:

[breaking-change]

9 years agoauto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson
bors [Thu, 28 Aug 2014 22:11:18 +0000 (22:11 +0000)]
auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson

This changes the internal representation of `Duration` from

    days: i32,
    secs: i32,
    nanos: u32

to

    secs: i64,
    nanos: i32

This resolves #16466. Note that `nanos` is an `i32` and not `u32` as suggested, because `i32` is easier to deal with, and it is not exposed anyway. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds.

A few remarks:
- Negating `MIN` is impossible. I chose to return `MAX` as `-MIN`, but it is one nanosecond less than the actual negation. Is this the desired behaviour?
- In `std::io::timer`, some functions accept a `Duration`, which is internally converted into a number of milliseconds. However, the range of `Duration` is now larger than 2^64 milliseconds. There is already a FIXME in the file that this should be addressed (without a ticket number though). I chose to silently use 0 ms if the duration is too long. Is that right, as long as the backend still uses milliseconds?
- Negative durations are not formatted correctly, but they were not formatted correctly before either.

9 years agolibstd: Wrap duration.rs at 100 characters.
Ruud van Asseldonk [Thu, 28 Aug 2014 19:56:27 +0000 (21:56 +0200)]
libstd: Wrap duration.rs at 100 characters.

9 years agoauto merge of #16553 : nick29581/rust/log, r=huon
bors [Thu, 28 Aug 2014 18:36:29 +0000 (18:36 +0000)]
auto merge of #16553 : nick29581/rust/log, r=huon

When specifying RUST_LOG, the programmer may append `/regex` to the end of the spec. All results will then be filtered using that regex.

r?

9 years agostabilize core::result
Aaron Turon [Tue, 19 Aug 2014 20:45:28 +0000 (13:45 -0700)]
stabilize core::result

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

Most of the module is marked as stable or unstable; most of the unstable
items are awaiting resolution of conventions issues.

* `collect`: this functionality is being moved to a new `FromIterator`
  impl.
* `fold_` is deprecated due to lack of use
* Several methods found in `core::option` are added here, including
  `iter`, `as_slice`, and variants.

Due to deprecations, this is a:

[breaking-change]

9 years agoFallout from stabilizing core::option
Aaron Turon [Tue, 19 Aug 2014 00:52:38 +0000 (17:52 -0700)]
Fallout from stabilizing core::option

9 years agostabilize core::option
Aaron Turon [Tue, 19 Aug 2014 00:42:11 +0000 (17:42 -0700)]
stabilize core::option

Per API meeting

  https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md

Most of the module is marked as stable or unstable; most of the unstable
items are awaiting resolution of conventions issues.

However, a few methods have been deprecated, either due to lack of use
or redundancy:

* `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer
  for this functionality to go through an explicit .unwrap)
* `filtered` and `while`
* `mutate` and `mutate_or_set`
* `collect`: this functionality is being moved to a new `FromIterator`
  impl.

Due to deprecations, this is a:

[breaking-change]

9 years agoauto merge of #16453 : nikomatsakis/rust/type-bounds-3, r=pcwalton
bors [Thu, 28 Aug 2014 15:01:39 +0000 (15:01 +0000)]
auto merge of #16453 : nikomatsakis/rust/type-bounds-3, r=pcwalton

Implements https://github.com/rust-lang/rfcs/pull/192.

In particular:

1. type parameters can have lifetime bounds and objects can close over borrowed values, presuming that they have suitable bounds.
2. objects must have a bound, though it may be derived from the trait itself or from a `Send` bound.
3. all types must be well-formed.
4. type parameters and lifetime parameters may themselves have lifetimes as bounds. Something like `T:'a` means "the type T outlives 'a`" and something like `'a:'b`" means "'a outlives 'b". Outlives here means "all borrowed data has a lifetime at least as long".

This is a [breaking-change]. The most common things you have to fix after this change are:

1. Introduce lifetime bounds onto type parameters if your type (directly or indirectly) contains a reference. Thus a struct like `struct Ref<'a, T> { x: &'a T }` would be changed to `struct Ref<'a, T:'a> { x: &'a T }`.
2. Introduce lifetime bounds onto lifetime parameters if your type contains a double reference. Thus a type like `struct RefWrapper<'a, 'b> { r: &'a Ref<'b, int> }` (where `Ref` is defined as before) would need to be changed to `struct RefWrapper<'a, 'b:'a> { ... }`.
2. Explicitly give object lifetimes in structure definitions. Most commonly, this means changing something like `Box<Reader>` to `Box<Reader+'static>`, so as to indicate that this is a reader without any borrowed data. (Note: you may wish to just change to `Box<Reader+Send>` while you're at it; it's a more restrictive type, technically, but means you can send the reader between threads.)

The intuition for points 1 and 2 is that a reference must never outlive its referent (the thing it points at). Therefore, if you have a type `&'a T`, we must know that `T` (whatever it is) outlives `'a`. And so on.

Closes #5723.

9 years agoImplement generalized object and type parameter bounds (Fixes #16462)
Niko Matsakis [Thu, 28 Aug 2014 01:46:52 +0000 (21:46 -0400)]
Implement generalized object and type parameter bounds (Fixes #16462)

9 years agoAllow a regex filter for RUST_LOG
Nick Cameron [Wed, 13 Aug 2014 09:38:52 +0000 (10:38 +0100)]
Allow a regex filter for RUST_LOG

When specifying RUST_LOG, the programmer may append `/regex` to the end of the spec. All results will then be filtered using that regex.

9 years agoauto merge of #16757 : steveklabnik/rust/lets_not_lie_in_the_concurrency_guide, r...
bors [Wed, 27 Aug 2014 21:31:13 +0000 (21:31 +0000)]
auto merge of #16757 : steveklabnik/rust/lets_not_lie_in_the_concurrency_guide, r=alexcrichton

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.

9 years agoFix lies in the concurrency guide.
Steve Klabnik [Tue, 26 Aug 2014 01:15:20 +0000 (21:15 -0400)]
Fix lies in the concurrency guide.

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.

9 years agoauto merge of #16797 : nikomatsakis/rust/remove-invalid-spsc_queue-test, r=alexcrichton
bors [Wed, 27 Aug 2014 19:46:14 +0000 (19:46 +0000)]
auto merge of #16797 : nikomatsakis/rust/remove-invalid-spsc_queue-test, r=alexcrichton

This test seems to read freed memory -- the peeked variable points into the queue, but then the pop operation removes the node from the queue and moves the enclosing `T` elsewhere, invalidating the `peeked` pointer.

r? @alexcrichton

9 years agoRemove invalid test -- this test reads freed memory, from what I can tell
Niko Matsakis [Wed, 27 Aug 2014 18:53:23 +0000 (14:53 -0400)]
Remove invalid test -- this test reads freed memory, from what I can tell

9 years agoauto merge of #16766 : kevinmehall/rust/issue-15976, r=alexcrichton
bors [Wed, 27 Aug 2014 17:11:11 +0000 (17:11 +0000)]
auto merge of #16766 : kevinmehall/rust/issue-15976, r=alexcrichton

As of 8876ce44, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that all `doc` attributes came from sugared comments.

Fixes #15976

9 years agoauto merge of #16761 : mrmonday/rust/patch-1, r=alexcrichton
bors [Wed, 27 Aug 2014 14:01:18 +0000 (14:01 +0000)]
auto merge of #16761 : mrmonday/rust/patch-1, r=alexcrichton

This question comes up relatively frequently on IRC - "what do tx and rx mean?". This change adds a short explanation.

9 years agoauto merge of #16752 : MatejLach/rust/more_cargorun, r=steveklabnik
bors [Wed, 27 Aug 2014 11:16:12 +0000 (11:16 +0000)]
auto merge of #16752 : MatejLach/rust/more_cargorun, r=steveklabnik

Use cargo run as much as possible...

9 years agoauto merge of #16751 : luqmana/rust/tr, r=alexcrichton
bors [Wed, 27 Aug 2014 09:31:14 +0000 (09:31 +0000)]
auto merge of #16751 : luqmana/rust/tr, r=alexcrichton

Fixes #15562.

9 years agoauto merge of #16724 : tshepang/rust/misleading, r=brson
bors [Wed, 27 Aug 2014 07:46:17 +0000 (07:46 +0000)]
auto merge of #16724 : tshepang/rust/misleading, r=brson

We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.

9 years agoauto merge of #16689 : wickerwaka/rust/crate-as, r=pcwalton
bors [Wed, 27 Aug 2014 06:01:18 +0000 (06:01 +0000)]
auto merge of #16689 : wickerwaka/rust/crate-as, r=pcwalton

For review. Not sure about the link_attrs stuff. Will work on converting all the tests.

extern crate "foobar" as foo;
extern crate foobar as foo;

Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

9 years agoauto merge of #16685 : alexcrichton/rust/remove-glob, r=brson
bors [Wed, 27 Aug 2014 02:31:20 +0000 (02:31 +0000)]
auto merge of #16685 : alexcrichton/rust/remove-glob, r=brson

This library has been moved out to a cargo package in rust-lang.

9 years agoAdd a simple test for rustdoc search index contents
SiegeLord [Wed, 27 Aug 2014 02:03:39 +0000 (22:03 -0400)]
Add a simple test for rustdoc search index contents

9 years agoglob: Deprecate the library in favor of cargo
Alex Crichton [Fri, 22 Aug 2014 22:26:23 +0000 (15:26 -0700)]
glob: Deprecate the library in favor of cargo

This library has been moved out to a cargo package in rust-lang.

9 years agoauto merge of #16704 : flugsio/rust/fix-rustc-ice-lint-underscores-only, r=brson
bors [Wed, 27 Aug 2014 00:31:25 +0000 (00:31 +0000)]
auto merge of #16704 : flugsio/rust/fix-rustc-ice-lint-underscores-only, r=brson

Fix for type identifiers with only underscores (two or more), I assume they doesn't count as camel case.

```rust
type __ = int;

fn main() {
}
```

```
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc/lib.rs:1

stack backtrace:
   1: 0xb603f5d0 - rt::backtrace::imp::write::ha55f265f6626471dmxr
   2: 0xb6042620 - failure::on_fail::h4d2c6d42b67e94803Sr
   3: 0xb640a180 - unwind::begin_unwind_inner::h484879fa7cc3611fZhe
   4: 0xb6409e50 - unwind::begin_unwind_fmt::hd14e5c64bc9006capfe
   5: 0xb6409df0 - rust_begin_unwind
   6: 0xb6454580 - failure::begin_unwind::h9ab1fc5753bd08f3YDk
   7: 0xb6458cb0 - failure::fail_bounds_check::h88167bad36865909aCk
   8: 0xb6f685d0 - lint::builtin::NonCamelCaseTypes.LintPass::check_item::check_case::he854eeffd105cb0f40E
   9: 0xb6f68050 - lint::builtin::NonCamelCaseTypes.LintPass::check_item::hc35b45d248e41cd43XE
  10: 0xb6f7b760 - lint::context::Context<'a>.Visitor<(*>::visit_item::closure.139262
  11: 0xb6f79510 - lint::context::Context<'a>::with_lint_attrs::hb9efe321fa321ce6spG
  12: 0xb6f81d30 - lint::context::Context<'a>.Visitor<(*>::visit_mod::he4593c831936b308ZMG
  13: 0xb6f8f2f0 - lint::context::check_crate::closure.139319
  14: 0xb6f79510 - lint::context::Context<'a>::with_lint_attrs::hb9efe321fa321ce6spG
  15: 0xb6efda70 - lint::context::check_crate::ha9e64328726b9579q1G
  16: 0xb6efda20 - driver::driver::phase_3_run_analysis_passes::closure.136263
  17: 0xb659d640 - util::common::time::h2837683151147173214
  18: 0xb6e7d130 - driver::driver::phase_3_run_analysis_passes::h7079eff53afc4de3Jfz
  19: 0xb6e783f0 - driver::driver::compile_input::h0ec84a550e24779cP1y
  20: 0xb6f26250 - driver::run_compiler::h7e7c01ecbfd0ad87JzC
  21: 0xb6f26150 - driver::main_args::closure.137215
  22: 0xb6f380d0 - task::TaskBuilder<S>::try_future::closure.138376
  23: 0xb6f37ec0 - task::TaskBuilder<S>::spawn_internal::closure.138353
  24: 0xb774bdd0 - task::spawn_opts::closure.8325
  25: 0xb6409c10 - unwind::try::try_fn::h91f00772748cf73eD8d
  26: 0xb6468ae0 - rust_try_inner
  27: 0xb6468aa0 - rust_try
  28: 0xb6407880 - unwind::try::h78a4fc0e85c326aef6d
  29: 0xb6407640 - task::Task::run::hb6f2d9484116e3d8xcd
  30: 0xb774bba0 - task::spawn_opts::closure.8271
  31: 0xb6409350 - thread::thread_start::h8c02fef9f651da5cjBd
  32: 0xb5ed3fc0 - start_thread
  33: 0xb62e8a32 - __clone
  34:        0x0 - <unknown>
```

9 years agoadd missing ! char to feature gate hint
Christoph Burgdorf [Tue, 26 Aug 2014 20:44:53 +0000 (22:44 +0200)]
add missing ! char to feature gate hint

9 years agolibcollections: In tests, remove some uses of deprecated methods and
nham [Tue, 26 Aug 2014 19:45:55 +0000 (15:45 -0400)]
libcollections: In tests, remove some uses of deprecated methods and
unused imports.

9 years agoAlways insert methods into the search index, even if we're currently in a private...
SiegeLord [Tue, 26 Aug 2014 18:41:25 +0000 (14:41 -0400)]
Always insert methods into the search index, even if we're currently in a private module.

Previously, this caused methods of re-exported types to not be inserted into
the search index. This fix may introduce some false positives, but in my
testing they appear as orphaned methods and end up not being inserted into the
final search index at a later stage.

Fixes issue #11943

9 years agoUse cargo run in more places
Matej Lach [Tue, 26 Aug 2014 18:40:11 +0000 (19:40 +0100)]
Use cargo run in more places

9 years agorustdoc: Don't assume that a doc attribute was sugared: Fixes #15976
Kevin Mehall [Tue, 26 Aug 2014 16:39:26 +0000 (09:39 -0700)]
rustdoc: Don't assume that a doc attribute was sugared: Fixes #15976

As of 8876ce44, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that doc attributes came from sugared comments.

9 years agoauto merge of #16742 : vhbit/rust/ios-ffi-fix, r=alexcrichton
bors [Tue, 26 Aug 2014 15:56:08 +0000 (15:56 +0000)]
auto merge of #16742 : vhbit/rust/ios-ffi-fix, r=alexcrichton

9 years agoClarify what tx and rx mean
Robert Clipsham [Tue, 26 Aug 2014 11:51:36 +0000 (12:51 +0100)]
Clarify what tx and rx mean

Add a short explanation of what tx and rx mean in terms of channels.

9 years agoauto merge of #16720 : tshepang/rust/trailing-prompt, r=alexcrichton
bors [Tue, 26 Aug 2014 14:11:08 +0000 (14:11 +0000)]
auto merge of #16720 : tshepang/rust/trailing-prompt, r=alexcrichton

because eyesore

9 years agoauto merge of #14397 : nick29581/rust/coerce, r=pnkfelix
bors [Tue, 26 Aug 2014 10:31:06 +0000 (10:31 +0000)]
auto merge of #14397 : nick29581/rust/coerce, r=pnkfelix

DST coercions and DST fields in structs

The commits are not quite stand alone, I should probably squash them together before landing. In particular if you review the individual commits, then you'll see some scrappy stuff that gets fixed in later commits. But reading the commits in order might be easier to get an overall idea of what is going on.

The first commit includes putting back time zone into our time library - @pcwalton removed that as part of his de-~str'ing, but I had already converted it to use StrBuf, so we may as well leave it in. Update: no longer, this is removed in a later commit.

9 years agoauto merge of #16753 : luqmana/rust/typer-ty, r=nikomatsakis
bors [Tue, 26 Aug 2014 04:41:10 +0000 (04:41 +0000)]
auto merge of #16753 : luqmana/rust/typer-ty, r=nikomatsakis

We shouldn't be making calls directly to `ty::node_id_to_type` since the typer may be bcx which also has to monomorphize the type.

Fixes #16643.

9 years agoOptimise a particularly clown shoes example of DST codegen
Nick Cameron [Tue, 26 Aug 2014 00:35:25 +0000 (12:35 +1200)]
Optimise a particularly clown shoes example of DST codegen

9 years agoRebasing changes
Nick Cameron [Wed, 6 Aug 2014 09:59:40 +0000 (11:59 +0200)]
Rebasing changes

9 years agoDST coercions and DST structs
Nick Cameron [Mon, 4 Aug 2014 12:20:11 +0000 (14:20 +0200)]
DST coercions and DST structs

[breaking-change]

1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code.

2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible.

3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.

9 years agoUse temp vars for implicit coercion to ^[T]
Nick Cameron [Mon, 4 Aug 2014 12:19:02 +0000 (14:19 +0200)]
Use temp vars for implicit coercion to ^[T]

9 years agoUse the slice repr for ~[T]
Nick Cameron [Fri, 25 Apr 2014 03:14:52 +0000 (15:14 +1200)]
Use the slice repr for ~[T]

9 years agoAdd test.
Luqman Aden [Mon, 25 Aug 2014 20:37:40 +0000 (13:37 -0700)]
Add test.

9 years agolibrustc: Use Typer's node_ty method instead of free function in ExprUseVisitor.
Luqman Aden [Mon, 25 Aug 2014 20:30:49 +0000 (13:30 -0700)]
librustc: Use Typer's node_ty method instead of free function in ExprUseVisitor.

9 years agoAdd tests to make sure intrinsicck doesn't apply to non-intrinsic fn's.
Luqman Aden [Mon, 25 Aug 2014 19:03:43 +0000 (12:03 -0700)]
Add tests to make sure intrinsicck doesn't apply to non-intrinsic fn's.

9 years agolibrustc: Restrict transmute intrinsicck to just rust-intrinsic fn's.
Luqman Aden [Mon, 25 Aug 2014 18:45:19 +0000 (11:45 -0700)]
librustc: Restrict transmute intrinsicck to just rust-intrinsic fn's.

9 years agoauto merge of #16740 : alexcrichton/rust/issue-16725, r=pcwalton
bors [Mon, 25 Aug 2014 12:10:56 +0000 (12:10 +0000)]
auto merge of #16740 : alexcrichton/rust/issue-16725, r=pcwalton

Closes #16725

9 years agorustc: Encode the visibility of foreign items
Alex Crichton [Mon, 25 Aug 2014 00:05:47 +0000 (17:05 -0700)]
rustc: Encode the visibility of foreign items

The privacy pass of the compiler was previously not taking into account the
privacy of foreign items, or bindings to external functions. This commit fixes
this oversight by encoding the visibility of foreign items into the metadata for
each crate.

Any code relying on this will start to fail to  compile and the bindings must be
marked with `pub` to indicate that they can be used externally.

Closes #16725
[breaking-change]

9 years agoAdopting FFI changes for iOS
Valerii Hiora [Mon, 25 Aug 2014 10:45:07 +0000 (13:45 +0300)]
Adopting FFI changes for iOS

9 years agoauto merge of #16699 : treeman/rust/issue-8492, r=alexcrichton
bors [Mon, 25 Aug 2014 03:30:54 +0000 (03:30 +0000)]
auto merge of #16699 : treeman/rust/issue-8492, r=alexcrichton

Closes #8492.

I did not find this suggestion in the [guidelines][] but it's mentioned in the [old style guide][].

[guidelines]: https://github.com/rust-lang/rust-guidelines
[old style guide]: https://github.com/rust-lang/rust/wiki/Note-style-guide/73c864a10a8e231e2a6630e5a3461f1d3022a20a

9 years agoauto merge of #15704 : alexcrichton/rust/issue-15595, r=brson
bors [Mon, 25 Aug 2014 01:45:57 +0000 (01:45 +0000)]
auto merge of #15704 : alexcrichton/rust/issue-15595, r=brson

If a task is spinning in an accept loop, there is currently no method of gracefully shutting it down. This PR introduces a way to do so by cloning the acceptor and implementing a close_accept method to unblocking any pending acceptor.

As with other I/O methods like this, it is `#[experimental]` from the start and sadly carries with it a good deal of code to support it. Much of the complication is from the fact that you can now concurrently accept on the same socket.

I tried to add a good deal of tests for this change, but another set of eyes is always appreciated!

9 years agonative: clone/close_accept for win32 pipes
Alex Crichton [Tue, 15 Jul 2014 19:42:40 +0000 (12:42 -0700)]
native: clone/close_accept for win32 pipes

This commits takes a similar strategy to the previous commit to implement
close_accept and clone for the native win32 pipes implementation.

Closes #15595

9 years agonative: Add some documentation for accept
Alex Crichton [Tue, 15 Jul 2014 18:06:31 +0000 (11:06 -0700)]
native: Add some documentation for accept

Document the new code for how close_accept and timeouts are implemented.

9 years agonative: TCP close/close_accept for windows
Alex Crichton [Tue, 15 Jul 2014 17:28:00 +0000 (10:28 -0700)]
native: TCP close/close_accept for windows

This commit implements TcpAcceptor::{close, close_accept} for windows via
WSAEVENT types.

9 years agorustuv: Implement clone/close_accept
Alex Crichton [Tue, 15 Jul 2014 05:48:05 +0000 (22:48 -0700)]
rustuv: Implement clone/close_accept

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
all of librustuv.

This implementation rewrites much of Access, AccessTimeout, and AcceptTimeout to
have type parameter for shared state that all acceptors share (a shared queue of
sockets). The incoming/outgoing channels have been removed as all timeouts and
such are now managed on the event loop rather than concurrently.

9 years agonative: Implement clone/close_accept for unix
Alex Crichton [Fri, 11 Jul 2014 21:29:15 +0000 (14:29 -0700)]
native: Implement clone/close_accept for unix

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
unix. A windows implementation is coming in a later commit.

The clone implementation is based on atomic reference counting (as with all
other clones), and the close_accept implementation is based on selecting on a
self-pipe which signals that a close has been seen.

9 years agoauto merge of #16694 : vadimcn/rust/debug-linker, r=alexcrichton
bors [Mon, 25 Aug 2014 00:00:59 +0000 (00:00 +0000)]
auto merge of #16694 : vadimcn/rust/debug-linker, r=alexcrichton

Shows linker spew even when linking succeeds.  This is occasionally useful in order to see verbose linker output.

9 years agoauto merge of #16646 : P1start/rust/trailing-commas, r=alexcrichton
bors [Sun, 24 Aug 2014 22:16:00 +0000 (22:16 +0000)]
auto merge of #16646 : P1start/rust/trailing-commas, r=alexcrichton

This lets the parser understand trailing commas in method calls, method definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.

9 years agoauto merge of #16718 : Sawyer47/rust/bool-cast, r=pcwalton
bors [Sun, 24 Aug 2014 20:30:59 +0000 (20:30 +0000)]
auto merge of #16718 : Sawyer47/rust/bool-cast, r=pcwalton

Current version of rust fails when casting from bool, e.g.
```rust
fn main() {
    let _a = false as uint;
    let _b = true as uint;
    let _c: [bool, ..false as uint];
    let _d: [bool, ..true as uint];
    // _a and _b work, but _c and _d result in an error
    // error: expected constant expr for vector length: can't cast str to uint
}
```
This commit makes it work as expected.

9 years agoauto merge of #16728 : bluss/rust/zip-next-back, r=alexcrichton
bors [Sun, 24 Aug 2014 18:46:01 +0000 (18:46 +0000)]
auto merge of #16728 : bluss/rust/zip-next-back, r=alexcrichton

Use ExactSize::len() and defer to its decisions about overly defensive
assertions. Remove the length double-check and simply put a failure
case if the Zip finds an uneven end in .next_back().

Fixing this up since I think I wrote this, and it's been known to
confuse rusties (PR #15886).

9 years agoauto merge of #16730 : tshepang/rust/typos, r=pcwalton
bors [Sun, 24 Aug 2014 17:01:06 +0000 (17:01 +0000)]
auto merge of #16730 : tshepang/rust/typos, r=pcwalton

9 years agodoc: fix some typos in the Guide
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 15:22:10 +0000 (17:22 +0200)]
doc: fix some typos in the Guide

9 years agoauto merge of #16722 : tshepang/rust/trailing-spaces, r=pcwalton
bors [Sun, 24 Aug 2014 13:51:03 +0000 (13:51 +0000)]
auto merge of #16722 : tshepang/rust/trailing-spaces, r=pcwalton

9 years agolibcore: Simplify Enumerate, Zip::next_back
root [Sun, 24 Aug 2014 13:04:28 +0000 (15:04 +0200)]
libcore: Simplify Enumerate, Zip::next_back

Use ExactSize::len() and defer to its decisions about overly defensive
assertions. Remove the length double-check and simply put a failure
case if the Zip finds an uneven end in .next_back().

Fixing this up since I think I wrote this, and it's been known to
confuse rusties (PR#15886).

9 years agoauto merge of #16717 : tshepang/rust/misplaced-comma, r=pcwalton
bors [Sun, 24 Aug 2014 11:16:02 +0000 (11:16 +0000)]
auto merge of #16717 : tshepang/rust/misplaced-comma, r=pcwalton

Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.

9 years agodoc: remove misleading/confusing info
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 11:10:59 +0000 (13:10 +0200)]
doc: remove misleading/confusing info

We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.

9 years agodoc: remove trailing spaces from Guide
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 10:26:45 +0000 (12:26 +0200)]
doc: remove trailing spaces from Guide

9 years agodoc: remove trailing shell prompts
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 10:16:14 +0000 (12:16 +0200)]
doc: remove trailing shell prompts

because eyesore

9 years agoauto merge of #16710 : dotdash/rust/mergefunc, r=thestinger
bors [Sun, 24 Aug 2014 09:30:56 +0000 (09:30 +0000)]
auto merge of #16710 : dotdash/rust/mergefunc, r=thestinger

Fixes #9536

---

From https://github.com/rust-lang/rust/issues/9536#issuecomment-45495670:

I've built rustc with the aforementioned fix, once with MergeFunc being run early (that's what the patch for clang that comes  with LLVM does), and once with MergeFunc being run late (using `-C passes=mergefunc`). Here are some time/code size measurements I made with them:

Build command: `rustc -O -o /dev/null --emit asm .../lib.rs`

CPU (user) times, best of three runs:

 Crate       | No MergeFunc | Early MergeFunc | Late MergeFunc
-------------|--------------|-----------------|---------------
 core        |    5.380s    |    5.476s       |    5.364s
 collections |    1.884s    |    1.856s       |    1.892s
 native      |    7.200s    |    7.356s       |    7.108s
 rustc       | 3m23.584s    | 3m28.120s       | 3m21.820s
 std         |   13.888s    |   13.976s       |   13.848s
 syntax      |   48.992s    |   47.752s       |   48.372s

Sizes:

Crate                                    | No MergeFunc |   Early MergeFunc   |    Late MergeFunc
-----------------------------------------|-------------:|--------------------:|-------------------:
lib                                      |  237037581   |  236005998 (-0.44%) |  234708744 (-0.98%)
libarena-063bff73-0.11.0-pre.so          |      60398   |      60393 (-0.01%) |      60394 (-0.01%)
libcollections-d412c0c4-0.11.0-pre.so    |     971566   |     971772 (+0.02%) |     971691 (+0.01%)
libdebug-1e940314-0.11.0-pre.so          |     181352   |     181514 (+0.09%) |     181363 (+0.01%)
libflate-92afea7e-0.11.0-pre.so          |     137837   |     137869 (+0.02%) |     137837 (+0.00%)
libfmt_macros-5125f3bd-0.11.0-pre.so     |     132733   |     134598 (+1.41%) |     132465 (-0.20%)
libgetopts-c94737d1-0.11.0-pre.so        |     158851   |     157427 (-0.90%) |     158272 (-0.36%)
libgraphviz-7b3cf89d-0.11.0-pre.so       |      53337   |      53178 (-0.30%) |      53337 (+0.00%)
liblog-cd053230-0.11.0-pre.so            |      85993   |      86017 (+0.03%) |      85780 (-0.25%)
libnative-1fb5e2c0-0.11.0-pre.so         |     635785   |     639352 (+0.56%) |     621184 (-2.30%)
libregex-77385931-0.11.0-pre.so          |     450538   |     450741 (+0.05%) |     449504 (-0.23%)
librustc-d252d482-0.11.0-pre.so          |   51583741   |   51227703 (-0.69%) |   50930784 (-1.27%)
librustdoc-6ecbf63e-0.11.0-pre.so        |    4557104   |    4501896 (-1.21%) |    4394409 (-3.57%)
libserialize-0352aab7-0.11.0-pre.so      |    1126096   |    1115503 (-0.94%) |    1101734 (-2.16%)
libstd-59beb4f7-0.11.0-pre.so            |    4499529   |    4488879 (-0.24%) |    4477710 (-0.48%)
libsync-305341d2-0.11.0-pre.so           |     306767   |     312211 (+1.77%) |     304086 (-0.87%)
libsyntax-555559ea-0.11.0-pre.so         |    6699751   |    6632291 (-1.01%) |    6596232 (-1.55%)
libterm-4e4945a5-0.11.0-pre.so           |     389390   |     392689 (+0.85%) |     385525 (-0.99%)
libtest-a79f950d-0.11.0-pre.so           |     740161   |     730673 (-1.28%) |     734534 (-0.76%)
libtime-4bb3739b-0.11.0-pre.so           |     131518   |     132830 (+1.00%) |     131514 (-0.00%)
rustlib                                  |  164131038   |  163594366 (-0.33%) |  162796293 (-0.81%)
x86_64-unknown-linux-gnu                 |  164119867   |  163583195 (-0.33%) |  162785122 (-0.81%)
lib                                      |  164115771   |  163579099 (-0.33%) |  162781026 (-0.81%)
liballoc-1085c790-0.11.0-pre.rlib        |    1094410   |    1094444 (+0.00%) |    1094438 (+0.00%)
libarena-063bff73-0.11.0-pre.rlib        |     312324   |     312152 (-0.06%) |     312210 (-0.04%)
libarena-063bff73-0.11.0-pre.so          |      60394   |      60394 (+0.00%) |      60394 (+0.00%)
libcollections-d412c0c4-0.11.0-pre.rlib  |    7048646   |    7049094 (+0.01%) |    7048856 (+0.00%)
libcollections-d412c0c4-0.11.0-pre.so    |     971575   |     971771 (+0.02%) |     971681 (+0.01%)
libcompiler-rt.a                         |     573802   |     573802 (+0.00%) |     573802 (+0.00%)
libcore-c5ed6fb4-0.11.0-pre.rlib         |   24204746   |   24209820 (+0.02%) |   24187602 (-0.07%)
libdebug-1e940314-0.11.0-pre.rlib        |     876616   |     878488 (+0.21%) |     876746 (+0.01%)
libdebug-1e940314-0.11.0-pre.so          |     181352   |     181509 (+0.09%) |     181353 (+0.00%)
libflate-92afea7e-0.11.0-pre.rlib        |     175062   |     175074 (+0.01%) |     175082 (+0.01%)
libflate-92afea7e-0.11.0-pre.so          |     137837   |     137869 (+0.02%) |     137837 (+0.00%)
libfmt_macros-5125f3bd-0.11.0-pre.so     |     132724   |     134599 (+1.41%) |     132469 (-0.19%)
libfourcc-cc0e8bf1-0.11.0-pre.so         |     125828   |     126084 (+0.20%) |     125827 (-0.00%)
libgetopts-c94737d1-0.11.0-pre.rlib      |     864664   |     853040 (-1.34%) |     862548 (-0.24%)
libgetopts-c94737d1-0.11.0-pre.so        |     158855   |     157425 (-0.90%) |     158275 (-0.37%)
libglob-eafe1d22-0.11.0-pre.rlib         |     951370   |     944674 (-0.70%) |     946734 (-0.49%)
libglob-eafe1d22-0.11.0-pre.so           |     159130   |     157385 (-1.10%) |     156791 (-1.47%)
libgraphviz-7b3cf89d-0.11.0-pre.rlib     |     269600   |     269062 (-0.20%) |     269560 (-0.01%)
libgraphviz-7b3cf89d-0.11.0-pre.so       |      53334   |      53176 (-0.30%) |      53337 (+0.01%)
libgreen-ca0d0b80-0.11.0-pre.rlib        |    1374120   |    1389510 (+1.12%) |    1361696 (-0.90%)
libgreen-ca0d0b80-0.11.0-pre.so          |     372435   |     377929 (+1.48%) |     370991 (-0.39%)
libhexfloat-3b978f48-0.11.0-pre.so       |     131926   |     132166 (+0.18%) |     131935 (+0.01%)
liblibc-4f9a876d-0.11.0-pre.rlib         |     617472   |     617472 (+0.00%) |     617472 (+0.00%)
liblog-cd053230-0.11.0-pre.rlib          |     371190   |     371048 (-0.04%) |     370836 (-0.10%)
liblog-cd053230-0.11.0-pre.so            |      85996   |      86020 (+0.03%) |      85781 (-0.25%)
libmorestack.a                           |       1388   |       1388 (+0.00%) |       1388 (+0.00%)
libnative-1fb5e2c0-0.11.0-pre.rlib       |    2233070   |    2264296 (+1.40%) |    2194920 (-1.71%)
libnative-1fb5e2c0-0.11.0-pre.so         |     635787   |     639341 (+0.56%) |     621184 (-2.30%)
libnum-ebe12db7-0.11.0-pre.rlib          |    2672318   |    2675292 (+0.11%) |    2669370 (-0.11%)
libnum-ebe12db7-0.11.0-pre.so            |     398924   |     399357 (+0.11%) |     395821 (-0.78%)
librand-2ea8f361-0.11.0-pre.rlib         |    1691108   |    1691696 (+0.03%) |    1690264 (-0.05%)
libregex-77385931-0.11.0-pre.rlib        |    2007348   |    2006050 (-0.06%) |    2003804 (-0.18%)
libregex-77385931-0.11.0-pre.so          |     450520   |     450790 (+0.06%) |     449535 (-0.22%)
libregex_macros-a2216dec-0.11.0-pre.so   |     597208   |     569004 (-4.72%) |     568800 (-4.76%)
librlibc-d1ece24e-0.11.0-pre.rlib        |      12394   |      12394 (+0.00%) |      12394 (+0.00%)
librustc-d252d482-0.11.0-pre.so          |   51582383   |   51230320 (-0.68%) |   50930784 (-1.26%)
librustdoc-6ecbf63e-0.11.0-pre.so        |    4557074   |    4501877 (-1.21%) |    4394506 (-3.57%)
librustuv-ede8cb89-0.11.0-pre.rlib       |    4774956   |    4791366 (+0.34%) |    4732386 (-0.89%)
librustuv-ede8cb89-0.11.0-pre.so         |    1401710   |    1400237 (-0.11%) |    1386869 (-1.06%)
libsemver-e49a2dee-0.11.0-pre.rlib       |     392704   |     392434 (-0.07%) |     392940 (+0.06%)
libsemver-e49a2dee-0.11.0-pre.so         |      71863   |      71847 (-0.02%) |      71860 (-0.00%)
libserialize-0352aab7-0.11.0-pre.rlib    |    8059698   |    8033972 (-0.32%) |    7989802 (-0.87%)
libserialize-0352aab7-0.11.0-pre.so      |    1126099   |    1115520 (-0.94%) |    1101721 (-2.16%)
libstd-59beb4f7-0.11.0-pre.rlib          |   18802728   |   18780212 (-0.12%) |   18743438 (-0.32%)
libstd-59beb4f7-0.11.0-pre.so            |    4499534   |    4488835 (-0.24%) |    4477677 (-0.49%)
libsync-305341d2-0.11.0-pre.rlib         |    1377062   |    1400190 (+1.68%) |    1369498 (-0.55%)
libsync-305341d2-0.11.0-pre.so           |     306762   |     312212 (+1.78%) |     304095 (-0.87%)
libsyntax-555559ea-0.11.0-pre.so         |    6703330   |    6632254 (-1.06%) |    6596295 (-1.60%)
libterm-4e4945a5-0.11.0-pre.rlib         |    1503928   |    1512648 (+0.58%) |    1495932 (-0.53%)
libterm-4e4945a5-0.11.0-pre.so           |     389380   |     392678 (+0.85%) |     385517 (-0.99%)
libtest-a79f950d-0.11.0-pre.rlib         |    3606962   |    3555410 (-1.43%) |    3589258 (-0.49%)
libtest-a79f950d-0.11.0-pre.so           |     740255   |     728398 (-1.60%) |     734521 (-0.77%)
libtime-4bb3739b-0.11.0-pre.rlib         |     847036   |     847178 (+0.02%) |     847194 (+0.02%)
libtime-4bb3739b-0.11.0-pre.so           |     131516   |     132829 (+1.00%) |     131518 (+0.00%)
liburl-b8b5640c-0.11.0-pre.rlib          |     647764   |     647558 (-0.03%) |     646896 (-0.13%)
liburl-b8b5640c-0.11.0-pre.so            |     146616   |     146621 (+0.00%) |     146531 (-0.06%)
libuuid-238d8f44-0.11.0-pre.rlib         |     359732   |     359682 (-0.01%) |     358936 (-0.22%)
libuuid-238d8f44-0.11.0-pre.so           |      77110   |      77110 (+0.00%) |      77023 (-0.11%)
total                                    |  237081476   |  236049893 (-0.44%) |  234752639 (-0.98%)

So running MergeFunc early like in the clang patch isn't nearly as good as running it late. I also tried to enable usage of global aliases instead of just thunks when merging functions, but that crashes.

9 years agoAdjust the error messages to match the pattern "expected foo, found bar"
Jonas Hietala [Sat, 23 Aug 2014 10:41:32 +0000 (12:41 +0200)]
Adjust the error messages to match the pattern "expected foo, found bar"

Closes #8492

9 years agoauto merge of #16706 : pnkfelix/rust/fsk-fix-nojem-realloc, r=thestinger
bors [Sun, 24 Aug 2014 07:45:59 +0000 (07:45 +0000)]
auto merge of #16706 : pnkfelix/rust/fsk-fix-nojem-realloc, r=thestinger

Copy only up to `min(new_size, old_size)` when doing reallocate.

This was a bug when running with jemalloc disabled.

Fix #16687

9 years agoFix const evaluation of cast expression from bool
Piotr Jawniak [Sat, 23 Aug 2014 11:59:39 +0000 (13:59 +0200)]
Fix const evaluation of cast expression from bool

9 years agolint: Improve camel case suggestion when empty.
Jimmie Elvenmark [Sun, 24 Aug 2014 07:07:19 +0000 (09:07 +0200)]
lint: Improve camel case suggestion when empty.

9 years agoauto merge of #16703 : bluss/rust/assert-bloat, r=huonw
bors [Sun, 24 Aug 2014 06:00:58 +0000 (06:00 +0000)]
auto merge of #16703 : bluss/rust/assert-bloat, r=huonw

With no custom message, we should just use concat! + stringify! for
`assert!(expr)` to avoid the string formatting code path.

Inspired by issue #16625

9 years agoauto merge of #16698 : bluss/rust/slice-bloat, r=huonw
bors [Sun, 24 Aug 2014 03:10:59 +0000 (03:10 +0000)]
auto merge of #16698 : bluss/rust/slice-bloat, r=huonw

These are somewhat stop-gap solutions to address #16625

core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.

The testcase:

```
#![crate_type = "lib"]
pub fn slice(x: &str, a: uint, b: uint) -> &str {
    x.slice(a, b)
}
```

shrinks from 16.9 kB to 3.3 kB llvm IR, and the number of `unreachable` drops from 5 to 1.

9 years agodoc: move misplaced comma
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 02:24:25 +0000 (04:24 +0200)]
doc: move misplaced comma

Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.

9 years agoauto merge of #16697 : Sawyer47/rust/new-test, r=huonw
bors [Sun, 24 Aug 2014 01:25:57 +0000 (01:25 +0000)]
auto merge of #16697 : Sawyer47/rust/new-test, r=huonw

Closes #10618
Closes #16382

9 years agoEnable the MergeFunc pass
Björn Steinbrink [Sat, 23 Aug 2014 22:03:56 +0000 (00:03 +0200)]
Enable the MergeFunc pass

Fixes #9536

9 years agoauto merge of #16691 : klutzy/rust/issue-15297, r=alexcrichton
bors [Sat, 23 Aug 2014 22:35:56 +0000 (22:35 +0000)]
auto merge of #16691 : klutzy/rust/issue-15297, r=alexcrichton

First commit fixes issue regarding recognizing MSYS2 build.
Second commit fixes issue regarding MSYS/Windows paths.

9 years agoLog linker stderr and stdout.
Vadim Chugunov [Sat, 23 Aug 2014 20:19:29 +0000 (13:19 -0700)]
Log linker stderr and stdout.

9 years agoauto merge of #16670 : Swatinem/rust/charascii, r=alexcrichton
bors [Sat, 23 Aug 2014 20:50:57 +0000 (20:50 +0000)]
auto merge of #16670 : Swatinem/rust/charascii, r=alexcrichton

I was doing a lot of parsing ascii strings, and the generic bsearch functions in `tables.rs` came up very high in the profile.
This should avoid calling those functions for simple ASCII range chars.

9 years agoextern crate foobar as foo;
wickerwaka [Sat, 23 Aug 2014 04:02:00 +0000 (21:02 -0700)]
extern crate foobar as foo;

Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

Changed all the tests to use the new extern crate syntax

Change pretty printer to use 'as' syntax

9 years agoauto merge of #16612 : nham/rust/twoway_searcher_fix, r=alexcrichton
bors [Sat, 23 Aug 2014 18:00:59 +0000 (18:00 +0000)]
auto merge of #16612 : nham/rust/twoway_searcher_fix, r=alexcrichton

There is a check in TwoWaySearcher::new to determine whether the needle is periodic. This is needed because during searching when a match fails, we cannot advance the position by the entire length of the needle when it is periodic, but can only advance by the length of the period.

The reason "bananas".contains("nana") (and similar searches) were returning false was because the periodicity check was wrong.

Closes #16589

Also, thanks to @Gankro, who came up with many buggy examples.

9 years agoCopy only up to `min(new_size, old_size)` when doing reallocate.
Felix S. Klock II [Sat, 23 Aug 2014 15:29:48 +0000 (17:29 +0200)]
Copy only up to `min(new_size, old_size)` when doing reallocate.

Fix #16687

9 years agoTest case to illustate/reproduce bug.
Felix S. Klock II [Sat, 23 Aug 2014 17:22:36 +0000 (19:22 +0200)]
Test case to illustate/reproduce bug.

9 years agoauto merge of #16268 : cakebaker/rust/make_fn_add_three_times_four_public, r=steveklabnik
bors [Sat, 23 Aug 2014 16:15:58 +0000 (16:15 +0000)]
auto merge of #16268 : cakebaker/rust/make_fn_add_three_times_four_public, r=steveklabnik

To avoid a compilation error when running the tests the function has to be public.

9 years agoauto merge of #16693 : vadimcn/rust/rename--win32, r=pcwalton
bors [Sat, 23 Aug 2014 14:30:57 +0000 (14:30 +0000)]
auto merge of #16693 : vadimcn/rust/rename--win32, r=pcwalton

9 years agostd: Use concat! and stringify! to simplify the most common assert! case.
root [Sat, 23 Aug 2014 13:51:07 +0000 (15:51 +0200)]
std: Use concat! and stringify! to simplify the most common assert! case.

With no custom message, we should just use concat! + stringify! for
`assert!(expr)`.

Inspired by issue #16625

9 years agolibrustc: Don't ICE with type when name only contain underscores.
Jimmie Elvenmark [Sat, 23 Aug 2014 14:03:28 +0000 (16:03 +0200)]
librustc: Don't ICE with type when name only contain underscores.

9 years agoGuide: Make add_three_times_four() public
Daniel Hofstetter [Tue, 5 Aug 2014 14:43:17 +0000 (16:43 +0200)]
Guide: Make add_three_times_four() public

9 years agocore: Separate failure formatting in str methods slice, slice_to, slice_from
root [Sat, 23 Aug 2014 10:30:08 +0000 (12:30 +0200)]
core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.

9 years agolibunicode: optimize char functions for ascii characters
Arpad Borsos [Fri, 22 Aug 2014 10:04:34 +0000 (12:04 +0200)]
libunicode: optimize char functions for ascii characters

9 years agoAdd test for #10618 and #16382
Piotr Jawniak [Sat, 23 Aug 2014 10:31:48 +0000 (12:31 +0200)]
Add test for #10618 and #16382

Closes #10618
Closes #16382

9 years agoauto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana
bors [Sat, 23 Aug 2014 09:55:52 +0000 (09:55 +0000)]
auto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana

This fixes fallout from 2dc2ac1e6b382b8c658071f61c3f95ae444dcc16, which did not take into account win64.