Commit Graph

3525 Commits

Author SHA1 Message Date
Alex Crichton
11dcd9a097 Don't run 'ar s' on OSX
Apparently this isn't necessary, and it's just causing problems.

Closes #11162
2014-01-16 12:18:22 -08:00
Niko Matsakis
14b0abfd82 Consider all zero-sized data structures to be voidish, bypassing some "quirky" parts of LLVM (see e.g. LLVM bug 9900) but also generating better code 2014-01-16 15:11:22 -05:00
bors
6708558c34 auto merge of #11548 : bjz/rust/bitwise, r=alexcrichton
One less trait in `std::num` and three less exported in the prelude.

cc. #10387
2014-01-15 20:36:48 -08:00
bors
bf2ab22cd0 auto merge of #11574 : neeee/rust/master, r=alexcrichton
Reverted according to https://github.com/mozilla/rust/issues/11458#issuecomment-32269477. Fixes #11458.
2014-01-15 19:06:45 -08:00
Niko Matsakis
84f33fb134 Cleanup trait callees 2014-01-15 20:31:20 -05:00
Brendan Zabarauskas
1dd6906db2 Merge Bitwise and BitCount traits and remove from prelude, along with Bounded
One less trait in std::num, and three less exported in the prelude.
2014-01-16 11:51:33 +11:00
Niko Matsakis
6badef49fe Remove FIXMEs and add license 2014-01-15 19:44:38 -05:00
Niko Matsakis
e71571a3cd Use as_slice() method on option 2014-01-15 19:35:38 -05:00
Niko Matsakis
419ac4a1b8 Issue #3511 - Rationalize temporary lifetimes.
Major changes:

- Define temporary scopes in a syntax-based way that basically defaults
  to the innermost statement or conditional block, except for in
  a `let` initializer, where we default to the innermost block. Rules
  are documented in the code, but not in the manual (yet).
  See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
  us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
  cleanup in a more comprehensive way.
2014-01-15 18:34:38 -05:00
lucy
3b32ea8c93 Revert "show options for -W help and -W". Fixes #11458.
This reverts commit 1009c21ad7.
2014-01-15 18:38:10 +01:00
Alex Crichton
7a37294acc Add a configure to disable libstd version injection
We'll use this when building snapshots so we can upgrade freely, but all
compilers will inject a version by default.
2014-01-15 08:22:16 -08:00
bors
29070c3bee auto merge of #11535 : thestinger/rust/header, r=alexcrichton
Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
 has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
2014-01-14 23:01:51 -08:00
Daniel Micay
6809b172e0 remove borrow_offset as ~ is now free of headers 2014-01-14 22:01:44 -05:00
Daniel Micay
0e885e42b1 remove reference counting headers from ~
Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.

This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
has been left out.

The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.

Closes #9510
Closes #11533
2014-01-14 22:01:40 -05:00
bors
dd8b011319 auto merge of #11521 : dguenther/rust/hide_libdir_relative, r=alexcrichton
Renamed `LIBDIR_RELATIVE` to `CFG_LIBDIR_RELATIVE`. It's not a configurable variable, but it looks out of place without the `CFG_` prefix.

Fixes #11420
2014-01-14 15:11:30 -08:00
Derek Guenther
a599d897fc Renamed LIBDIR_RELATIVE to CFG_LIBDIR_RELATIVE 2014-01-14 15:52:57 -06:00
bors
faa0b5aa61 auto merge of #11538 : eddyb/rust/llvm-attributes, r=alexcrichton 2014-01-14 13:51:34 -08:00
bors
9075025c7b auto merge of #11485 : eddyb/rust/sweep-old-rust, r=nikomatsakis 2014-01-14 12:32:11 -08:00
Eduard Burtescu
8e2027a082 Add noalias and noreturn attributes in more cases. 2014-01-14 19:17:38 +02:00
Luqman Aden
d42e75883b librustc: Don't translate an expr twice when implicitly coercing to a trait object. Fixes #11197. 2014-01-13 20:52:44 -05:00
Luqman Aden
17f984c54b librustc: Don't allow use after move of implicitly coerced object. Fixes #11481. 2014-01-13 20:51:49 -05:00
Patrick Walton
119c6141f5 librustc: Remove @ pointer patterns from the language 2014-01-13 14:45:21 -08:00
bors
b8c60f906b auto merge of #11482 : fhahn/rust/issue-8005-better-error-msg-semi-last-stmt, r=alexcrichton
This is a patch for #8005, thanks @lfairy for the hint.

