Commit Graph

23018 Commits

Author SHA1 Message Date
bors
0c388be8d1 auto merge of #9731 : Kimundi/rust/SendStrTaskName, r=alexcrichton
This resolves a FIXME in `std::rt::task`.
2013-10-05 13:11:54 -07:00
Marvin Löbel
517298de48 Implemented IntoSendStr on SendStr to allow naming a
task with a `SendStr` directly
2013-10-05 21:28:04 +02:00
Marvin Löbel
49ac6baa72 Make a task name use a SendStr, allowing for either
static or owned strings
2013-10-05 21:01:58 +02:00
Steven Fackler
1d19ad9787 Fix thread safety issues in dynamic_lib
The root issue is that dlerror isn't reentrant or even thread safe.

The Windows code isn't affected since errno is thread-local on Windows
and it's running in an atomically block to ensure there isn't a green
thread context switch.

Closes #8156
2013-10-05 10:37:11 -07:00
Florian Hahn
b7b4f7a5e2 Add code for older crate map versions, bumped crate map version number 2013-10-05 12:09:30 +02:00
Florian Hahn
5dd1145c9b Use &'self str instead of raw char pointer in ModEntry 2013-10-05 12:09:30 +02:00
Florian Hahn
9ef4463b2a Use slice representation for module entries in CrateMap
Relaxe lifetime of CrateMap as well.
2013-10-05 12:09:30 +02:00
Florian Hahn
787f20a255 Use slice representation for child crate maps 2013-10-05 12:09:30 +02:00
bors
1506dac10f auto merge of #9727 : Valloric/rust/doc-fixes, r=catamorphism 2013-10-04 23:51:32 -07:00
bors
bae0ce2a69 auto merge of #9726 : Valloric/rust/typo_fix, r=alexcrichton 2013-10-04 22:36:33 -07:00
Strahinja Val Markovic
03099e5678 Fixed another minor typo in std::str docs 2013-10-04 22:07:57 -07:00
Strahinja Val Markovic
d629aca81a Fix minor typo in std::str module docs 2013-10-04 21:24:29 -07:00
bors
5a1073fbab auto merge of #9722 : alexcrichton/rust/less-mem, r=sanxiyn
According to http://huonw.github.io/isrustfastyet/mem/#012f909, the "const
marking" pass generates about 400MB of extra memory during compilation. It
appears that this is due to two different factors:

    1. There is a `ccache` map in the ty::ctxt which is only ever used in this
       pass, so this commit moves the map out of the ty::ctxt struct and into
       just this pass's visitor. This turned out to not benefit that much in
       memory (as indicated by http://i.imgur.com/Eo4iOzK.png), but it's helpful
       to do nonetheless.

    2. During const_eval, there are a lot of lookups into decoding inlined items
       from external crates. There is no caching involved here, so the same
       static or variant could be re-translated many times. After adding
       separate caches for variants and statics, the memory peak of compiling
       rustc decreased by 200MB (as evident by http://i.imgur.com/ULAUMtq.png)

The culmination of this is basically a slight reorganization of a caching map
for the const_eval pass along with a 200MB decrease in peak memory usage when
compiling librustc.
2013-10-04 21:21:31 -07:00
Alex Crichton
19e9766c29 Don't fail when unpacking the windows snapshot
Newly having a third-party directory was throwing off the unpack script
2013-10-04 21:16:54 -07:00
bors
1a3141b7c5 auto merge of #9718 : alexcrichton/rust/snapshots, r=sanxiyn
Now that #9662 is merged, we should be much more easily bootstrappable on
windows now.
2013-10-04 18:36:32 -07:00
Alex Crichton
1996a11bb2 Cache more results of const_eval
According to http://huonw.github.io/isrustfastyet/mem/#012f909, the "const
marking" pass generates about 400MB of extra memory during compilation. It
appears that this is due to two different factors:

    1. There is a `ccache` map in the ty::ctxt which is only ever used in this
       pass, so this commit moves the map out of the ty::ctxt struct and into
       just this pass's visitor. This turned out to not benefit that much in
       memory (as indicated by http://i.imgur.com/Eo4iOzK.png), but it's helpful
       to do nonetheless.

    2. During const_eval, there are a lot of lookups into decoding inlined items
       from external crates. There is no caching involved here, so the same
       static or variant could be re-translated many times. After adding
       separate caches for variants and statics, the memory peak of compiling
       rustc decreased by 200MB (as evident by http://i.imgur.com/ULAUMtq.png)

The culmination of this is basically a slight reorganization of a caching map
for the const_eval pass along with a 200MB decrease in peak memory usage when
compiling librustc.
2013-10-04 17:41:15 -07:00
bors
8cb3426f16 auto merge of #9723 : blake2-ppc/rust/trans-no-push-ctxt-clone, r=alexcrichton
Avoid cloning the stack on every `push_ctxt` call in trans

Rewrite the use of TLS variable for `push_ctxt` so that it uses a ~[]
instead of a @~[]. Before it cloned the whole vector on each push and
pop, which is unnecessary.
2013-10-04 16:21:36 -07:00
blake2-ppc
87294c23ba Avoid cloning the stack on every push_ctxt call in trans
Rewrite the use of TLS variable for `push_ctxt` so that it uses a ~[]
instead of a @~[]. Before it cloned the whole vector on each push and
pop, which is unnecessary.
2013-10-05 01:10:27 +02:00
bors
c5295f9c47 auto merge of #9717 : blake2-ppc/rust/rustc-static-str, r=alexcrichton
rustc: Use static strings in a few literals

Avoid allocating extra copies of strings by using "" instead of ~"" for
the debug options list and for the `time` function. This is a small
change, but it is in a path that's always executed.
2013-10-04 12:36:36 -07:00
Alex Crichton
4cc925a5f4 Register new snapshots
Now that #9662 is merged, we should be much more easily bootstrappable on
windows now.
2013-10-04 11:24:18 -07:00
bors
a9d54acc3e auto merge of #9715 : flo-l/rust/doc-fixes, r=alexcrichton 2013-10-04 11:01:41 -07:00
blake2-ppc
9ac175c503 rustc: Use static strings in a few literals
Avoid allocating extra copies of strings by using "" instead of ~"" for
the debug options list and for the `time` function. This is a small
change, but it is in a path that's always executed.
2013-10-04 19:46:53 +02:00
flo-l
bf6b198c7e fix some examples in std::rand::Rng 2013-10-04 16:38:05 +02:00
bors
8bb55dbf21 auto merge of #9662 : vadimcn/rust/package-runtime-deps, r=brson
This will make sure that system files that rust binaries depend on in Windows get packaged into stage0 snapshots as well as into Windows installer.
Currently these include `libgcc_s_dw2-1.dll`, `libstdc++-6.dll` and `libpthread-2.dll`.   Note that the latter will need to be changed to `pthreadGC2.dll` once Windows build bots get upgraded to mingw 4.0

Closes #9252
Closes #5878
Closes #9218
Closes #5712
2013-10-04 07:11:37 -07:00
bors
dfe29e2211 auto merge of #9704 : alexcrichton/rust/rustdoc-comments, r=huonw
This addresses some of @huonw's in #9691 about the startling lack of
documentation guiding one throughout the innards of rustdoc::html

r? @huonw
2013-10-04 05:51:35 -07:00
bors
e44b40ca3a auto merge of #9712 : ben0x539/rust/obsolete-syntax, r=pcwalton
Mostly as per a short discussion on irc. (@cmr)

    08:46 < cmr> so I'm thinking
    Obsolete{Let,With,FieldTerminator,ClassTraits,ModeInFnType,MoveInit,BinaryMove,I
    mplSyntax,MutOwnedPointer,MutVector,RecordType,RecordPattern,PostFnTySigil,Newty
    pEnum,Mode,ImplicitSelf,LifetimeNotation,Purity,StaticMethod,ConstItem,FixedLeng
    thVectorType}
    08:46 < cmr> Those are the ones that are older than 0.6
    08:46 < cmr> (at least!)

This PR removes these specific "obsolete syntax"/"suggestion for change" errors and just lets the parser run into regular parser errors for long-invalid syntax. I also removed `ObsoletePrivSection` which apparently dates further back than cmr or I could recall and `ObsoleteUnenforcedBound` which seemed unused. Also I removed `ObsoleteNewtypeEnum`.
2013-10-03 22:56:33 -07:00
Benjamin Herr
fa411500f9 Remove specific errors for very old obsolete syntax
Replaces existing tests for removed obsolete-syntax errors with tests
for the resulting regular errors, adds a test for each of the removed
parser errors to make sure that obsolete forms don't start working
again, removes some obsolete/superfluous tests that were now failing.

Deletes some amount of dead code in the parser, also includes some small
changes to parser error messages to accomodate new tests.
2013-10-04 07:09:28 +02:00
bors
3f32898a7b auto merge of #9711 : sanxiyn/rust/ambiguous-default-method, r=alexcrichton
Fix #8808.
2013-10-03 20:21:31 -07:00
bors
4bae639d86 auto merge of #9705 : luisbg/rust/strptime, r=alexcrichton
do_strptime() and do_strftime()

I don't see any reason why src/libextra/time.rs has two functions that just call a very similar function, which only use is to be called by them.
strftime() just calls do_strftime()
strptime() just calls do_strptime()
and the do_functions aren't called by anyone else.
the parameters and return types are exactly the same in both levels, so I just have removed the second layer.

Unless there is a need for that second level.
2013-10-03 14:01:41 -07:00
Luis de Bethencourt
a0c59941e3 extra: remove unnecessary second level functions
do_strptime() and do_strftime()
2013-10-03 16:01:42 -04:00
bors
012f909f35 auto merge of #9522 : steveklabnik/rust/doc_std_opts, r=alexcrichton
Added an overview with a 'real' example, as well as toy implementations of all of
the traits.

Closes #9356.
2013-10-03 12:46:32 -07:00
Steve Klabnik
28e88b4c6f Update std::ops docs as per feedback
from @chris-morgan
2013-10-03 12:37:33 -07:00
bors
9344e2a866 auto merge of #9686 : alexcrichton/rust/lint, r=thestinger
This purges about 500 lines of visitor cruft from lint passes. All lints are
handled in a much more sane way at this point. The other huge bonus of this
commit is that there are no more @-boxes in the lint passes, fixing the 500MB
memory regression seen when the lint passes were refactored.

Closes #8589
2013-10-03 10:31:33 -07:00
Alex Crichton
c0388cd691 Rewrite lint passes with less visitor cruft
This purges about 500 lines of visitor cruft from lint passes. All lints are
handled in a much more sane way at this point. The other huge bonus of this
commit is that there are no more @-boxes in the lint passes, fixing the 500MB
memory regression seen when the lint passes were refactored.

Closes #8589
2013-10-03 10:25:14 -07:00
Alex Crichton
cdb7701434 rustdoc: Document what's going on throughout
This addresses some of @huonw's in #9691 about the startling lack of
documentation guiding one throughout the innards of rustdoc::html
2013-10-03 10:24:40 -07:00
Alex Crichton
88593fc3fc Document logging and remove old functions
This adds a large doc-block to the top of the std::logging module explaining how
to use it. This is mostly just making sure that all the information in the
manual's section about logging is also here (in case someone decides to look
into this module first).

This also removes the old console_{on,off} methods. As far as I can tell, the
functions were only used by the compiler, and there's no reason for them to be
used because they're all turned off by default anyway (maybe they were turned on
by default at some point...)

I believe that this is the final nail in the coffin and closes #5021
2013-10-03 09:16:31 -07:00
Alex Crichton
a1ffb06ac8 Use the correct logging crate while monomorphing
This makes sure that the top-level crate name is correct when emitting log
statements for a monomorphized function in another crate. This happens by
tracing the monomorphized ID back to the external source and then using that
crate index to get the name of the crate.

Closes #3046
2013-10-03 09:16:31 -07:00
Seo Sanghyeon
fbd56396bc Correctly report errors for ambiguous default methods 2013-10-04 01:10:28 +09:00
bors
ff30566954 auto merge of #9698 : sanxiyn/rust/android, r=huonw 2013-10-03 05:46:28 -07:00
bors
e08391c3f1 auto merge of #9699 : thestinger/rust/immediate, r=huonw,luqmana
struct Foo;
    fn foo() -> Foo { Foo }

Before:

    ; Function Attrs: nounwind readnone uwtable
    define void @_ZN3foo18he8ca29755dedebbaf4v0.0E(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture) #0 {
    "function top level":
      ret void
    }

After:

    ; Function Attrs: nounwind readnone uwtable
    define %struct.Foo @_ZN3foo18he8ca29755dedebbaf4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
    "function top level":
      ret %struct.Foo undef
    }
