Commit Graph

1170 Commits

Author SHA1 Message Date
Matt Carberry
66abb92a47 Grammar error and vim syntax highlighting mistake fixed. 2013-11-02 21:34:29 -07:00
Matt Carberry
519b86b8a8 Added octal literal support. 2013-11-02 21:26:29 -07:00
bors
d04a58cf2d auto merge of #9740 : alexcrichton/rust/concat, r=cmr
This extension can be used to concatenate string literals at compile time. C has
this useful ability when placing string literals lexically next to one another,
but this needs to be handled at the syntax extension level to recursively expand
macros.

The major use case for this is something like:

    macro_rules! mylog( ($fmt:expr $($arg:tt)*) => {
        error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*);
    })

Where the mylog macro will automatically prepend the filename/line number to the
beginning of every log message.
2013-10-31 17:51:26 -07:00
Alex Crichton
a49e65c2ed Implement a concat!() format extension
This extension can be used to concatenate string literals at compile time. C has
this useful ability when placing string literals lexically next to one another,
but this needs to be handled at the syntax extension level to recursively expand
macros.

The major use case for this is something like:

    macro_rules! mylog( ($fmt:expr $($arg:tt)*) => {
        error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*);
    })

Where the mylog macro will automatically prepend the filename/line number to the
beginning of every log message.
2013-10-31 13:46:10 -07:00
bors
b2f62acaeb auto merge of #10167 : briantdawn/rust/master, r=cmr
To keep consistency with the word "borrowing" I suppose an alternate way to write this could be "Having an object borrow an immutable pointer freezes it and prevents mutation".
2013-10-31 10:31:56 -07:00
Brian
986fb3c617 Fixed incorrect usage of 'Borrowing'. 2013-10-30 00:47:42 +00:00
Ziad Hatahet
3797f2bfe6 Capitalize statics in f32 and f64 mods
Fixes #10077
2013-10-28 19:35:56 -07:00
Alex Crichton
620ab3853a Test fixes and merge conflicts 2013-10-24 14:21:58 -07:00
Luqman Aden
b2b2095eaf Update the manual. 2013-10-22 21:37:42 -04:00
Michael Letterle
d83c5f7b1b Minor grammatical fixes and removed section on 'rust' tool 2013-10-22 14:30:27 -04:00
Alex Crichton
3ed18bdd42 Remove old logging from the tutorial 2013-10-22 08:10:34 -07:00
Adrien Tétar
22465e9561 doc: fix links to comply with the new rustdoc
Closes #9911.
2013-10-21 04:13:22 +02:00
Adrien Tétar
3995495c4a doc: expand tutorial/manual CSS
Cleanup, edit, add some Bootstrap v3.0.0 elements.
2013-10-21 04:12:58 +02:00
Adrien Tétar
8d97db48d4 doc: tidy and cleanup CSS deps, add tutorial PDF generation 2013-10-21 04:12:12 +02:00
Adrien Tétar
5d1fc864c7 doc/rust.HTML: proper version box 2013-10-19 20:31:53 +02:00
Adrien Tétar
f69795e443 doc: switch pandoc to html5 2013-10-19 20:29:34 +02:00
Sébastien Chauvel
62cb92d4ea doc (en & ja): remove mentions of type float, rust and rusti tools 2013-10-20 01:00:22 +02:00
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