Commit Graph

1153 Commits

Author SHA1 Message Date
bors
d052912297 auto merge of #9851 : alexcrichton/rust/include_bin, r=huonw
Previously an ExprLit was created *per byte* causing a huge increase in memory
bloat. This adds a new `lit_binary` to contain a literal of binary data, which
is currently only used by the include_bin! syntax extension. This massively
speeds up compilation times of the shootout-k-nucleotide-pipes test

    before:
        time: 469s
        memory: 6GB
        assertion failure in LLVM (section too large)

    after:
        time: 2.50s
        memory: 124MB

Closes #2598
2013-10-18 09:41:33 -07:00
Alex Crichton
273784e9bf Optimize include_bin! for large inputs
Previously an ExprLit was created *per byte* causing a huge increase in memory
bloat. This adds a new `lit_binary` to contain a literal of binary data, which
is currently only used by the include_bin! syntax extension. This massively
speeds up compilation times of the shootout-k-nucleotide-pipes test

    before:
        time: 469s
        memory: 6GB
        assertion failure in LLVM (section too large)

    after:
        time: 2.50s
        memory: 124MB

Closes #2598
2013-10-18 09:20:08 -07:00
Brian Anderson
34d376f3cf std: Move size/align functions to std::mem. #2240 2013-10-17 17:31:35 -07:00
bors
386fa1d818 auto merge of #9897 : thestinger/rust/rusti, r=alexcrichton
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038
2013-10-17 01:36:33 -07:00
Chris Sainty
88ab38cf06 Removed the -Z once_fns compiler flag and added the new feature directive of the same name to replace it.
Changed the frame_address intrinsic to no longer be a once fn.
This removes the dependency on once_fns from std.
2013-10-17 06:22:48 +02:00
Daniel Micay
7c92435f8f remove the rusti command
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
2013-10-16 22:54:38 -04:00
Steve Klabnik
16fc6a694c Remove unused abi attributes.
They've been replaced by putting the name on the extern block.

  #[abi = "foo"]

goes to

  extern "foo" { }

Closes #9483.
2013-10-14 13:10:36 +02:00
Erik Lyon
8b65a45879 fix typos in doc/tutorial.md 2013-10-13 10:49:44 -07:00
bors
2e1df8e35b auto merge of #9732 : catamorphism/rust/rustpkg-read-only, r=brson
r? @metajack rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480
2013-10-10 17:36:21 -07:00
Tim Chevalier
8854b78b55 rustpkg: Make checked-out source files read-only, and overhaul where temporary files are stored
rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480
2013-10-10 15:16:31 -07:00
Michael 'devbug' Williams
bcf76ac3ed Fixed typo under 'Segmented stacks and the linter', and removed superfluous trailing whitespace. 2013-10-10 14:00:15 -07:00
bors
c9196290af auto merge of #9674 : ben0x539/rust/raw-str, r=alexcrichton
This branch parses raw string literals as in #9411.
2013-10-07 23:01:39 -07:00
Alex Crichton
7cd6692425 Fix merge fallout of privacy changes 2013-10-07 21:44:02 -07:00
Benjamin Herr
6885c7337f document raw string literals in tutorial.md and rust.md 2013-10-08 01:44:05 +02:00
Alex Crichton
2c76cdae3e Document visibility in the manual/tutorial
This removes the warning "Note" about visibility not being fully defined, as it
should now be considered fully defined with further bugs being considered just
bugs in the implementation.
2013-10-07 13:00:52 -07:00
bors
8eb28bb7dc auto merge of #9703 : alexcrichton/rust/compiler-features, r=cmr
This implements the necessary logic for gating particular features off by default in the compiler. There are a number of issues which have been wanting this form of mechanism, and this initially gates features which we have open issues for.

Additionally, this should unblock #9255
2013-10-06 14:41:28 -07:00
Alex Crichton
dd98f7089f Implement feature-gating for the compiler
A few features are now hidden behind various #[feature(...)] directives. These
include struct-like enum variants, glob imports, and macro_rules! invocations.

