Commit Graph

32445 Commits

Author SHA1 Message Date
bors
e73156fe32 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.
2014-09-15 12:56:13 +00:00
bors
1f5ee97184 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
```
2014-09-15 09:56:11 +00:00
bors
3e7e2af472 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
2014-09-15 07:06:09 +00:00
Florian Gilcher
e9c4efb1bf 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.
2014-09-15 07:12:52 +02:00
bors
e4771d142b 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.
2014-09-15 04:46:13 +00:00
Brian Koropoff
0818955905 Add regression test for issue #17252 2014-09-14 20:58:34 -07:00
Brian Koropoff
83b7cb7ceb Separate static item recursion check into its own pass
This new pass is run before type checking so that recursive items
are detected beforehand.  This prevents going into an infinite
recursion during type checking when a recursive item is used in
an array type.

As a bonus, use `span_err` instead of `span_fatal` so multiple
errors can be reported.

Closes issue #17252
2014-09-14 20:56:07 -07:00
Alexis Beingessner
975569b380 impl ExactSize for vec::MoveItems 2014-09-14 23:25:08 -04:00
Alex Crichton
134c1e954e 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
2014-09-14 14:42:45 -07:00
Tobias Bucher
2c7f6eee0c Fixed map_in_place tests after rustc upgrade
This replaces the now obsolete syntax `&[]` with `[].as_slice()`.
2014-09-14 21:35:49 +02:00
Tobias Bucher
7ccab3ae8a Added missing } from map_in_place rebase 2014-09-14 21:35:49 +02:00
Tobias Bucher
79427f0bc0 Remove the unused Iterator implementation of the private PartialVec 2014-09-14 21:35:49 +02:00
Tobias Bucher
b7e0969a49 Minimize the public interface and rename it to map_in_place 2014-09-14 21:35:48 +02:00
Tobias Bucher
5efa232160 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.
2014-09-14 21:35:48 +02:00
Tobias Bucher
23f2c78d21 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
2014-09-14 21:35:48 +02:00
Tobias Bucher
af293372e4 PartialVec: Remove TODOs and rename unwrap to into_vec 2014-09-14 21:35:48 +02:00
Tobias Bucher
dbc3cb3a54 Add support for in-place map for Vecs 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.
2014-09-14 21:35:48 +02:00
Felix Raimundo
06e85fd1e2 inlines contains in bitflags!
Closes #17210
2014-09-14 20:07:45 +02:00
bors
793a36617b auto merge of #17196 : vhbit/rust/jemalloc-update, r=thestinger
Fixes #17168
2014-09-14 12:56:05 +00:00
bors
21d1f4d7c0 auto merge of #17195 : tbu-/rust/pr_strfindoverflow2, r=alexcrichton 2014-09-14 10:36:08 +00:00
bors
13037a3727 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
2014-09-14 08:11:04 +00:00
bors
0f99abae9c auto merge of #17130 : jakub-/rust/issue-17033, r=pcwalton
Fixes #17033.
Fixes #15965.

cc @nikomatsakis
2014-09-14 05:46:05 +00:00
bors
19311b6103 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.
2014-09-14 03:21:07 +00:00
Huon Wilson
0deb77d382 Display the doc-block toggle on everything again.
This needs a clone otherwise each successive insertion detaches `toggle`
from the previous position.

Fixes #17125.
2014-09-14 12:07:48 +10:00
Brian Koropoff
f1c4e476e9 Add regression test for issue #17216 2014-09-13 18:26:51 -07:00
Santiago Pastorino
f8bbf6d0e1 rustc main.rs generates main binary file 2014-09-13 22:25:38 -03:00
Eduard Burtescu
8577343f9e Fix fallout in macro_crate/quote tests. 2014-09-14 04:20:36 +03:00
Eduard Burtescu
5b2837b918 syntax: document the ptr module. 2014-09-14 04:20:36 +03:00
Eduard Burtescu
f8df4fadc8 syntax: implement in-place folding of P<T> and Vec<T>. 2014-09-14 04:20:35 +03:00
Eduard Burtescu
946bb4b10b regex_macros: fix fallout from using ptr::P. 2014-09-14 04:20:35 +03:00
Eduard Burtescu
2094514049 hexfloat: fix fallout from using ptr::P. 2014-09-14 04:20:35 +03:00
Eduard Burtescu
9651d94a56 fourcc: fix fallout from using ptr::P. 2014-09-14 04:20:35 +03:00
Eduard Burtescu
9295454ff5 rustdoc: fix fallout from using ptr::P. 2014-09-14 04:20:34 +03:00
Eduard Burtescu
b06212864f rustc: fix fallout from using ptr::P. 2014-09-14 04:20:34 +03:00
bors
931b11549f 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
2014-09-14 00:51:05 +00:00
Eduard Burtescu
d379ad111c syntax: tests: fix fallout from using ptr::P. 2014-09-14 03:39:36 +03:00
Eduard Burtescu
ccd8498afb syntax: fix fallout from using ptr::P. 2014-09-14 03:39:36 +03:00
Eduard Burtescu
d6fb338d01 syntax: ast_map: use borrowed references into the AST. 2014-09-14 03:39:36 +03:00
Eduard Burtescu
9259b022f8 syntax: fold: use move semantics for efficient folding. 2014-09-14 03:39:35 +03:00
Eduard Burtescu
cccb6f84a3 syntax: ast: replace Gc<T> (previously @T) with P<T>. 2014-09-14 03:39:35 +03:00
Eduard Burtescu
1872c4c6b5 syntax: add a custom owned smart pointer in ptr::P. 2014-09-14 03:39:35 +03:00
Steven Fackler
0e8cc52311 Properly implement Show for EnumSet 2014-09-13 17:37:03 -07:00
Brian Koropoff
5857ec6d78 Fix issue #17216
The cleanup scope of for loop bindings should translated when
popped to ensure resources are not leaked.
2014-09-13 15:35:21 -07:00
bors
79a5448f41 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.
2014-09-13 20:36:02 +00:00
Steve Klabnik
1b818020a0 Remove container guide.
This isn't really what guides are for, this information belongs in the
module-level docs.

Fixes #9314.
2014-09-13 15:06:00 -04:00
Steve Klabnik
84030fd05a Move info into individual modules. 2014-09-13 15:05:56 -04:00
bors
7277fe9ee7 auto merge of #17161 : vadimcn/rust/fix-debuginfo, r=alexcrichton
This PR fixes debuginfo tests on Windows.
2014-09-13 17:25:54 +00:00
bors
079951ed2a 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.
2014-09-13 13:50:57 +00:00
Markus Unterwaditzer
d36ac4def5 These two lines are actually three. 2014-09-13 15:16:59 +02:00
bors
13475a0851 auto merge of #17182 : luqmana/rust/rnp, r=alexcrichton
Fixes #17120.
2014-09-13 11:25:59 +00:00