]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoFix two typos
Martin Olsson [Sun, 7 Sep 2014 19:47:55 +0000 (21:47 +0200)]
Fix two typos

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 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 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 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 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 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 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

9 years agoauto merge of #17112 : nick29581/rust/unsized-fields, r=nikomatsakis
bors [Fri, 12 Sep 2014 03:35:38 +0000 (03:35 +0000)]
auto merge of #17112 : nick29581/rust/unsized-fields, r=nikomatsakis

closes #16977

r? @nikomatsakis

9 years agolibrustc: Enum nullable pointer opt should not apply to raw pointers.
Luqman Aden [Fri, 12 Sep 2014 01:58:01 +0000 (21:58 -0400)]
librustc: Enum nullable pointer opt should not apply to raw pointers.

9 years agoauto merge of #16657 : steveklabnik/rust/goodbye_tutorial, r=brson
bors [Fri, 12 Sep 2014 01:15:41 +0000 (01:15 +0000)]
auto merge of #16657 : steveklabnik/rust/goodbye_tutorial, r=brson

The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.

9 years agomk: Fix defs for i686-w64-mingw32
Brian Anderson [Fri, 12 Sep 2014 01:01:07 +0000 (18:01 -0700)]
mk: Fix defs for i686-w64-mingw32

9 years agoFix bug in padding unicode, #17105.
Ahmed Charles [Fri, 12 Sep 2014 00:39:57 +0000 (17:39 -0700)]
Fix bug in padding unicode, #17105.

9 years agoauto merge of #16957 : vadimcn/rust/package-gcc, r=brson
bors [Thu, 11 Sep 2014 21:55:42 +0000 (21:55 +0000)]
auto merge of #16957 : vadimcn/rust/package-gcc, r=brson

Package rustc's mingw dependencies into Windows installer to avoid requiring a separate mingw install.

Closes #11782

9 years agoHandle always-unsized structs
Nick Cameron [Tue, 9 Sep 2014 04:54:13 +0000 (16:54 +1200)]
Handle always-unsized structs

closes #16977

9 years agoonly deprecate the guide rather than :fire: :fire: :fire:
Steve Klabnik [Thu, 21 Aug 2014 21:43:48 +0000 (17:43 -0400)]
only deprecate the guide rather than :fire: :fire: :fire:

9 years agoReplace the Tutorial with the Guide.
Steve Klabnik [Thu, 21 Aug 2014 21:20:33 +0000 (17:20 -0400)]
Replace the Tutorial with the Guide.

The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.

9 years agolibrustc: Make sure region bounds on closures outlive calls to them.
Patrick Walton [Thu, 11 Sep 2014 18:59:05 +0000 (11:59 -0700)]
librustc: Make sure region bounds on closures outlive calls to them.

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]

9 years agoauto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw
bors [Thu, 11 Sep 2014 18:50:41 +0000 (18:50 +0000)]
auto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw

fixes #17148

9 years agoPackage rustc's mingw dependencies into Windows installer.
Vadim Chugunov [Tue, 2 Sep 2014 08:56:54 +0000 (01:56 -0700)]
Package rustc's mingw dependencies into Windows installer.
gcc, ld, ar, dlltool, windres go into $(RUST)/bin/rustlib/<triple>/bin/
platform libraries and startup objects got into $(RUST)/bin/rustlib/<triple>/lib/

9 years agoUpdate license notice.
Vadim Chugunov [Thu, 11 Sep 2014 04:32:36 +0000 (21:32 -0700)]
Update license notice.

9 years agoAppend target-specific tools directory ($(RUST)/bin/rustlib/<triple>/bin/) to PATH...
Vadim Chugunov [Wed, 3 Sep 2014 07:46:23 +0000 (00:46 -0700)]
Append target-specific tools directory ($(RUST)/bin/rustlib/<triple>/bin/) to PATH during linking,
so that rustc can invoke them.

9 years agoauto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler
bors [Thu, 11 Sep 2014 15:50:45 +0000 (15:50 +0000)]
auto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler

whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273

9 years agoauto merge of #17157 : nikomatsakis/rust/occurs-check, r=pcwalton
bors [Thu, 11 Sep 2014 12:20:43 +0000 (12:20 +0000)]
auto merge of #17157 : nikomatsakis/rust/occurs-check, r=pcwalton

Avoid ever constructing cyclic types in the first place, rather than detecting them in resolve. This simplifies logic elsewhere in the compiler, in particular on the trait reform branch.

r? @pnkfelix or @pcwalton

cc #5527