Closes #9304
Closes #9305
Closes #9306
Closes #9331
2013-10-05 20:19:33 -07:00
Tim Chevalier
8ba148b295 docs / rustpkg: Document rustpkg test more
Talk about `rustpkg test` in the tutorial, and update its usage message.
2013-10-05 23:17:23 -04:00
Erick Tryzelaar
0feaccf526 syntax: Add #[deriving(FromPrimitive)] syntax extension
Right now this only works for c-style enums.
2013-10-02 07:55:41 -07:00
Daniel Micay
c9d4ad07c4 remove the float type
It is simply defined as `f64` across every platform right now.

A use case hasn't been presented for a `float` type defined as the
highest precision floating point type implemented in hardware on the
platform. Performance-wise, using the smallest precision correct for the
use case greatly saves on cache space and allows for fitting more
numbers into SSE/AVX registers.

If there was a use case, this could be implemented as simply a type
alias or a struct thanks to `#[cfg(...)]`.

Closes #6592

The mailing list thread, for reference:

https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01 14:54:10 -04:00
bors
320af9b157 auto merge of #9645 : dckc/rust/patch-2, r=catamorphism
the switch from package `hello` to `pkg_id` is a little jarring; I'd use `<var>` but I don't see how. ALL_CAPS i.e. PKG_ID seems like a reasonable  poor-man's `<var>`.
2013-10-01 07:36:35 -07:00
Alex Crichton
9ce31f6dd9 tutorial: Remove usage of fmt! 2013-09-30 23:21:20 -07:00
Dan Connolly
398e2c479a clarify that rust_pkg is a place-holder
the switch from package `hello` to `rust_pkg` is a little jarring; I'd use <var> but I don't see how. ALL_CAPS seems like a reasonable  poor-man's <var>.
2013-09-30 22:57:09 -05:00
bors
9883a6250b auto merge of #9589 : thestinger/rust/tutorial, r=alexcrichton 2013-09-28 16:21:04 -07:00
Daniel Micay
6c8e6aad73 tutorial: rewrite the sections on boxes/moves 2013-09-28 17:01:46 -04:00
bors
058a5d97a2 auto merge of #9459 : eliovir/rust/patch-1, r=bstrie
change formula (other solution could be using abs()).
2013-09-28 05:26:04 -07:00
eliovir
835960a333 tutorial.md : correct formula in fn area()
change formula (other solution could be using abs()).
2013-09-24 10:21:18 +02:00
bors
0275b1c404 auto merge of #9450 : jzelinskie/rust/tutorial-tasks-result-signature, r=alexcrichton 2013-09-24 01:06:02 -07:00
bors
df8231e134 auto merge of #9439 : steveklabnik/rust/build_rustpkg_tutorial, r=brson
Three things in this commit:

1. Actually build the rustpkg tutorial. I didn't know I needed this when
   I first wrote it.
2. Link to it rather than the manual from the
   tutorial.
3. Update the headers: most of them were one level too deeply
   nested.
2013-09-23 22:26:06 -07:00
Jimmy Zelinskie
3073ba4ca3 Fix signature of Result in tasks tutorial. Closes #8343 2013-09-23 22:30:42 -04:00
Patrick Walton
90d3da9711 test: Fix rustdoc and tests. 2013-09-23 18:23:22 -07:00
Steve Klabnik
06b11ba172 Add rustpkg tutorial to the official tutorials.
Three things in this commit:

1. Actually build the rustpkg tutorial. I didn't know I needed this when
   I first wrote it.
2. Link to it rather than the manual from the
   tutorial.
3. Update the headers: most of them were one level too deeply
   nested.
