]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton
bors [Tue, 16 Sep 2014 23:26:11 +0000 (23:26 +0000)]
auto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton

As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. Additional details and motivation in the RFC.

Note that the iterator *type* names are not changed by this RFC; those are awaiting a separate RFC for standardization.

Closes #13660
Closes #16810

[breaking-change]

9 years agoFallout from renaming
Aaron Turon [Mon, 15 Sep 2014 03:27:36 +0000 (20:27 -0700)]
Fallout from renaming

9 years agoauto merge of #17213 : mo/rust/fix_typos, r=aturon
bors [Tue, 16 Sep 2014 21:36:08 +0000 (21:36 +0000)]
auto merge of #17213 : mo/rust/fix_typos, r=aturon

9 years agoAlign with _mut conventions
Aaron Turon [Sun, 14 Sep 2014 22:57:55 +0000 (15:57 -0700)]
Align with _mut conventions

As per [RFC
52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md),
use `_mut` suffixes to mark mutable variants, and `into_iter` for moving
iterators.

[breaking-change]

9 years agoauto merge of #17266 : Gankro/rust/vec-move, r=alexcrichton
bors [Tue, 16 Sep 2014 17:06:00 +0000 (17:06 +0000)]
auto merge of #17266 : Gankro/rust/vec-move, r=alexcrichton

Seems to correctly report exact size, so it should claim to do so formally.

9 years agoauto merge of #17197 : nikomatsakis/rust/issue-5527-trait-reform-revisited, r=pcwalton
bors [Tue, 16 Sep 2014 15:25:59 +0000 (15:25 +0000)]
auto merge of #17197 : nikomatsakis/rust/issue-5527-trait-reform-revisited, r=pcwalton

This patch does not make many functional changes, but does a lot of restructuring towards the goals of #5527. This is the biggest patch, basically, that should enable most of the other patches in a relatively straightforward way.

Major changes:

- Do not track impls through trans, instead recompute as needed.
- Isolate trait matching code into its own module, carefully structure to distinguish various phases (selection vs confirmation vs fulfillment)
- Consider where clauses in their more general form
- Integrate checking of builtin bounds into the  trait matching process, rather than doing it separately in kind.rs (important for opt-in builtin bounds)

What is not included:

- Where clauses are still not generalized. This should be a straightforward follow-up patch.
- Caching. I did not include much caching. I have plans for various kinds of caching we can do. Should be straightforward. Preliminary perf measurements suggested that this branch keeps compilation times roughly what they are.
- Method resolution. The initial algorithm I proposed for #5527 does not work as well as I hoped. I have a revised plan which is much more similar to what we do today.
- Deref vs deref-mut. The initial fix I had worked great for autoderef, but not for explicit deref.
- Permitting blanket impls to overlap with specific impls. Initial plan to consider all nested obligations before considering an impl to match caused many compilation errors. We have a revised plan but it is not implemented here, should be a relatively straightforward extension.

9 years agoauto merge of #17245 : sfackler/rust/enumset-show, r=alexcrichton
bors [Tue, 16 Sep 2014 13:41:00 +0000 (13:41 +0000)]
auto merge of #17245 : sfackler/rust/enumset-show, r=alexcrichton

9 years agoauto merge of #17244 : spastorino/rust/patch-1, r=alexcrichton
bors [Tue, 16 Sep 2014 11:11:03 +0000 (11:11 +0000)]
auto merge of #17244 : spastorino/rust/patch-1, r=alexcrichton

9 years agoauto merge of #17232 : untitaker/rust/patch-1, r=alexcrichton
bors [Tue, 16 Sep 2014 09:26:03 +0000 (09:26 +0000)]
auto merge of #17232 : untitaker/rust/patch-1, r=alexcrichton

The wording is correct if you consider that two of these lines were extracted from the original example. It still tripped me up while reading, so i just removed any reference to the linecount.

9 years agoauto merge of #17280 : thestinger/rust/heap, r=pcwalton
bors [Tue, 16 Sep 2014 04:56:01 +0000 (04:56 +0000)]
auto merge of #17280 : thestinger/rust/heap, r=pcwalton

9 years agoauto merge of #17288 : alexcrichton/rust/change-snap, r=brson
bors [Tue, 16 Sep 2014 02:26:01 +0000 (02:26 +0000)]
auto merge of #17288 : alexcrichton/rust/change-snap, r=brson

I'm rotating in some CentOS 5.10 bots so we *actually* build on Linux 2.6.18
like we advertise doing so. Currently the snapshots are incompatible with CentOS
5.10 due to snapshots requiring glibc 2.6 and CentOS 5.10 having glibc 2.5.