2013-10-03 04:26:32 -07:00
Daniel Micay
6d598989f6 Merge pull request #9697 from sfackler/issue_9155
Close out #9155
2013-10-03 04:13:10 -07:00
Daniel Micay
f504461a40 make C-like enums immediate
This fixes two existing bugs along the way:

* The `transmute` intrinsic did not correctly handle casts of immediate
  aggregates like newtype structs and tuples.
* The code for calling foreign functions used the wrong type to create
  an `alloca` temporary

    enum Foo { A, B }
    fn foo() -> Foo { A }

Before:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3foo18hbedc642d5d9cf5aag4v0.0E(%enum.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
    "function top level":
      %2 = getelementptr inbounds %enum.Foo* %0, i64 0, i32 0
      store i64 0, i64* %2, align 8
      ret void
    }

After:

    ; Function Attrs: nounwind readnone uwtable
    define %enum.Foo @_ZN3foo18hbedc642d5d9cf5aag4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
    "function top level":
      ret %enum.Foo zeroinitializer
    }
2013-10-03 06:27:00 -04:00
Daniel Micay
249b356fb3 make unit structs immediate
struct Foo;
    fn foo() -> Foo { Foo }

Before:

    ; Function Attrs: nounwind readnone uwtable
    define void @_ZN3foo18he8ca29755dedebbaf4v0.0E(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture) #0 {
    "function top level":
      ret void
    }