9 years agoauto merge of #17139 : brson/rust/lualatex, r=alexcrichton
bors [Thu, 11 Sep 2014 07:15:46 +0000 (07:15 +0000)]
auto merge of #17139 : brson/rust/lualatex, r=alexcrichton

Bugs in pdflatex (#12804) are preventing the guide from landing (https://github.com/rust-lang/rust/pull/16657). This solves the immediate problem by changing the build system to prefer lualatex, xelatex to pdflatex (which is apparently obsolete). Because the xelatex on the snapshot bot seems to completely ignore the `-output-directory` option, I also had to frob the makefiles a bit for that case.

9 years agoauto merge of #17110 : thestinger/rust/dst, r=cmr
bors [Thu, 11 Sep 2014 04:55:41 +0000 (04:55 +0000)]
auto merge of #17110 : thestinger/rust/dst, r=cmr

The pointer in the slice must not be null, because enum representations
make that assumption. The `exchange_malloc` function returns a non-null
sentinel for the zero size case, and it must not be passed to the
`exchange_free` lang item.

Since the length is always equal to the true capacity, a branch on the
length is enough for most types. Slices of zero size types are
statically special cased to never attempt deallocation. This is the same
implementation as `Vec<T>`.

Closes #14395

9 years agoRemove dependency on GCC's LTO linker plugin, since Rust does its' own LTO.
Vadim Chugunov [Wed, 3 Sep 2014 07:41:53 +0000 (00:41 -0700)]
Remove dependency on GCC's LTO linker plugin, since Rust does its' own LTO.

9 years agoRemove BasicMacroExpander and BasicIdentMacroExpander
Steven Fackler [Thu, 11 Sep 2014 03:59:26 +0000 (20:59 -0700)]
Remove BasicMacroExpander and BasicIdentMacroExpander

The spans inside of these types were always None and never used. Pass
the expander function directly instead of wrapping it in one of these
types.

[breaking-change]

9 years agoauto merge of #17142 : sfackler/rust/issue-17115, r=alexcrichton
bors [Thu, 11 Sep 2014 02:35:38 +0000 (02:35 +0000)]
auto merge of #17142 : sfackler/rust/issue-17115, r=alexcrichton

Closes #17115

9 years agoRegister snapshots
Brian Anderson [Wed, 10 Sep 2014 22:31:30 +0000 (15:31 -0700)]
Register snapshots

9 years agoFix #17156
Vadim Chugunov [Wed, 10 Sep 2014 23:50:24 +0000 (16:50 -0700)]
Fix #17156

9 years agoauto merge of #16866 : P1start/rust/tuple-indexing, r=brson
bors [Thu, 11 Sep 2014 00:05:41 +0000 (00:05 +0000)]
auto merge of #16866 : P1start/rust/tuple-indexing, r=brson

This allows code to access the fields of tuples and tuple structs behind the feature gate `tuple_indexing`:

```rust
#![feature(tuple_indexing)]

let x = (1i, 2i);
assert_eq!(x.1, 2);

struct Point(int, int);
let origin = Point(0, 0);
assert_eq!(origin.0, 0);
assert_eq!(origin.1, 0);
```

Implements [RFC 53](https://github.com/rust-lang/rfcs/blob/master/active/0053-tuple-accessors.md). Closes #16950.

9 years agoUse DWARF4 on Windows.
Vadim Chugunov [Sun, 7 Sep 2014 20:19:55 +0000 (13:19 -0700)]
Use DWARF4 on Windows.

9 years agoEscape backslashes in debugger scripts.
Vadim Chugunov [Sun, 7 Sep 2014 20:19:33 +0000 (13:19 -0700)]
Escape backslashes in debugger scripts.

9 years agoDisable ASLR on Windows, for now.
Vadim Chugunov [Tue, 9 Sep 2014 01:00:54 +0000 (18:00 -0700)]
Disable ASLR on Windows, for now.

9 years agodon't say 'semantic'
Steve Klabnik [Wed, 10 Sep 2014 22:30:28 +0000 (18:30 -0400)]
don't say 'semantic'

9 years agoremove rich hickey love
Steve Klabnik [Wed, 10 Sep 2014 22:29:58 +0000 (18:29 -0400)]
remove rich hickey love

9 years agoRemove much of the modules section.
Steve Klabnik [Wed, 10 Sep 2014 22:28:37 +0000 (18:28 -0400)]
Remove much of the modules section.

This part can get _really_ confusing, and we want to make sure that
people succeed in the guide. I plan on making a module guide in the
future to replace the information here.

9 years agohello_world.rs -> main.rs
Steve Klabnik [Wed, 10 Sep 2014 22:26:17 +0000 (18:26 -0400)]
hello_world.rs -> main.rs