It turns out that rustc only requires *one* symbol from glibc 2.6, which is
`futimens`. The rust distribution itself does not use this symbol, but LLVM
conditionally detects it and then uses it. This symbol isn't even called as part
of the compilation process, so we don't even need it!

The new snapshot was generated following these instructions [1]:

1. Download the current x86_64 linux snapshot and unpack it.
2. Open the rustc binary in a hex editor.
3. Change the linkage against glibc 2.6 from strong to *weak*
4. Write changes and re-run src/etc/make-snapshot.py
5. Upload new tarball to S3

On CentOS 5.10 a warning is printed each time the snapshot runs that the symbol
cannot be found (anyone with glibc 2.6+ does not have this warning printed). The
key part is that we can *bootstrap* on CentOS 5.10 at this point. The next
snapshot will be naturally compatible with glibc 2.3 (even older!) and will not
need to be manually edited.

[1]: http://jamesbond3142.no-ip.org/wiki/wiki.cgi/NewAppsOnOldGlibc

9 years agoChange the last linux 64-bit snapshot
Alex Crichton [Mon, 15 Sep 2014 18:17:00 +0000 (11:17 -0700)]
Change the last linux 64-bit snapshot

I'm rotating in some CentOS 5.10 bots so we *actually* build on Linux 2.6.18
like we advertise doing so. Currently the snapshots are incompatible with CentOS
5.10 due to snapshots requiring glibc 2.6 and CentOS 5.10 having glibc 2.5.

It turns out that rustc only requires *one* symbol from glibc 2.6, which is
`futimens`. The rust distribution itself does not use this symbol, but LLVM
conditionally detects it and then uses it. This symbol isn't even called as part
of the compilation process, so we don't even need it!

The new snapshot was generated following these instructions [1]:

1. Download the current x86_64 linux snapshot and unpack it.
2. Open the rustc binary in a hex editor.
3. Change the linkage against glibc 2.6 from strong to *weak*
4. Write changes and re-run src/etc/make-snapshot.py
5. Upload new tarball to S3

On CentOS 5.10 a warning is printed each time the snapshot runs that the symbol
cannot be found (anyone with glibc 2.6+ does not have this warning printed). The
key part is that we can *bootstrap* on CentOS 5.10 at this point. The next
snapshot will be naturally compatible with glibc 2.3 (even older!) and will not
need to be manually edited.

[1]: http://jamesbond3142.no-ip.org/wiki/wiki.cgi/NewAppsOnOldGlibc

9 years agoUpdate docs to include Sized trait, which is needed
Niko Matsakis [Mon, 15 Sep 2014 22:52:20 +0000 (18:52 -0400)]
Update docs to include Sized trait, which is needed

9 years agoremove the closure_exchange_malloc lang item
Daniel Micay [Mon, 15 Sep 2014 20:31:32 +0000 (16:31 -0400)]
remove the closure_exchange_malloc lang item

9 years agoauto merge of #17221 : bkoropoff/rust/strinterner-unsafe, r=sfackler
bors [Mon, 15 Sep 2014 21:56:00 +0000 (21:56 +0000)]
auto merge of #17221 : bkoropoff/rust/strinterner-unsafe, r=sfackler

The `StrInterner::clear()` method takes self immutably but can invalidate references returned by `StrInterner::get_ref`. Since `get_ref` is unused, just remove it.

Closes #17181

9 years agoFix two typos
Martin Olsson [Sun, 7 Sep 2014 19:47:55 +0000 (21:47 +0200)]
Fix two typos

9 years agoheap: optimize EMPTY to avoid relocations
Daniel Micay [Mon, 15 Sep 2014 19:37:01 +0000 (15:37 -0400)]
heap: optimize EMPTY to avoid relocations

Sized deallocation makes it pointless to provide an address that never
overlaps with pointers returned by an allocator. Code can branch on the
capacity of the allocation instead of a comparison with this sentinel.

This improves the situation in #8859, and the remaining issues are only
from the logging API, which should be disabled by default in optimized
release builds anyway along with debug assertions. The remaining issues
are part of #17081.

Closes #8859

9 years agoheap: rm out-of-date FIXMEs
Daniel Micay [Mon, 15 Sep 2014 19:28:25 +0000 (15:28 -0400)]
heap: rm out-of-date FIXMEs

9 years agosilence various warnings in stdlib, no idea why they suddenly started
Niko Matsakis [Fri, 12 Sep 2014 16:10:13 +0000 (12:10 -0400)]
silence various warnings in stdlib, no idea why they suddenly started

9 years agoadd Send bound on impl because stricter trait checking requires it
Niko Matsakis [Fri, 12 Sep 2014 16:09:54 +0000 (12:09 -0400)]
add Send bound on impl because stricter trait checking requires it

9 years agomisc ppaux changes
Niko Matsakis [Fri, 12 Sep 2014 16:09:17 +0000 (12:09 -0400)]
misc ppaux changes