After:

    ; Function Attrs: nounwind readnone uwtable
    define %struct.Foo @_ZN3foo18he8ca29755dedebbaf4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
    "function top level":
      ret %struct.Foo undef
    }
2013-10-03 03:59:58 -04:00
bors
8f40641e01 auto merge of #9691 : alexcrichton/rust/rustdoc, r=cmr
This slurps in the commits from #9684 as well as closing #9539.
2013-10-03 00:56:34 -07:00
Steven Fackler
435ca16f4f Close out #9155
Add a test to make sure it works and switch a private struct over to a
newtype.

Closes #9155
2013-10-03 00:15:54 -07:00
Seo Sanghyeon
0640ae0ecd Ignore tests on Android correctly 2013-10-03 15:48:44 +09:00
bors
b637798a5a auto merge of #9693 : sfackler/rust/newtype-removal, r=alexcrichton
UnboundedPipeStream is still a newtype since process::set_stdio needs to
look into its internals.

Closes #9667
2013-10-02 20:41:29 -07:00
Steven Fackler
019b131e12 Stop using newtype wrappers in std::rt::io
UnboundedPipeStream is still a newtype since process::set_stdio needs to
look into its internals.

Closes #9667
2013-10-02 20:37:17 -07:00
bors
ccd9a963f7 auto merge of #9681 : skade/rust/str-from-str, r=huonw
This fixes an issue for APIs that return FromStr. Before this change,
they would have to offer a seperate function for returning the source
string.
2013-10-02 18:16:29 -07:00
bors
20760739e9 auto merge of #9689 : luisbg/rust/strftime, r=alexcrichton
Plus testing added for %X and %x which were supported but not tested.

Working towards #2350
2013-10-02 17:01:32 -07:00