Commit Graph

32217 Commits

Author SHA1 Message Date
Steve Klabnik
84030fd05a Move info into individual modules. 2014-09-13 15:05:56 -04:00
bors
90304ed266 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
2014-09-13 08:06:00 +00:00
bors
a9cf19889a 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.
2014-09-13 05:25:57 +00:00
bors
ccae356ace 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.
2014-09-12 23:30:54 +00:00
bors
8780d9c6b5 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.
2014-09-12 19:05:53 +00:00
bors
9c68679f2e 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.
2014-09-12 13:45:41 +00:00
Eduard Burtescu
7ef6ff0669 Track the visited AST's lifetime throughout Visitor. 2014-09-12 14:24:45 +03:00
Eduard Burtescu
a09dbf28e6 Remove largely unused context from Visitor. 2014-09-12 14:24:45 +03:00
bors
e9278c9219 auto merge of #17159 : brson/rust/snaps, r=alexcrichton
This switches win64 hosts to bootstrap from win64 snaps.
2014-09-12 11:20:42 +00:00
Victor Berger
8e61612889 Removing unused extern crates. 2014-09-12 11:24:31 +02:00
Victor Berger
9f8ec427e5 New lint : unused_extern_crate. #10385 2014-09-12 11:24:31 +02:00
bors
22e749ded1 auto merge of #17145 : ahmedcharles/rust/unicode, r=alexcrichton 2014-09-12 08:05:42 +00:00
bors
805cf81b77 auto merge of #17112 : nick29581/rust/unsized-fields, r=nikomatsakis
closes #16977 

r? @nikomatsakis
2014-09-12 03:35:38 +00:00
bors
4727381685 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.
2014-09-12 01:15:41 +00:00
Ahmed Charles
5b3c3511c9 Fix bug in padding unicode, #17105. 2014-09-11 17:40:46 -07:00
bors
06c0b1d28a 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
2014-09-11 21:55:42 +00:00
Nick Cameron
4028ebc603 Handle always-unsized structs
closes #16977
2014-09-12 09:16:05 +12:00
Steve Klabnik
c456cca90a only deprecate the guide rather than 🔥 🔥 🔥 2014-09-11 16:21:32 -04:00
Steve Klabnik
a99ba25f2b 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.
2014-09-11 16:21:32 -04:00
Patrick Walton
a9b929dbb6 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]
2014-09-11 12:00:56 -07:00
bors
d24c82420b auto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw
fixes #17148
2014-09-11 18:50:41 +00:00
Vadim Chugunov
7085b3edd9 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/
2014-09-11 09:40:21 -07:00
Vadim Chugunov
0ac9e9b561 Update license notice. 2014-09-11 09:40:20 -07:00
Vadim Chugunov
c05ba8a298 Append target-specific tools directory ($(RUST)/bin/rustlib/<triple>/bin/) to PATH during linking,
so that rustc can invoke them.
2014-09-11 09:40:20 -07:00
bors
1dc31953e7 auto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler
whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273
2014-09-11 15:50:45 +00:00
bors
c8b0d667c3 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
2014-09-11 12:20:43 +00:00
bors
29f817fa22 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.
2014-09-11 07:15:46 +00:00
bors
1f4117f518 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
2014-09-11 04:55:41 +00:00
Vadim Chugunov
76c02af434 Remove dependency on GCC's LTO linker plugin, since Rust does its' own LTO. 2014-09-10 21:20:59 -07:00
Steven Fackler
200a08fc21 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]
2014-09-10 21:02:39 -07:00
bors
7ea660e678 auto merge of #17142 : sfackler/rust/issue-17115, r=alexcrichton
Closes #17115
2014-09-11 02:35:38 +00:00
Brian Anderson
38e7e4bd9c Register snapshots 2014-09-10 18:33:54 -07:00
bors
09abbbdafc 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.
2014-09-11 00:05:41 +00:00
Steve Klabnik
c3943b3c89 don't say 'semantic' 2014-09-10 18:30:28 -04:00
Steve Klabnik
8f7470d864 remove rich hickey love 2014-09-10 18:29:58 -04:00
Steve Klabnik
311227003f 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.
2014-09-10 18:28:37 -04:00
Steve Klabnik
9c8c82b87d hello_world.rs -> main.rs 2014-09-10 18:26:17 -04:00
Steve Klabnik
b85191ae0f dave hates jokes 😉 2014-09-10 18:24:40 -04:00
Steve Klabnik
faf14ae633 Fix vector terminology in the manual.
fixes #17148
2014-09-10 17:02:37 -04:00
Steve Klabnik
60415e1032 reintroduce manual link in doc index
whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273
2014-09-10 16:57:07 -04:00
bors
9f6d27c39f auto merge of #17135 : brson/rust/wininst, r=alexcrichton
This builds on https://github.com/rust-lang/rust/pull/17109, putting the target triple into the installer name so that we can have both 32-bit and 64-bit.

The resulting installers will be called `rust-0.12.0-pre-x86_64-w64-mingw32.exe`, etc.
2014-09-10 19:25:36 +00:00
bors
716db009b4 auto merge of #16680 : brson/rust/readme, r=steveklabnik
This adds links to SO, reddit, and discuss to the README. The main intent is to start advertising discuss.rust-lang.org more, in a location that doesn't mislead casual users to it (people who are building Rust are more likely to be the right audience than those that are just visiting the web site).
2014-09-10 16:45:37 +00:00
Steven Fackler
313cb8acae Change ItemModifier and ItemDecorator to traits
For convenience, the traits are implemented for the respective bare
functions. Change code from this:

```rust
ItemDecorator(some_function)
// or
ItemModifier(some_other_function)
```
to
```rust
ItemDecorator(box some_function)
// or
ItemModifier(box some_other_function)
```

[breaking-change]
2014-09-10 09:15:13 -07:00
bors
6faa4f33a4 auto merge of #17129 : epdtry/rust/misc/llvm-root-reconfig, r=brson
Currently `./configure --llvm-root=...` and similar flags will break incremental builds by forcing reconfiguration on every `make`.  This happens because `reconfig.mk` incorrectly treats submodules in the `-` (uninitialized) state as requiring reconfiguration, and `./configure` deliberately deinitializes unneeded submodules.  The fix is to reconfigure only when submodules are in the `+` state (wrong commit checked out).
2014-09-10 14:20:37 +00:00
bors
4049a4da79 auto merge of #17109 : brson/rust/win64snap, r=alexcrichton 2014-09-10 11:45:44 +00:00
bors
8eee1b44b0 auto merge of #17095 : thestinger/rust/alloc, r=alexcrichton
Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092
2014-09-10 09:20:39 +00:00
Daniel Micay
72a92b2e14 implement sized deallocation
Closes #13994
2014-09-10 03:50:43 -04:00
Daniel Micay
92b09261e7 micro-optimize dynamic allocation alignment
Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092
2014-09-10 03:50:39 -04:00
bors
370f8df2ae auto merge of #17108 : steveklabnik/rust/explicitness, r=alexcrichton
I missed some annotations, and some were in a different style.
2014-09-10 07:35:41 +00:00
Steven Fackler
b865c1f28c Don't ICE on macros with -Z show-span
Closes #17115
2014-09-09 22:39:13 -07:00