9 years agotypeck/kind -- stop using old trait framework.
Niko Matsakis [Fri, 12 Sep 2014 15:47:33 +0000 (11:47 -0400)]
typeck/kind -- stop using old trait framework.

- Unify the "well-formedness" checking that typeck was already doing with what
  was taking place in kind.
- Move requirements that things be sized into typeck.
- I left the checking on upvars in kind, though I think it should eventually be
  refactored into regionck (which would perhaps be renamed).

This reflects a general plan to convert typeck so that it registers
obligations or other pending things for conditions it cannot check
eventually. This makes it easier to identify all the conditions that
apply to an AST expression, but can also influence inference in somec
cases (e.g., `Send` implies `'static`, so I already had to promote a lot
of the checking that `kind.rs` was doing into typeck, this branch just
continues the process).

9 years agotrans -- stop tracking vtables precisely, instead recompute as needed.
Niko Matsakis [Fri, 12 Sep 2014 15:42:58 +0000 (11:42 -0400)]
trans -- stop tracking vtables precisely, instead recompute as needed.

9 years agoPort coherence to use the new trait matching code
Niko Matsakis [Fri, 12 Sep 2014 14:54:08 +0000 (10:54 -0400)]
Port coherence to use the new trait matching code

9 years agoauto merge of #17199 : jakub-/rust/issues-that-need-tests, r=alexcrichton
bors [Mon, 15 Sep 2014 19:10:55 +0000 (19:10 +0000)]
auto merge of #17199 : jakub-/rust/issues-that-need-tests, r=alexcrichton

Closes #7813.
Closes #10902.
Closes #11374.
Closes #11714.
Closes #12920.
Closes #13202.
Closes #13624.
Closes #14039.
Closes #15730.
Closes #15783.

9 years agoGuts of the new trait matching algorithm, not yet in use
Niko Matsakis [Fri, 12 Sep 2014 14:53:35 +0000 (10:53 -0400)]
Guts of the new trait matching algorithm, not yet in use

9 years agoTake core as a dependency on librlibc. This is needed so that it can
Niko Matsakis [Fri, 12 Sep 2014 14:46:50 +0000 (10:46 -0400)]
Take core as a dependency on librlibc. This is needed so that it can
see the lang-items for Sized etc. @acrichto and @thestinger had no
objections.

9 years agoUpdate error messages in compile-fail tests
Niko Matsakis [Fri, 12 Sep 2014 14:45:39 +0000 (10:45 -0400)]
Update error messages in compile-fail tests

9 years agoauto merge of #17208 : kmcallister/rust/llvm-diagnostics, r=thestinger
bors [Mon, 15 Sep 2014 16:56:03 +0000 (16:56 +0000)]
auto merge of #17208 : kmcallister/rust/llvm-diagnostics, r=thestinger

I would like to map this information back to AST nodes, so that we can print remarks with spans, and so that remarks can be enabled on a per-function basis.  Unfortunately, doing this would require a lot more code restructuring — for example, we currently throw away the AST map and lots of other information before LLVM optimizations run.  So for the time being, we print the remarks with debug location strings from LLVM.  There's a warning if you use `-C remark` without `--debuginfo`.

Fixes #17116.

9 years agoAdd tests for a few A-needstest issues
Jakub Wieczorek [Thu, 11 Sep 2014 22:54:44 +0000 (00:54 +0200)]
Add tests for a few A-needstest issues

Closes #7813.
Closes #10902.
Closes #11374.
Closes #11714.
Closes #12920.
Closes #13202.
Closes #13624.
Closes #14039.
Closes #15730.
Closes #15783.

9 years agoauto merge of #16887 : steveklabnik/rust/guide_iterators, r=alexcrichton
bors [Mon, 15 Sep 2014 15:11:12 +0000 (15:11 +0000)]
auto merge of #16887 : steveklabnik/rust/guide_iterators, r=alexcrichton

This isn't ready to merge yet.

The 'containers and iterators' guide is basically just a collection of stuff that should be in the module definitions. So I'm moving the guide to just an 'iterators' guide, and moved the info that was there into the right places.

So, is this a good path forward, and is all of the information still correct?

9 years agoauto merge of #17200 : brson/rust/wintrip-w64, r=cmr
bors [Mon, 15 Sep 2014 12:56:13 +0000 (12:56 +0000)]
auto merge of #17200 : brson/rust/wintrip-w64, r=cmr

This updates our build system to prefer `i686-w64-mingw32` as the 32-bit windows triple instead of `i686-pc-mingw32`. This is an interim step to make the build artifacts consistent until https://github.com/rust-lang/rust/issues/15717 is done.