2013-09-23 14:36:38 -07:00
bors
eb55348a7c auto merge of #9423 : madjar/rust/patch-1, r=alexcrichton
Just something I noticed while reading the tutorial.
2013-09-23 09:20:56 -07:00
Marvin Löbel
bb7bc6c584 Extended the module tutorial section about files a bit 2013-09-23 16:33:11 +02:00
Georges Dubus
90e1e8fc40 Fixed a small typo in the tutorial
Just something I noticed while reading the tutorial.
2013-09-23 10:04:48 +02:00
Brian Anderson
695cb9fc2b Update version numbers to 0.8 2013-09-21 16:25:08 -07:00
bors
2fd3c07242 auto merge of #9278 : alexcrichton/rust/ndebug, r=brson
Many people will be very confused that their debug! statements aren't working
when they first use rust only to learn that they should have been building with
`--cfg debug` the entire time. This inverts the meaning of the flag to instead
of enabling debug statements, now it disables debug statements.

This way the default behavior is a bit more reasonable, and requires less
end-user configuration. Furthermore, this turns on debug by default when
building the rustc compiler.
2013-09-20 12:46:05 -07:00
Alex Crichton
833a64d76e Invert --cfg debug to --cfg ndebug
Many people will be very confused that their debug! statements aren't working
when they first use rust only to learn that they should have been building with
`--cfg debug` the entire time. This inverts the meaning of the flag to instead
of enabling debug statements, now it disables debug statements.

This way the default behavior is a bit more reasonable, and requires less
end-user configuration. Furthermore, this turns on debug by default when
building the rustc compiler.
2013-09-20 12:10:04 -07:00
bors
b7bbc2eea2 auto merge of #9327 : larsbergstrom/rust/tutorial_installation_tweak, r=catamorphism
I've had multiple people whom I pointed at the Rust tutorial ask me where to download the snapshot compiler, so I made the text more explicit.
2013-09-20 09:56:09 -07:00
bors
c7c769d8c2 auto merge of #9315 : thestinger/rust/doc, r=alexcrichton
This also renames the section, as managed vectors cannot be resized
(since it would invalidate the other references).
2013-09-19 23:11:19 -07:00
Steven Fackler
ff85389344 Modernize extra::future API 2013-09-19 15:19:20 -07:00
Lars Bergstrom
9051a35fc8 Clarify that snapshots are automatically retrieved. 2013-09-19 10:58:26 -05:00
blake2-ppc
f0630fdc8b doc: Fix the tutorial's link to rustpkg docs 2013-09-19 01:43:10 -04:00
blake2-ppc
bf0e2a6f57 doc: Update container tutorial with new names of methods and macros
`deque` -> `ringbuf`, mention `extra::dlist`.

fix reference to vector method `bsearch`. Also convert all output
in example code to use `print!`/`println!`
2013-09-18 23:17:07 -04:00
Daniel Micay
d12e0305b1 clarify vector stub in the container tutorial
This also renames the section, as managed vectors cannot be resized
(since it would invalidate the other references).
2013-09-18 22:26:48 -04:00
Daniel Rosenwasser
604667fa82 Added support for a \0 escape sequence.
This commit adds support for `\0` escapes in character and string literals.

Since `\0` is equivalent to `\x00`, this is a direct translation to the latter
escape sequence. Future builds will be able to compile using `\0` directly.

Also updated the grammar specification and added a test for NUL characters.
2013-09-17 23:52:29 -04:00
Daniel Micay
e12c3bfbf9 document what unsafety means
Closes #9144
2013-09-17 19:13:14 -04:00
bors
29cdf58861 auto merge of #9244 : thestinger/rust/drop, r=catamorphism
This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.
2013-09-17 07:15:42 -07:00
bors
7ea85333ff auto merge of #9239 : steveklabnik/rust/rustpkg_tutorial, r=catamorphism
First shot at a new tutorial for rustpkg. /cc @catamorphism

Right now, I'm linking to my sample package on GitHub, I'm not sure that everyone would be comfortable with me having that there. Maybe under the mozilla org? I think having one to install and hold up as a default makes sense.
2013-09-17 04:45:45 -07:00
Daniel Micay
4e161a4d40 switch Drop to &mut self 2013-09-16 22:19:23 -04:00