It seems like `block.expr` is None, if the last line of a function has a semi colon (= it ends with a statement).

@kmcallister does this error message cover the intended use cases? 
I'm not sure about the message, the wording and the span could probably be improved.
2014-01-13 11:06:41 -08:00
Florian Hahn
c74c854adc Better error message for semicolon on the last line of a function
closes #8005
2014-01-13 19:45:34 +01:00
Huon Wilson
e25d7069b5 rustc: make error messages containing generic more self-explanatory.
Unsuffixed literals like 1 and 1.1, and free type parameters sometimes
have to be printed in error messages, which ended up with <V0>, <VI0>
and <VF0>. This change puts the words "generic" and "integer"/"float"
into the message so it's not a completely black box.
2014-01-13 22:34:50 +11:00
Brian Anderson
46905c04f5 Bump version to 0.10-pre 2014-01-12 17:45:22 -08:00
Kiet Tran
deb3ca53a8 Mark allowed dead code and lang items as live
Dead code pass now explicitly checks for `#[allow(dead_code)]` and
`#[lang=".."]` attributes on items and marks them as live if they have
those attributes. The former is done so that if we want to suppress
warnings for a group of dead functions, we only have to annotate the
"root" of the call chain.
2014-01-12 13:54:36 -05:00
bors
1fda761e9c auto merge of #11495 : kud1ing/rust/backticks, r=huonw 2014-01-12 02:56:28 -08:00
kud1ing
871ffd1c05 more backticks 2014-01-12 10:35:10 +01:00
Eduard Burtescu
509fc92a9b Removed remnants of @mut and ~mut from comments and the type system. 2014-01-12 02:26:04 +02:00
Eduard Burtescu
08ac616d37 Use the right type for self in methods and remove obsoleted items.
Fixes #7411, #10615.
2014-01-11 16:40:23 +02:00
Eduard Burtescu
7a305f9e83 Removed free_glue from tydesc (the code is still generated, but inlined in drop_glue). 2014-01-11 16:40:23 +02:00
Eduard Burtescu
5ad2a7825b Removed obsolete 'e' prefix on ty_evec and ty_estr. 2014-01-11 16:40:23 +02:00
bors
f0541d5e94 auto merge of #11465 : pcwalton/rust/borrow-check-bug, r=pcwalton
it. r=nikomatsakis
2014-01-11 00:01:31 -08:00
Patrick Walton
c2e6673a6b librustc: Check restrictions on all subcomponents of a path when moving
it. r=nikomatsakis
2014-01-10 19:01:51 -08:00
bors
a34727f276 auto merge of #11416 : bjz/rust/remove-print-fns, r=alexcrichton
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-10 18:21:21 -08:00
Brendan Zabarauskas
4fc0452ace Remove re-exports of std::io::stdio::{print, println} in the prelude.
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-11 10:46:00 +11:00
bors
33e8663391 auto merge of #11449 : rcatolino/rust/assign-binop-handling, r=alexcrichton
So far the following code
```
struct Foo;

fn main() {
  let mut t = Foo;
  let ref b = Foo;
  a += *b;
}
```
errors with 
```
test.rs:15:3: 13:11 error: binary operation + cannot be applied to type `Foo`
test.rs:15   *a += *b;
```
Since assignment-operators are no longer expanded to ```left = left OP right``` but are independents operators it should be 
```
test.rs:15:3: 13:11 error: binary operation += cannot be applied to type `Foo`
test.rs:15   *a += *b;
```
to make it clear that implementing Add for Foo is not gonna work. (cf issues #11143, #11344)

Besides that, we also need to typecheck the rhs expression even if the operator has no implementation, or we end up with unknown types for the nodes of the rhs and an ICE later on while resolving types. (once again cf #11143 and #11344).

This probably would get fixed with #5992, but in the meantime it's a confusing error to stumble upon.
@pcwalton, you wrote the original code, what do you think?
(closes #11143 and #11344)
2014-01-10 11:51:21 -08:00
Raphael Catolino
02d86216f3 Improve invalid operator assignment handling. 2014-01-10 20:46:20 +01:00
bors
423dd84300 auto merge of #11441 : jld/rust/enum-nullable-const-null-with-fields, r=alexcrichton
That is, if you have an enum type that is subject to the nullable
pointer optimization, but the null variant has a nonzero number of
fields, and you declare a static whose value is of that variant, then
that used to be an ICE but this change fixes it.
2014-01-10 03:11:17 -08:00
Jed Davis
5487f15bbf Fix ICE on const of nullable enum with fields in null case.
That is, if you have an enum type that is subject to the nullable
pointer optimization, but the null variant has a nonzero number of
fields, and you declare a static whose value is of that variant, then
that used to be an ICE but this change fixes it.
2014-01-09 22:24:31 -08:00
Brian Anderson
55f81bce83 rustc: Fix style of Lint enum 2014-01-09 18:46:23 -08:00
Brian Anderson
520c82e0e9 rustc: Fix style of OutputType enum 2014-01-09 18:46:21 -08:00
bors
ff3d5d4603 auto merge of #11055 : pcwalton/rust/placement-box, r=pcwalton
r? @nikomatsakis
2014-01-09 16:11:18 -08:00
Patrick Walton
e12711540a librustc: Implement placement box for GC and unique pointers. 2014-01-09 16:05:34 -08:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
bors
fb44e20f65 auto merge of #11394 : alexcrichton/rust/no-decorator, r=cmr
This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
2014-01-09 03:51:27 -08:00
bors
c34fc5e33b auto merge of #11387 : pcwalton/rust/de-at-block, r=alexcrichton
r? @brson
2014-01-09 02:26:26 -08:00
bors
ebc079c787 auto merge of #11386 : rcatolino/rust/ice-10955, r=pcwalton
So, like I mentioned in issue #10955 it doesn't seem like we need to call ```ty::subst_tps``` when the method is generic. But then I realized that this function doesn't mutate any of its input, and the return value is unused. Plus the type param substitution seems to be taken care of in ```trans_fn_ref_with_vtables```, so I thought I'd just try to remove it. As far as I can tell everything works.

This closes #10955.
2014-01-09 00:16:30 -08:00
Alex Crichton
6df57ec2e2 Remove the io::Decorator trait
This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
2014-01-08 23:42:28 -08:00
bors
430652c970 auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwalton
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-08 10:06:45 -08:00
bors
464d1d044e auto merge of #11405 : huonw/rust/moredocs, r=huonw
Various documentation changes, change the 'borrowed pointer' terminology to 'reference', fix a problem with 'make dist' on windows.
2014-01-08 07:26:41 -08:00
bors
9da4eac91f auto merge of #11391 : alexcrichton/rust/rustdoc-inline, r=brson
If a reexport comes from a non-public module, then the documentation for the
reexport will be inlined into the module that exports it, but if the reexport is
targeted at a public type (like the prelude), then it is not inlined but rather
hyperlinked.
2014-01-08 00:56:35 -08:00
Alex Crichton
0547fb9cad Fixup the rest of the tests in the compiler 2014-01-07 23:51:38 -08:00
Alex Crichton
c4d36b85a0 Fix remaining cases of leaking imports 2014-01-07 23:51:38 -08:00
Alex Crichton
5350ee740e rustc: De-indent portions of middle::resolve
It's a little prettier to look at now
2014-01-07 23:51:37 -08:00
Alex Crichton
e4804acaca Fix leaking trait imports across modules
Turns out the pass in resolve was a little too eager to travel back up the
hierarchy chain when looking for trait candidates.

Closes #10465
2014-01-07 23:51:37 -08:00
Brian Anderson
2d8dd6afd4 doc: Add rustc and syntax to the index 2014-01-07 21:23:26 -08:00
Brian Anderson
d323632669 'borrowed pointer' -> 'reference' 2014-01-07 18:49:13 -08:00
Alex Crichton
3425901d93 Inline reexports in rustdoc
If a reexport comes from a non-public module, then the documentation for the
reexport will be inlined into the module that exports it, but if the reexport is
targeted at a public type (like the prelude), then it is not inlined but rather
hyperlinked.
2014-01-07 18:46:16 -08:00
Patrick Walton
5e637a890c librustc: Move block contexts into per-function arenas, and
stack-allocate function contexts.
2014-01-07 17:00:47 -08:00
Raphael Catolino
1812a7b540 Remove unnecessary substitution of type params when generating
vtable methods before translating the ref to the method itself.
2014-01-08 00:56:16 +01:00
Marvin Löbel
90b394514d Renamed Option::map_default and mutate_default to map_or and mutate_or_set 2014-01-08 00:53:40 +01:00
bors
4329fc6730 auto merge of #11045 : jhasse/rust/patch-libdir, r=alexcrichton
See https://github.com/mozilla/rust/issues/5223#issuecomment-30455086
2014-01-07 12:26:32 -08:00
Jan Niklas Hasse
116773a4eb Make CFG_LIBDIR configurable. Fixes #5223 2014-01-07 17:51:15 +01:00
bors
ba6ed004b0 auto merge of #11347 : alexcrichton/rust/issue-11346, r=brson
This ends up causing weird errors like those seen in #11346

Closes #11346
2014-01-07 04:41:39 -08:00
bors
bc395bc71e auto merge of #11329 : fhahn/rust/unused-cast-lint2, r=alexcrichton
Updates as mentioned in #11135
2014-01-07 01:51:39 -08:00
Florian Hahn
6be2bc817b Add lint for unnecessary casts 2014-01-06 21:28:49 +01:00
Alex Crichton
b7e58ce554 Don't attempt duplicate outputs
This ends up causing weird errors like those seen in #11346

Closes #11346
2014-01-06 09:23:24 -08:00
bors
8b71b6415d auto merge of #11333 : cmr/rust/triage2, r=alexcrichton 2014-01-06 08:41:45 -08:00
Eduard Burtescu
3119d18e55 Disowned the Visitor. 2014-01-06 14:00:46 +02:00
bors
4e622becdc auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichton
...stlib. Fixes #3319
2014-01-06 02:01:49 -08:00
Young-il Choi
635002a350 librustc: tidy cleanup 2014-01-06 13:06:06 +09:00
Young-il Choi
e6490cbdb0 librustc: add get_system_tools for target specific environment 2014-01-06 13:04:26 +09:00
Young-il Choi
c8c99429d2 librustc: move target dependent logic to back::link 2014-01-06 13:04:26 +09:00
Young-il Choi
19e97f5c5d librustc: ar call fix to support android cross compile on mac 2014-01-06 13:04:26 +09:00
Corey Richardson
ccaf0b4654 Remove a fixme
pcwalton says this is right, and it looks right to me too.

Closes #4731
2014-01-05 21:36:53 -05:00
Jan Niklas Hasse
6abe0ef32e Make rustc's own lib directory configurable and change the default to rustlib. Fixes #3319 2014-01-05 12:06:20 +01:00
Steven Fackler
4bc4acd157 Stop padding metadata
This is causing maybe_get_doc to fail when called at the top level of
the metadata and doesn't appear to be needed anymore.
2014-01-04 22:03:23 -08:00
Brian Anderson
2d8fbba57d rustc: Add error about obsolete struct deref 2014-01-04 14:44:14 -08:00
Brian Anderson
3b1862a82f Don't allow newtype structs to be dereferenced. #6246 2014-01-04 14:44:12 -08:00
Brian Anderson
18cef3fad4 Don't allow single-variant enums to be dereferenced. #6246
I'm not sure if this was even intentional at this point.
2014-01-04 13:17:31 -08:00
bors
fcca394ffb auto merge of #11295 : sfackler/rust/de-jank-encoder, r=brson 2014-01-04 07:41:51 -08:00
bors
3dd7c49faf auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwalton
r? @nikomatsakis 

for the borrow checker changes. Write guards are now eliminated.
2014-01-03 22:36:53 -08:00
Steven Fackler
d45b3643b8 Remove a hacky buffer extraction from metadata 2014-01-03 16:31:22 -08:00
Patrick Walton
82a09b9a04 librustc: Remove @mut support from the parser 2014-01-03 14:02:01 -08:00
Patrick Walton
88281290ff librustc: Remove @mut support from the typechecker and borrow checker 2014-01-03 14:02:01 -08:00
Patrick Walton
1d29163e9c librustc: Eliminate an unnecessary @mut in pretty printing.
This removes all `@mut` from `librustc` and `libsyntax`.
2014-01-03 14:02:00 -08:00
Patrick Walton
4c85cf7a40 libsyntax: De-@mut CodeMap::files 2014-01-03 14:01:59 -08:00
Patrick Walton
449ebeea08 librustc: De-@mut the AST map 2014-01-03 14:01:58 -08:00
Patrick Walton
497b63ddf0 librustc: De-@mut all writers 2014-01-03 14:01:58 -08:00
Patrick Walton
b26018cc89 librustc: De-@mut (and de-@) the pretty printer 2014-01-03 14:01:58 -08:00
Patrick Walton
4d66af2698 librustc: De-@mut the span handler 2014-01-03 14:01:57 -08:00
Patrick Walton
3aa19a6b86 librustc: De-@mut the parse session 2014-01-03 14:01:56 -08:00
bors
d3ae3a27c4 auto merge of #11264 : am0d/rust/crate_type_lint, r=alexcrichton
This ensures that the `crate_type` attribute always contains a value,
and does not contain an invalid value.

Fixes #11256.
2014-01-03 13:31:58 -08:00
bors
08321f1c49 auto merge of #11149 : alexcrichton/rust/remove-either, r=brson
Had to change some stuff in typeck to bootstrap (getting methods in fmt off of Either), but other than that not so painful.

Closes #9157
2014-01-03 12:16:48 -08:00
Alex Crichton
4bea679dbe Remove std::either 2014-01-03 10:25:23 -08:00
bors
11ce6b709a auto merge of #11276 : brson/rust/0.9, r=pcwalton 2014-01-03 09:56:44 -08:00
bors
a1cb8dc30c auto merge of #11275 : matt-auld/rust/update_readme, r=pcwalton 2014-01-03 08:41:45 -08:00
bors
8d4719047b auto merge of #11262 : alexcrichton/rust/issue-11259, r=pcwalton
Closes #11259
2014-01-03 05:46:47 -08:00
bors
fb46225980 auto merge of #11093 : alexcrichton/rust/issue-11085, r=pcwalton
Closes #11085
2014-01-02 20:06:56 -08:00
Brian Anderson
56ec9c23a4 Bump version to 0.9 2014-01-02 12:55:20 -08:00
bors
0df9b850ac auto merge of #10696 : fhahn/rust/issue9543-remove-extern-mod-foo, r=pcwalton
This patch for  #9543 throws an `obsolete syntax` error for `extern mod foo (name="bar")` . 
I was wondering if [this](https://github.com/fhahn/rust/compare/mozilla:master...fhahn:issue9543-remove-extern-mod-foo?expand=1#diff-da9d34ca1d0f6beee2838cf02e07345cR4444) is the correct place to do this?

I think the wording of the error message could probably be improved as well.

If this approach is OK, I'm going to run the whole test suite tomorrow and update the old syntax to the new one.
2014-01-02 11:32:09 -08:00
bors
3249de8c4f auto merge of #11274 : michaelwoerister/rust/issue11083, r=pcwalton
This pull request fixes #11083. The problem was that recursive type definitions were not properly handled for enum types, leading to problems with LLVM's metadata "uniquing". This bug has already been fixed for struct types some time ago (#9658) but I seem to have forgotten about enums back then. I added the offending code from issue #11083 as a test case.
2014-01-02 09:02:01 -08:00
Florian Hahn
4cb13ed982 Inject std libs with versions 2014-01-02 16:05:09 +01:00
matt-auld
33c7d76208 Update references to rustc.rc in README. 2014-01-02 15:02:41 +00:00
Michael Woerister
6d20876c3f debuginfo: Fix issue #11083 and some minor clean up. 2014-01-02 15:20:43 +01:00
bors
ff578b7c83 auto merge of #11269 : am0d/rust/lint_typo, r=sanxiyn 2014-01-02 03:32:02 -08:00
bors
bbdf645811 auto merge of #11268 : lkuper/rust/trans-comment, r=pcwalton 2014-01-02 02:11:48 -08:00
bors
8ba61514c9 auto merge of #11246 : ktt3ja/rust/issue-11224, r=alexcrichton
Close #11224
2014-01-01 22:12:11 -08:00
bors
a96951048c auto merge of #11245 : alexcrichton/rust/issue-11225, r=pcwalton
Commit messages are a little more descriptive.
2014-01-01 20:56:54 -08:00
a_m0d
65baedfa1f Fix typo in lint description. 2014-01-01 23:50:11 -05:00
Lindsey Kuper
99dbb1d51f Fix comment that's been wrong since ancient times (thanks, @jvns). 2014-01-01 23:02:02 -05:00
bors
1b14a9393a auto merge of #11242 : Dretch/rust/hashmap-key-value-iterators, r=pcwalton 2014-01-01 17:11:57 -08:00
a_m0d
8965e34789 Add linting for crate_type attribute values.
This ensures that the `crate_type` attribute always contains a value,
and does not contain an invalid value.
2014-01-01 19:55:59 -05:00
Florian Hahn
f42a36cded Remove extern mod foo (name="bar") syntax, closes #9543 2014-01-01 23:36:57 +01:00
Alex Crichton
dd33b145f3 Fix usage of rustc --ls on invalid files
Closes #11259
2014-01-01 13:20:00 -08:00
bors
c34ef5d7e4 auto merge of #11255 : klutzy/rust/small-cleanup, r=pcwalton
This patchset removes some `@`s and unnecessary traits,
and replaces a function (`dummy_sp()`) returning constant value
by static variable.
2014-01-01 11:06:51 -08:00
bors
51ace54597 auto merge of #11254 : huonw/rust/impl-names, r=brson
The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
2014-01-01 07:56:49 -08:00
Huon Wilson
8f26d0b9b8 syntax: expand impl_pretty_name to handle more cases.
The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
2014-01-02 02:53:54 +11:00
bors
736f5a8ea8 auto merge of #11247 : eddyb/rust/symbol-cleanup, r=alexcrichton 2014-01-01 02:51:53 -08:00
klutzy
9cdad685a3 syntax::codemap: Add static DUMMY_SP
It replaces `dummy_sp()`.
2014-01-01 19:51:35 +09:00
klutzy
db204b20ab syntax::diagnostic: Remove @ from Emitter 2014-01-01 19:10:43 +09:00
klutzy
fe10c63326 syntax::diagnostic: Remove unnecessary traits
This removes trait `handler` and `span_handler`,
and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2014-01-01 19:10:43 +09:00
klutzy
a52cdfdfce rustc::driver: Remove two @s 2014-01-01 19:10:43 +09:00
bors
03b510297c auto merge of #11215 : alexcrichton/rust/metadata-filename, r=pcwalton
Right now if you have concurrent builds of two libraries in the same directory
(such as rustc's bootstrapping process), it's possible that two libraries will
stomp over each others' metadata, producing corrupt rlibs.

By placing the metadata file in a tempdir we're guranteed to not conflict with
ay other builds happening concurrently. Normally this isn't a problem because
output filenames are scoped to the name of the crate, but metadata is special in
that it has the same name across all crates.
2013-12-31 22:26:55 -08:00
bors
e61937a6bf auto merge of #11187 : alexcrichton/rust/once, r=brson
Rationale can be found in the first commit, but this is basically the same thing as `pthread_once`
2013-12-31 20:41:56 -08:00
Alex Crichton
c22fed9424 Convert relevant static mutexes to Once 2013-12-31 20:15:03 -08:00
Eduard Burtescu
4e752651f4 Truncate symbol hashes to 64 bits. 2014-01-01 01:42:24 +02:00
bors
1dcc986d52 auto merge of #11173 : whitequark/rust/master, r=thestinger
This PR adds `std::unsafe::intrinsics::{volatile_load,volatile_store}`, which map to LLVM's `load volatile` and `store volatile` operations correspondingly.

This would fix #11172.

I have addressed several uncertainties with this PR in the line comments.
2013-12-31 15:06:55 -08:00
bors
bd52e6acc6 auto merge of #11157 : alexcrichton/rust/issue-11154, r=pcwalton
Closes #11154
2013-12-31 13:52:03 -08:00
Kiet Tran
576a85105f Mark provided methods in dead-code pass 2013-12-31 16:19:57 -05:00
Alex Crichton
0daaeab244 Conservatively export all trait methods and impls
The comments have more information as to why this is done, but the basic idea is
that finding an exported trait is actually a fairly difficult problem. The true
answer lies in whether a trait is ever referenced from another exported method,
and right now this kind of analysis doesn't exist, so the conservative answer of
"yes" is always returned to answer whether a trait is exported.

Closes #11224
Closes #11225
2013-12-31 12:42:13 -08:00
Gareth Smith
d435f4f059 Fix issue #11216 - Replace std::hashmap::{each_key, each_value} with iterators. 2013-12-31 20:29:39 +00:00
SiegeLord
cbe8c61fed Add a --no-analysis command line switch 2013-12-31 15:28:08 -05:00
SiegeLord
a7a9e488a4 Generate --dep-info earlier in the compillation. 2013-12-31 15:28:02 -05:00
Alex Crichton
870024a160 Disallow LTO with a preference to dynamic linking
Closes #11154
2013-12-31 11:48:47 -08:00
Peter Zotov
f98f83a15d Implement volatile_load and volatile_store intrinsics. 2013-12-31 02:54:25 +04:00
Vadim Chugunov
856222987d Revert "Embed Windows application manifest." 2013-12-30 13:22:54 -08:00
Alex Crichton
fe30087080 Add metadata from a tempdir instead of a build dir
Right now if you have concurrent builds of two libraries in the same directory
(such as rustc's bootstrapping process), it's possible that two libraries will
stomp over each others' metadata, producing corrupt rlibs.

By placing the metadata file in a tempdir we're guranteed to not conflict with
ay other builds happening concurrently. Normally this isn't a problem because
output filenames are scoped to the name of the crate, but metadata is special in
that it has the same name across all crates.
2013-12-30 08:21:41 -08:00
bors
f37b746699 auto merge of #11182 : luisbg/rust/crateid, r=cmr
Issue #11048
2013-12-30 04:32:09 -08:00
Steven Fackler
dc830345e8 Remove @muts from ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
3965dddf49 Make ast_fold take &mut self 2013-12-29 23:41:05 -08:00
Luis de Bethencourt
f872c47278 Rename PkgId to CrateId 2013-12-29 15:25:32 -05:00
Luis de Bethencourt
4bc09713df Rename pkgid variables 2013-12-29 15:25:26 -05:00
Steven Fackler
0607c138ca Stop using @ExtCtxt 2013-12-28 21:16:03 -07:00
bors
2922697087 auto merge of #11175 : klutzy/rust/ice, r=alexcrichton
`ln_str` caused ICE if `RUST_LOG=rustc::middle::liveness` is given
due to borrow failure.
2013-12-28 14:12:01 -08:00
klutzy
eaae0ac68a rustc: Fix a borrow failure in .ln_str()
`ln_str` caused ICE if `RUST_LOG=rustc::middle::liveness` is given
due to borrow failure.
2013-12-29 02:47:12 +09:00
Alex Crichton
b6a7463526 Initialize LLVM only once
This also appears to fix a race in LLVM that was causing a deadlock on the bots
during the doc-test tests (where we use rustc in parallel).
2013-12-27 23:39:33 -08:00
Luqman Aden
1265a03139 librustc: Implement coercion for traits. 2013-12-27 03:26:46 -05:00
Patrick Walton
ad160146fd librustc: Fix tidy problem. 2013-12-26 15:54:37 -08:00
Patrick Walton
cc0584731a librustc: De-@mut the def map.
This is the last `@mut` in `librustc` that does not depend on libsyntax.
2013-12-26 15:54:37 -08:00
Patrick Walton
56b9a207ab librustc: De-@mut the value and type ribs in the resolver 2013-12-26 15:54:37 -08:00
Patrick Walton
c48335e334 librustc: De-@mut Module::imports in the resolver 2013-12-26 15:54:37 -08:00
Patrick Walton
47846110a4 librustc: Fully de-@mut trait_impls in the type context 2013-12-26 15:54:37 -08:00
Patrick Walton
fecef74d57 librustc: De-@mut the inherent implementations list 2013-12-26 15:54:37 -08:00
Patrick Walton
ed819c9a81 librustc: De-@mut the crate cache in the crate reader 2013-12-26 15:54:37 -08:00
Patrick Walton
1f76a9ba5e librustc: De-@mut populated_external_traits in the type context 2013-12-26 15:54:37 -08:00
Patrick Walton
f62faa89ed librustc: De-@mut outputs in the session 2013-12-26 15:54:37 -08:00
Patrick Walton
e4815b6c3f librustc: De-@mut the users list in liveness 2013-12-26 15:54:37 -08:00
Patrick Walton
ff23e1202f librustc: De-@mut BindingRscope::anon_bindings 2013-12-26 15:54:36 -08:00
Patrick Walton
d7b152701e librustc: De-@mut building_library in the session 2013-12-26 15:54:36 -08:00
Patrick Walton
c56bac7f40 librustc: De-@mut node_id in the session 2013-12-26 15:54:36 -08:00
Patrick Walton
eaf69494a5 librustc: De-@mut the loop scope in liveness 2013-12-26 15:54:36 -08:00
Patrick Walton
298d0b870f librustc: De-@mut label_ribs in the resolver 2013-12-26 15:54:36 -08:00
Patrick Walton
7f816b7ef4 librustc: De-@mut the idstack in constant checking 2013-12-26 15:54:36 -08:00
Patrick Walton
8c703643ad librustc: De-@mut the reachability worklist 2013-12-26 15:54:36 -08:00
Patrick Walton
4b4ff2cf8b librustc: De-@mut DynamicFailureHandler::finished 2013-12-26 15:54:36 -08:00
Patrick Walton
fc0b466fd4 librustc: De-@mut all_loans in the borrow checker 2013-12-26 15:54:36 -08:00
Patrick Walton
0afae85bc2 librustc: De-@mut inherent_candidates and extension_candidates in
method lookup
2013-12-26 15:54:36 -08:00
Patrick Walton
1a6c1e5d32 librustc: De-@mut Liveness::successors 2013-12-26 15:54:36 -08:00
Patrick Walton
89dfd00dcf librustc: De-@mut next_id in the type context 2013-12-26 15:54:36 -08:00
Patrick Walton
a483ee8e33 librustc: De-@mut the trait map 2013-12-26 15:54:36 -08:00
Patrick Walton
d3fc7b9918 librustc: De-@mut the translation stats 2013-12-26 15:54:36 -08:00
Patrick Walton
9f6706975b librustc: De-@mut fn_stats in the stats 2013-12-26 15:54:36 -08:00
Patrick Walton
e84f79feb1 librustc: De-@mut llvm_insns in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
8c3a552ac5 librustc: Remove the unused llvm_insn_ctxt from the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
97ceac7377 librustc: De-@mut n_llvm_insns in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
21e4e410a9 librustc: De-@mut n_closures in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
c010d08cd5 librustc: De-@mut n_inlines in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
8c7804ffac librustc: De-@mut n_monos in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
38572f4981 librustc: De-@mut n_fns in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
16828bb1dc librustc: De-@mut n_real_glues 2013-12-26 15:54:35 -08:00
Patrick Walton
75efa0725d librustc: De-@mut n_null_glues in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
26d1394767 librustc: De-@mut n_glues_created in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
091bfa9cc3 librustc: De-@mut n_static_tydescs in the stats 2013-12-26 15:54:35 -08:00
Patrick Walton
6659ae7d97 librustc: De-@mut Rib::self_binding 2013-12-26 15:54:35 -08:00
Patrick Walton
d1e23aeb0e librustc: De-@mut MoveData 2013-12-26 15:54:35 -08:00
Patrick Walton
1b06a9593f librustc: De-@mut MoveData::assignee_ids 2013-12-26 15:54:35 -08:00
Patrick Walton
111e167f48 librustc: De-@mut MoveData::var_assignments 2013-12-26 15:54:35 -08:00
Patrick Walton
460305749c librustc: De-@mut MoveData::path_assignments 2013-12-26 15:54:34 -08:00
Patrick Walton
7d3e25394f librustc: De-@mut MoveData::path_map 2013-12-26 15:54:34 -08:00
Patrick Walton
1b8391ca12 librustc: De-@mut MoveData::moves 2013-12-26 15:54:34 -08:00
Patrick Walton
1ded423505 librustc: Replace the move method with an accessor in the borrow check
move data
2013-12-26 15:54:34 -08:00
Patrick Walton
12c5c19871 librustc: De-@mut MoveData::paths 2013-12-26 15:54:34 -08:00
Patrick Walton
026364ca26 librustc: Change mut_path into mutators for specific fields in the
borrow check move data
2013-12-26 15:54:34 -08:00
Patrick Walton
fcb47813a4 librustc: Extract first_child and next_sibling from the borrow check
move data into accessors
2013-12-26 15:54:34 -08:00
Patrick Walton
f700cf3872 librustc: Extract first_move from the move data into an accessor 2013-12-26 15:54:34 -08:00
Patrick Walton
f19a9b9600 librustc: Extract parent from move data as an accessor 2013-12-26 15:54:34 -08:00
Patrick Walton
211c6d522b librustc: Extract loan_path from move data into an accessor 2013-12-26 15:54:34 -08:00