9 years agoauto merge of #17192 : skade/rust/fix-osx-linking, r=alexcrichton
bors [Mon, 15 Sep 2014 09:56:11 +0000 (09:56 +0000)]
auto merge of #17192 : skade/rust/fix-osx-linking, r=alexcrichton

Don't pass -fno-use-linker-plugin on OS X as clang does not accept it.

clang fails linking with:

```
error: linking with `cc` failed: exit code: 1
... arg list omitted...
note: clang: error: unknown argument: '-fno-use-linker-plugin' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
```

clang version:

```
$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix
```

9 years agoauto merge of #17256 : alexcrichton/rust/issue-17183, r=sfackler
bors [Mon, 15 Sep 2014 07:06:09 +0000 (07:06 +0000)]
auto merge of #17256 : alexcrichton/rust/issue-17183, r=sfackler

This file is touched during the build process and will trigger more rebuilds
than necessary.

Closes #17183

9 years agoOnly pass -fno-use-linker-plugin on Windows
Florian Gilcher [Fri, 12 Sep 2014 11:26:21 +0000 (13:26 +0200)]
Only pass -fno-use-linker-plugin on Windows

Only pass -fno-use-linker-plugin on Windows where it avoids pulling in
dependencies. Passing it to clang on OS X and Linux would make it fail
though.

9 years agoauto merge of #16853 : tbu-/rust/pr_mapinplace, r=aturon
bors [Mon, 15 Sep 2014 04:46:13 +0000 (04:46 +0000)]
auto merge of #16853 : tbu-/rust/pr_mapinplace, r=aturon

This is implemented using a new struct PartialVec which implements the proper
drop semantics in case the conversion is interrupted by an unwind.

For the old pull requests, see #15302, #16369.

9 years agoimpl ExactSize for vec::MoveItems
Alexis Beingessner [Mon, 15 Sep 2014 03:25:08 +0000 (23:25 -0400)]
impl ExactSize for vec::MoveItems

9 years agomk: Don't depend on src/jemalloc/VERSION
Alex Crichton [Sun, 14 Sep 2014 21:42:45 +0000 (14:42 -0700)]
mk: Don't depend on src/jemalloc/VERSION

This file is touched during the build process and will trigger more rebuilds
than necessary.

Closes #17183

9 years agoFixed `map_in_place` tests after rustc upgrade
Tobias Bucher [Sun, 14 Sep 2014 19:33:48 +0000 (21:33 +0200)]
Fixed `map_in_place` tests after rustc upgrade

This replaces the now obsolete syntax `&[]` with `[].as_slice()`.

9 years agoAdded missing `}` from `map_in_place` rebase
Tobias Bucher [Fri, 12 Sep 2014 23:38:16 +0000 (01:38 +0200)]
Added missing `}` from `map_in_place` rebase

9 years agoRemove the unused `Iterator` implementation of the private `PartialVec`
Tobias Bucher [Fri, 12 Sep 2014 18:18:26 +0000 (20:18 +0200)]
Remove the unused `Iterator` implementation of the private `PartialVec`

9 years agoMinimize the public interface and rename it to `map_in_place`
Tobias Bucher [Thu, 11 Sep 2014 00:04:51 +0000 (02:04 +0200)]
Minimize the public interface and rename it to `map_in_place`

9 years agoCheck that the `min_align_of` the both types in a `PartialVec` matches
Tobias Bucher [Fri, 8 Aug 2014 21:52:15 +0000 (23:52 +0200)]
Check that the `min_align_of` the both types in a `PartialVec` matches

This is important because the underlying allocator of the `Vec` passes that
information to the deallocator which needs the guarantee that it is the same
parameters that were also passed to the allocation function.

9 years agoFix some of the issues mentioned in the PR on Github
Tobias Bucher [Sun, 3 Aug 2014 12:16:10 +0000 (14:16 +0200)]
Fix some of the issues mentioned in the PR on Github

This specifically includes:
- Fix of the tests
- Remove `transmute` between `Vec`s of different types

9 years agoPartialVec: Remove TODOs and rename `unwrap` to `into_vec`
Tobias Bucher [Tue, 1 Jul 2014 22:17:28 +0000 (00:17 +0200)]
PartialVec: Remove TODOs and rename `unwrap` to `into_vec`

9 years agoAdd support for in-place map for `Vec`s of types with same size
Tobias Bucher [Tue, 1 Jul 2014 13:10:22 +0000 (15:10 +0200)]
Add support for in-place map for `Vec`s of types with same size

This is implemented using a new struct `PartialVec` which implements the proper
drop semantics in case the conversion is interrupted by an unwind.

9 years agoauto merge of #17196 : vhbit/rust/jemalloc-update, r=thestinger
bors [Sun, 14 Sep 2014 12:56:05 +0000 (12:56 +0000)]
auto merge of #17196 : vhbit/rust/jemalloc-update, r=thestinger

Fixes #17168

9 years agoauto merge of #17195 : tbu-/rust/pr_strfindoverflow2, r=alexcrichton
bors [Sun, 14 Sep 2014 10:36:08 +0000 (10:36 +0000)]
auto merge of #17195 : tbu-/rust/pr_strfindoverflow2, r=alexcrichton

9 years agoauto merge of #17163 : pcwalton/rust/impls-next-to-struct, r=alexcrichton
bors [Sun, 14 Sep 2014 08:11:04 +0000 (08:11 +0000)]
auto merge of #17163 : pcwalton/rust/impls-next-to-struct, r=alexcrichton

type they provide an implementation for.

This breaks code like:

    mod foo {
        struct Foo { ... }
    }

    impl foo::Foo {
        ...
    }

Change this code to:

    mod foo {
        struct Foo { ... }

        impl Foo {
            ...
        }
    }

Closes #17059.

RFC #155.

[breaking-change]

r? @brson

9 years agoauto merge of #17130 : jakub-/rust/issue-17033, r=pcwalton
bors [Sun, 14 Sep 2014 05:46:05 +0000 (05:46 +0000)]
auto merge of #17130 : jakub-/rust/issue-17033, r=pcwalton

Fixes #17033.
Fixes #15965.

cc @nikomatsakis

9 years agoauto merge of #13316 : eddyb/rust/ast-ptr, r=brson
bors [Sun, 14 Sep 2014 03:21:07 +0000 (03:21 +0000)]
auto merge of #13316 : eddyb/rust/ast-ptr, r=brson

Replaces Gc<T> in the AST with a custom owned smart pointer, P<T>. Fixes #7929.

## Benefits
* **Identity** (affinity?): sharing AST nodes is bad for the various analysis passes (e.g. one could bypass borrowck with a shared `ExprAddrOf` node taking a mutable borrow), the only reason we haven't hit any serious issues with it is because of inefficient folding passes which will always deduplicate any such shared nodes. Even if we were to switch to an arena, this would still hold, i.e. we wouldn't just use `&'a T` in the AST, but rather an wrapper (`P<'a, T>`?).

* **Immutability**: `P<T>` disallows mutating its inner `T` (unless that contains an `Unsafe` interior, which won't happen in the AST), unlike `~T`.

* **Efficiency**: folding can reuse allocation space for `P<T>` and `Vec<T>`, the latter even when the input and output types differ (as it would be the case with arenas or an AST with type parameters to toggle macro support). Also, various algorithms have been changed from copying `Gc<T>` to using `&T` and iterators.

* **Maintainability**: there is another reason I didn't just replace `Gc<T>` with `~T`: `P<T>` provides a fixed interface (`Deref`, `and_then` and `map`) which can remain fully functional even if the implementation changes (using a special thread-local heap, for example). Moreover, switching to, e.g. `P<'a, T>` (for a contextual arena) is easy and mostly automated.

9 years ago`rustc main.rs` generates main binary file
Santiago Pastorino [Sat, 13 Sep 2014 23:23:32 +0000 (20:23 -0300)]
`rustc main.rs` generates main binary file

9 years agoFix fallout in macro_crate/quote tests.
Eduard Burtescu [Thu, 11 Sep 2014 23:33:08 +0000 (02:33 +0300)]
Fix fallout in macro_crate/quote tests.

9 years agosyntax: document the ptr module.
Eduard Burtescu [Mon, 19 May 2014 21:12:17 +0000 (00:12 +0300)]
syntax: document the ptr module.

9 years agosyntax: implement in-place folding of P<T> and Vec<T>.
Eduard Burtescu [Mon, 19 May 2014 09:11:06 +0000 (12:11 +0300)]
syntax: implement in-place folding of P<T> and Vec<T>.

9 years agoregex_macros: fix fallout from using ptr::P.
Eduard Burtescu [Sun, 18 May 2014 20:17:59 +0000 (23:17 +0300)]
regex_macros: fix fallout from using ptr::P.

9 years agohexfloat: fix fallout from using ptr::P.
Eduard Burtescu [Tue, 8 Apr 2014 15:36:08 +0000 (18:36 +0300)]
hexfloat: fix fallout from using ptr::P.

9 years agofourcc: fix fallout from using ptr::P.
Eduard Burtescu [Tue, 8 Apr 2014 15:35:44 +0000 (18:35 +0300)]
fourcc: fix fallout from using ptr::P.

9 years agorustdoc: fix fallout from using ptr::P.
Eduard Burtescu [Sun, 18 May 2014 13:56:13 +0000 (16:56 +0300)]
rustdoc: fix fallout from using ptr::P.

9 years agorustc: fix fallout from using ptr::P.
Eduard Burtescu [Sun, 7 Sep 2014 17:09:06 +0000 (20:09 +0300)]
rustc: fix fallout from using ptr::P.

9 years agoauto merge of #17189 : bkoropoff/rust/extern-existing-crate, r=alexcrichton
bors [Sun, 14 Sep 2014 00:51:05 +0000 (00:51 +0000)]
auto merge of #17189 : bkoropoff/rust/extern-existing-crate, r=alexcrichton

When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`.

This fixes spurious "multiple crate version" warnings under the following scenario:

- The crate `foo`, is referenced multiple times
- `--extern foo=./path/to/libbar.rlib` is specified to rustc
- The internal crate name of `libbar.rlib` is not `foo`

The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work.

Fixes #17186

9 years agosyntax: tests: fix fallout from using ptr::P.
Eduard Burtescu [Sat, 5 Apr 2014 13:24:28 +0000 (16:24 +0300)]
syntax: tests: fix fallout from using ptr::P.

9 years agosyntax: fix fallout from using ptr::P.
Eduard Burtescu [Sat, 13 Sep 2014 16:06:01 +0000 (19:06 +0300)]
syntax: fix fallout from using ptr::P.

9 years agosyntax: ast_map: use borrowed references into the AST.
Eduard Burtescu [Sat, 17 May 2014 23:38:13 +0000 (02:38 +0300)]
syntax: ast_map: use borrowed references into the AST.

9 years agosyntax: fold: use move semantics for efficient folding.
Eduard Burtescu [Sun, 7 Sep 2014 17:00:54 +0000 (20:00 +0300)]
syntax: fold: use move semantics for efficient folding.

9 years agosyntax: ast: replace Gc<T> (previously @T) with P<T>.
Eduard Burtescu [Sat, 17 May 2014 22:13:20 +0000 (01:13 +0300)]
syntax: ast: replace Gc<T> (previously @T) with P<T>.

9 years agosyntax: add a custom owned smart pointer in ptr::P.
Eduard Burtescu [Sat, 17 May 2014 21:46:40 +0000 (00:46 +0300)]
syntax: add a custom owned smart pointer in ptr::P.

9 years agoProperly implement Show for EnumSet
Steven Fackler [Sun, 14 Sep 2014 00:37:03 +0000 (17:37 -0700)]
Properly implement Show for EnumSet

9 years agoauto merge of #17188 : thestinger/rust/tvec, r=pcwalton
bors [Sat, 13 Sep 2014 20:36:02 +0000 (20:36 +0000)]
auto merge of #17188 : thestinger/rust/tvec, r=pcwalton

`Box<[T]>` is created by allocating `Box<[T, ..n]>` and coercing it so
this code path is never used. It's also broken because it clamps the
capacity of the memory allocations to 4 elements and that's incompatible
with sized deallocation. This dates back to when `~[T]` was a growable
vector type implemented as:

*{ { tydesc, ref_count, prev, next }, { length, capacity, data[] } }

Since even empty vectors had to allocate, it started off the capacity of
all vectors at 4 as a heuristic. It's not possible to grow `Box<[T]>`
and there is no need for a memory allocation when it's empty, so it
would be a terrible heuristic today even if it worked.

9 years agoRemove container guide.
Steve Klabnik [Mon, 8 Sep 2014 21:21:34 +0000 (17:21 -0400)]
Remove container guide.

This isn't really what guides are for, this information belongs in the
module-level docs.

Fixes #9314.

9 years agoMove info into individual modules.
Steve Klabnik [Sat, 30 Aug 2014 21:11:22 +0000 (17:11 -0400)]
Move info into individual modules.

9 years agoauto merge of #17161 : vadimcn/rust/fix-debuginfo, r=alexcrichton
bors [Sat, 13 Sep 2014 17:25:54 +0000 (17:25 +0000)]
auto merge of #17161 : vadimcn/rust/fix-debuginfo, r=alexcrichton

This PR fixes debuginfo tests on Windows.

9 years agoauto merge of #17187 : damag/rust/ffi-guide-fixes, r=alexcrichton
bors [Sat, 13 Sep 2014 13:50:57 +0000 (13:50 +0000)]
auto merge of #17187 : damag/rust/ffi-guide-fixes, r=alexcrichton

Updates the callbacks section to refer to the right function name and fixes a couple of minor whitespace issues in the examples.

9 years agoThese two lines are actually three.
Markus Unterwaditzer [Sat, 13 Sep 2014 13:16:59 +0000 (15:16 +0200)]
These two lines are actually three.

9 years agoauto merge of #17182 : luqmana/rust/rnp, r=alexcrichton
bors [Sat, 13 Sep 2014 11:25:59 +0000 (11:25 +0000)]
auto merge of #17182 : luqmana/rust/rnp, r=alexcrichton

Fixes #17120.

9 years agolibrustc: Forbid inherent implementations that aren't adjacent to the
Patrick Walton [Thu, 11 Sep 2014 05:26:41 +0000 (22:26 -0700)]
librustc: Forbid inherent implementations that aren't adjacent to the
type they provide an implementation for.

This breaks code like:

    mod foo {
        struct Foo { ... }
    }

    impl foo::Foo {
        ...
    }

Change this code to:

    mod foo {
        struct Foo { ... }

        impl Foo {
            ...
        }
    }

Additionally, if you used the I/O path extension methods `stat`,
`lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have
been moved to the the `std::io::fs::PathExtensions` trait. This breaks
code like:

    fn is_it_there() -> bool {
        Path::new("/foo/bar/baz").exists()
    }

Change this code to:

    use std::io::fs::PathExtensions;

    fn is_it_there() -> bool {
        Path::new("/foo/bar/baz").exists()
    }

Closes #17059.

RFC #155.

[breaking-change]

9 years agoauto merge of #17175 : pcwalton/rust/region-bounds-on-closures, r=huonw
bors [Sat, 13 Sep 2014 08:06:00 +0000 (08:06 +0000)]
auto merge of #17175 : pcwalton/rust/region-bounds-on-closures, r=huonw

This can break code like:

    fn call_rec(f: |uint| -> uint) -> uint {
        (|x| f(x))(call_rec(f))
    }

Change this code to use a temporary instead of violating the borrow
rules:

    fn call_rec(f: |uint| -> uint) -> uint {
        let tmp = call_rec(|x| f(x)); f(tmp)
    }

Closes #17144.

[breaking-change]

r? @huonw

9 years agoauto merge of #17162 : sfackler/rust/decorator-traits, r=huonw
bors [Sat, 13 Sep 2014 05:25:57 +0000 (05:25 +0000)]
auto merge of #17162 : sfackler/rust/decorator-traits, r=huonw

The other extension types already worked this way and it can be useful to track some state along with the extension.

I also removed the `BasicMacroExpander` and `BasicIdentMacroExpander` since the span inside of them was never used. The expander function types now directly implement the relevant trait.

9 years agoRemove unused, unsound method on StrInterner
Brian Koropoff [Sat, 13 Sep 2014 04:52:56 +0000 (21:52 -0700)]
Remove unused, unsound method on StrInterner

The string slices returned by `get_ref` can actually be
invalidated by calling `clear`.  Since this method is unused,
it is easiest to simply remove it.

Closes #17181

9 years agoAdd regression test for #17186
Brian Koropoff [Fri, 12 Sep 2014 15:38:45 +0000 (08:38 -0700)]
Add regression test for #17186

9 years agoauto merge of #17155 : steveklabnik/rust/dherman_fixes, r=brson
bors [Fri, 12 Sep 2014 23:30:54 +0000 (23:30 +0000)]
auto merge of #17155 : steveklabnik/rust/dherman_fixes, r=brson

Fixing more suggestions from @dherman . I made them individual commits in case we want to discuss any of them further.

9 years agoauto merge of #17134 : vberger/rust/lint_unused_extern_crate, r=alexcrichton
bors [Fri, 12 Sep 2014 19:05:53 +0000 (19:05 +0000)]
auto merge of #17134 : vberger/rust/lint_unused_extern_crate, r=alexcrichton

This PR creates a new lint : ``unused_extern_crate``, which do pretty much the same thing as ``unused_import``, but for ``extern crate`` statements. It is related to feature request #10385.

I adapted the code tracking used imports so that it tracks extern crates usage as well. This was mainly trial and error and while I believe all cases are covered, there might be some code I added that is useless (long compile times didn't give me the opportunity to check this in detail).

Also, I removed some unused ``extern crate`` statements from the libs, that where spotted by this new lint.

9 years agoAdd -C remark for LLVM optimization remarks
Keegan McAllister [Fri, 12 Sep 2014 15:17:58 +0000 (08:17 -0700)]
Add -C remark for LLVM optimization remarks

Fixes #17116.

9 years agoAdd a Rust string ostream for LLVM
Keegan McAllister [Wed, 10 Sep 2014 06:12:09 +0000 (23:12 -0700)]
Add a Rust string ostream for LLVM

9 years agoFix bad error message copypasta
Keegan McAllister [Fri, 12 Sep 2014 18:43:32 +0000 (11:43 -0700)]
Fix bad error message copypasta

9 years agoRemove build system support for i686-pc-mingw32 triple in favor if i686-w64-mingw32
Brian Anderson [Fri, 12 Sep 2014 01:12:59 +0000 (18:12 -0700)]
Remove build system support for i686-pc-mingw32 triple in favor if i686-w64-mingw32

9 years agoUpdated jemalloc
Valerii Hiora [Fri, 12 Sep 2014 14:25:44 +0000 (17:25 +0300)]
Updated jemalloc

9 years agoauto merge of #17069 : eddyb/rust/visitor, r=pnkfelix
bors [Fri, 12 Sep 2014 13:45:41 +0000 (13:45 +0000)]
auto merge of #17069 : eddyb/rust/visitor, r=pnkfelix

Few visitors used the context passing feature and it can be easily emulated.
The added lifetime threading allows a visitor to keep safe references to AST
nodes it visits, making a non-owning ast_map design possible, for #13316.

9 years agoDocument why `core::str::Searcher::new` doesn't overflow
Tobias Bucher [Fri, 12 Sep 2014 13:03:50 +0000 (15:03 +0200)]
Document why `core::str::Searcher::new` doesn't overflow

9 years agoTrack the visited AST's lifetime throughout Visitor.
Eduard Burtescu [Tue, 9 Sep 2014 22:54:36 +0000 (01:54 +0300)]
Track the visited AST's lifetime throughout Visitor.

9 years agoRemove largely unused context from Visitor.
Eduard Burtescu [Fri, 12 Sep 2014 10:10:30 +0000 (13:10 +0300)]
Remove largely unused context from Visitor.

9 years agoauto merge of #17159 : brson/rust/snaps, r=alexcrichton
bors [Fri, 12 Sep 2014 11:20:42 +0000 (11:20 +0000)]
auto merge of #17159 : brson/rust/snaps, r=alexcrichton

This switches win64 hosts to bootstrap from win64 snaps.

9 years agoRemoving unused extern crates.
Victor Berger [Fri, 12 Sep 2014 09:24:09 +0000 (11:24 +0200)]
Removing unused extern crates.

9 years agoNew lint : unused_extern_crate. #10385
Victor Berger [Thu, 11 Sep 2014 17:14:43 +0000 (19:14 +0200)]
New lint : unused_extern_crate. #10385

9 years agoauto merge of #17145 : ahmedcharles/rust/unicode, r=alexcrichton
bors [Fri, 12 Sep 2014 08:05:42 +0000 (08:05 +0000)]
auto merge of #17145 : ahmedcharles/rust/unicode, r=alexcrichton

9 years agoremove dead and broken tvec ~[T] code path
Daniel Micay [Fri, 12 Sep 2014 07:08:48 +0000 (03:08 -0400)]
remove dead and broken tvec ~[T] code path

`Box<[T]>` is created by allocating `Box<[T, ..n]>` and coercing it so
this code path is never used. It's also broken because it clamps the
capacity of the memory allocations to 4 elements and that's incompatible
with sized deallocation. This dates back to when `~[T]` was a growable
vector type implemented as:

*{ { tydesc, ref_count, prev, next }, { length, capacity, data[] } }

Since even empty vectors had to allocate, it started off the capacity of
all vectors at 4 as a heuristic. It's not possible to grow `Box<[T]>`
and there is no need for a memory allocation when it's empty, so it
would be a terrible heuristic today even if it worked.

9 years agoUse a space after colons per the Rust coding style:
Damien Grassart [Fri, 12 Sep 2014 07:10:03 +0000 (09:10 +0200)]
Use a space after colons per the Rust coding style:
https://github.com/rust-lang/rust-guidelines/blob/master/style/whitespace.md

9 years agoThe example code uses trigger_callback(), not do_callback().
Damien Grassart [Fri, 12 Sep 2014 07:03:15 +0000 (09:03 +0200)]
The example code uses trigger_callback(), not do_callback().

9 years agoFix check for existing crate when using --extern
Brian Koropoff [Fri, 12 Sep 2014 05:50:40 +0000 (22:50 -0700)]
Fix check for existing crate when using --extern

When checking for an existing crate, compare against the
`crate_metadata::name` field, which is the crate name which
was requested during resolution, rather than the result of the
`crate_metadata::name()` method, which is the crate name within
the crate metadata, as these may not match when using the --extern
option to `rustc`.

This fixes spurious "multiple crate version" warnings under the
following scenario:

- The crate `foo`, is referenced multiple times
- `--extern foo=./path/to/libbar.rlib` is specified to rustc
- The internal crate name of `libbar.rlib` is not `foo`

The behavior surrounding `Context::should_match_name` and the
comments in `loader.rs` both lead me to believe that this scenario
is intended to work.

Fixes #17186

9 years agoMake debug message about resolving `extern crate` statements more helpful
Brian Koropoff [Fri, 12 Sep 2014 05:49:41 +0000 (22:49 -0700)]
Make debug message about resolving `extern crate` statements more helpful