]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agolibstd/librustc: Make the crate_map a weak symbol that libstd links against.
Luqman Aden [Wed, 18 Sep 2013 21:44:04 +0000 (17:44 -0400)]
libstd/librustc: Make the crate_map a weak symbol that libstd links against.

10 years agolibrustc/libstd: No longer pass crate_map to start.
Luqman Aden [Wed, 18 Sep 2013 08:58:52 +0000 (04:58 -0400)]
librustc/libstd: No longer pass crate_map to start.

10 years agoauto merge of #9296 : alexcrichton/rust/snapshots, r=cmr
bors [Wed, 18 Sep 2013 18:46:37 +0000 (11:46 -0700)]
auto merge of #9296 : alexcrichton/rust/snapshots, r=cmr

huzzah!

10 years agoRegister new snapshots
Alex Crichton [Tue, 17 Sep 2013 06:34:40 +0000 (23:34 -0700)]
Register new snapshots

10 years agoauto merge of #9277 : crabtw/rust/mips, r=brson
bors [Wed, 18 Sep 2013 16:15:56 +0000 (09:15 -0700)]
auto merge of #9277 : crabtw/rust/mips, r=brson

This patch fixes some errors of MIPS target, however, MIPS C ABI is still broken. I will send another PR to fix the problem.

Because MIPS target has no "generic" CPU name, I add --target-cpu and --target-feature to RUST_FLAGS. In order to workaround the "compact frame descriptions incompatible with DWARF2 .eh_frame" problem, the linker I used is CXX but not CC.

10 years agoauto merge of #9275 : blake2-ppc/rust/float-from-str, r=thestinger
bors [Wed, 18 Sep 2013 15:01:00 +0000 (08:01 -0700)]
auto merge of #9275 : blake2-ppc/rust/float-from-str, r=thestinger

std: Remove {float,f64,f32}::from_str in favor of from_str in the prelude

Like issue #9209, remove float::{from_str, from_str_radix} in favor of
the two corresponding traits. The same for modules f64 and f32.

New usage is:

    from_str::<float>("1.2e34")

10 years agoauto merge of #9272 : luqmana/rust/esln, r=catamorphism
bors [Wed, 18 Sep 2013 13:45:53 +0000 (06:45 -0700)]
auto merge of #9272 : luqmana/rust/esln, r=catamorphism

Fixes #9270

10 years agoauto merge of #9271 : brson/rust/extra-help, r=catamorphism
bors [Wed, 18 Sep 2013 12:30:58 +0000 (05:30 -0700)]
auto merge of #9271 : brson/rust/extra-help, r=catamorphism

Look like this now

```
    -Z FLAG             Set internal debugging options
    -v --version        Print version info and exit

Additional help:
    -W help             Print 'lint' options and default settings
    -Z help             Print internal options for debugging rustc

```

10 years agoauto merge of #9264 : ben0x539/rust/pp-work, r=alexcrichton
bors [Wed, 18 Sep 2013 11:15:56 +0000 (04:15 -0700)]
auto merge of #9264 : ben0x539/rust/pp-work, r=alexcrichton

Since 3b6314c the pretty printer seems to only print trait bounds for `ast::ty_path(...)`s that have a generics arguments list. That seems wrong, so let's always print them.

Closes #9253, un-xfails test for #7673.

10 years agoauto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson
bors [Wed, 18 Sep 2013 09:25:57 +0000 (02:25 -0700)]
auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson

Fix Rust build on mingw v4.0
See #9246 for details.

10 years agoauto merge of #9248 : DanRosenwasser/rust/master, r=alexcrichton
bors [Wed, 18 Sep 2013 07:15:55 +0000 (00:15 -0700)]
auto merge of #9248 : DanRosenwasser/rust/master, r=alexcrichton

Since `

10 years agoauto merge of #9281 : brson/rust/multistring, r=alexcrichton
bors [Wed, 18 Sep 2013 05:20:57 +0000 (22:20 -0700)]
auto merge of #9281 : brson/rust/multistring, r=alexcrichton

When `count` is `Some` this function was reading a byte past the end
of the buffer.

10 years agostd: Fix an invalid read in from_c_multistring
Brian Anderson [Wed, 18 Sep 2013 04:25:18 +0000 (21:25 -0700)]
std: Fix an invalid read in from_c_multistring

When `count` is `Some` this function was reading a byte past the end
of the buffer.

10 years agoAdded support for a `\0` escape sequence.
Daniel Rosenwasser [Tue, 17 Sep 2013 02:38:53 +0000 (22:38 -0400)]
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.

10 years agoauto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonw
bors [Wed, 18 Sep 2013 03:35:54 +0000 (20:35 -0700)]
auto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonw

10 years agofix compilation errors of mips target
Jyun-Yan You [Tue, 17 Sep 2013 17:58:07 +0000 (01:58 +0800)]
fix compilation errors of mips target

10 years agostd: Remove {float,f64,f32}::from_str in favor of from_str
blake2-ppc [Wed, 18 Sep 2013 00:17:47 +0000 (02:17 +0200)]
std: Remove {float,f64,f32}::from_str in favor of from_str

Like issue #9209, remove float::{from_str, from_str_radix} in favor of
the two corresponding traits. The same for modules f64 and f32.

New usage is

from_str::<float>("1.2e34")

10 years agoauto merge of #9258 : thestinger/rust/doc, r=catamorphism
bors [Wed, 18 Sep 2013 01:55:48 +0000 (18:55 -0700)]
auto merge of #9258 : thestinger/rust/doc, r=catamorphism

Closes #9144

10 years agoGenerate random big integers within a range
David Creswick [Thu, 12 Sep 2013 01:49:46 +0000 (20:49 -0500)]
Generate random big integers within a range

Thanks to @huonw for feedback

10 years agolibrustc: Respect #[link_name] on extern statics. Fixes #9270
Luqman Aden [Wed, 18 Sep 2013 01:03:56 +0000 (21:03 -0400)]
librustc: Respect #[link_name] on extern statics. Fixes #9270

10 years agoAdd an extra line before the "Additional Help" in rustc's --help output
Brian Anderson [Wed, 18 Sep 2013 00:55:18 +0000 (17:55 -0700)]
Add an extra line before the "Additional Help" in rustc's --help output

10 years agoauto merge of #9269 : alexcrichton/rust/ignore-rustpkg-test, r=brson
bors [Wed, 18 Sep 2013 00:15:45 +0000 (17:15 -0700)]
auto merge of #9269 : alexcrichton/rust/ignore-rustpkg-test, r=brson

@catamorphism says he has a fix coming soon, so I didn't allocate an issue for
it. If it festers for more than a few days I'll open something up though.

10 years agoIgnore a test which is blocking a snapshot
Alex Crichton [Wed, 18 Sep 2013 00:11:15 +0000 (17:11 -0700)]
Ignore a test which is blocking a snapshot

@catamorphism says he has a fix coming soon, so I didn't allocate an issue for
it. If it festers for more than a few days I'll open something up though.

10 years agodocument what unsafety means
Daniel Micay [Tue, 17 Sep 2013 18:38:27 +0000 (14:38 -0400)]
document what unsafety means

Closes #9144

10 years agoauto merge of #9257 : alexcrichton/rust/better-address-insignificant, r=thestinger
bors [Tue, 17 Sep 2013 22:20:44 +0000 (15:20 -0700)]
auto merge of #9257 : alexcrichton/rust/better-address-insignificant, r=thestinger

If a static is flagged as address_insignificant, then for LLVM to actually
perform the relevant optimization it must have an internal linkage type. What
this means, though, is that the static will not be available to other crates.
Hence, if you have a generic function with an inner static, it will fail to link
when built as a library because other crates will attempt to use the inner
static externally.

This gets around the issue by inlining the static into the metadata. The same
relevant optimization is then applied separately in the external crate. What
this ends up meaning is that all statics tagged with #[address_insignificant]
will appear at most once per crate (by value), but they could appear in multiple
crates.

This should be the last blocker for using format! ...

10 years agopp: also print bounds in paths with no generic params
Benjamin Herr [Tue, 17 Sep 2013 20:13:47 +0000 (22:13 +0200)]
pp: also print bounds in paths with no generic params

Since 3b6314c3 the pretty printer seems to only print trait bounds for
`ast::ty_path(...)`s that have a generics arguments list. That seems
wrong, so let's always print them.

Closes #9253, un-xfails test for #7673.

10 years agoauto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestinger
bors [Tue, 17 Sep 2013 21:05:45 +0000 (14:05 -0700)]
auto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestinger

A quick rundown:

- added `file::{readdir, stat, mkdir, rmdir}`
- Added access-constrained versions of `FileStream`; `FileReader` and `FileWriter` respectively
- big rework in `uv::file` .. most actions are by-val-self methods on `FsRequest`; `FileDescriptor` has gone the way of the dinosaurs
- playing nice w/ homing IO (I just copied ecr's work, hehe), etc
- added `FileInfo` trait, with an impl for `Path`
  - wrapper for file-specific actions, with the file path always implied by self's value
  - has the means to create `FileReader` & `FileWriter` (this isn't exposed in the top-level free function API)
  - has "safe" wrappers for `stat()` that won't throw in the event of non-existence/error (in this case, I mean `is_file` and `exists`)
  - actions should fail if done on non-regular-files, as appropriate
- added `DirectoryInfo` trait, with an impl for `Path`
  - pretty much ditto above, but for directories
  - added `readdir` (!!) to iterate over entries in a dir as a `~[Path]` (this was *brutal* to get working)

...<del>and lots of other stuff</del>not really. Do your worst!

10 years agopp: typo in comment
Benjamin Herr [Tue, 17 Sep 2013 17:45:14 +0000 (19:45 +0200)]
pp: typo in comment

10 years agoauto merge of #9256 : thestinger/rust/drop, r=alexcrichton
bors [Tue, 17 Sep 2013 19:50:46 +0000 (12:50 -0700)]
auto merge of #9256 : thestinger/rust/drop, r=alexcrichton

10 years agoPrevent a rare linkage issue with an xcrate static
Alex Crichton [Tue, 17 Sep 2013 18:24:05 +0000 (11:24 -0700)]
Prevent a rare linkage issue with an xcrate static

If a static is flagged as address_insignificant, then for LLVM to actually
perform the relevant optimization it must have an internal linkage type. What
this means, though, is that the static will not be available to other crates.
Hence, if you have a generic function with an inner static, it will fail to link
when built as a library because other crates will attempt to use the inner
static externally.

This gets around the issue by inlining the static into the metadata. The same
relevant optimization is then applied separately in the external crate. What
this ends up meaning is that all statics tagged with #[address_insignificant]
will appear at most once per crate (by value), but they could appear in multiple
crates.

This should be the last blocker for using format! ...

10 years agostd: fix win32 build issue re: multistring parsing
Jeff Olson [Tue, 17 Sep 2013 18:15:33 +0000 (11:15 -0700)]
std: fix win32 build issue re: multistring parsing

10 years agoauto merge of #9236 : steveklabnik/rust/rustpkg_init, r=catamorphism
bors [Tue, 17 Sep 2013 18:00:46 +0000 (11:00 -0700)]
auto merge of #9236 : steveklabnik/rust/rustpkg_init, r=catamorphism

Closes #9045

Built on top of #9235, which isn't strictly needed for now, but I imagine I will use part of. Unsure.

I mostly wanted to start this off to get some feedback from @catamorphism and others. These are the directories that actually need made, but I was thinking about adding a few other things:

1. an `examples` directory, since it seems like that's a common pattern
2. a `.gitignore` file that ignores `build`. And anything else that makes sense
3. a sample module that'd actually compile

Feedback?

10 years agoImplementing 'rustpkg init'.
Steve Klabnik [Mon, 16 Sep 2013 21:59:34 +0000 (14:59 -0700)]
Implementing 'rustpkg init'.

This will initialize a new workspace.

10 years agostd: whitespace clean up io::file docs
Jeff Olson [Tue, 17 Sep 2013 17:14:15 +0000 (10:14 -0700)]
std: whitespace clean up io::file docs

10 years agoremove unnecessary transmutes
Daniel Micay [Tue, 17 Sep 2013 15:44:59 +0000 (11:44 -0400)]
remove unnecessary transmutes

10 years agoauto merge of #9245 : kballard/rust/bytes-span, r=catamorphism
bors [Tue, 17 Sep 2013 15:45:44 +0000 (08:45 -0700)]
auto merge of #9245 : kballard/rust/bytes-span, r=catamorphism

This constrains the span to the appropriate argument, so you know which
one caused the problem. Instead of

    foo.rs:2:4: 2:21 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                ^~~~~~~~~~~~~~~~~

it will say

    foo.rs:2:14 2:17 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                          ^~~

10 years agostd: fix win32 build error in os::env()
Jeff Olson [Tue, 17 Sep 2013 15:40:31 +0000 (08:40 -0700)]
std: fix win32 build error in os::env()

10 years agostd: remove RtioStream
Jeff Olson [Tue, 17 Sep 2013 15:01:44 +0000 (08:01 -0700)]
std: remove RtioStream

10 years agoauto merge of #9244 : thestinger/rust/drop, r=catamorphism
bors [Tue, 17 Sep 2013 14:15:42 +0000 (07:15 -0700)]
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.

10 years agoauto merge of #9241 : alexcrichton/rust/build-rustdoc-ng, r=catamorphism
bors [Tue, 17 Sep 2013 13:00:45 +0000 (06:00 -0700)]
auto merge of #9241 : alexcrichton/rust/build-rustdoc-ng, r=catamorphism

Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).

Note that some `rustdoc_ng` tests were removed, but @cmr says they weren't supposed to be there in the first place. The rustdoc_ng code should also be included in `make install` and `make dist` now.

10 years agoauto merge of #9239 : steveklabnik/rust/rustpkg_tutorial, r=catamorphism
bors [Tue, 17 Sep 2013 11:45:45 +0000 (04:45 -0700)]
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.

10 years agoauto merge of #9234 : steveklabnik/rust/rustpkg_manpage, r=cmr
bors [Tue, 17 Sep 2013 10:30:48 +0000 (03:30 -0700)]
auto merge of #9234 : steveklabnik/rust/rustpkg_manpage, r=cmr

Closes #9221.

"rustpkg test" isn't implemented yet, so it shouldn't be in the manpage. Referring interested parties to the manual is probably
the right thing for now; eventually, these documents should merge.

/cc @catamorphism

10 years agoauto merge of #9225 : huonw/rust/closing-time, r=alexcrichton
bors [Tue, 17 Sep 2013 09:15:49 +0000 (02:15 -0700)]
auto merge of #9225 : huonw/rust/closing-time, r=alexcrichton

Closes #2074.
Closes #5008.
Closes #7519.
Closes #7673.
Closes #7770.
Closes #8171.

10 years agoDisabled tests which now fail on Windows+mingw4.0 due to GCC 4.8 ABI change (#9205).
Vadim Chugunov [Tue, 17 Sep 2013 07:42:16 +0000 (00:42 -0700)]
Disabled tests which now fail on Windows+mingw4.0 due to GCC 4.8 ABI change (#9205).
These really should have been marked xfail-win32, but that doesn't exist, so xfail-fast it is.

10 years agoThe purpose of these headers is to fix issues with mingw v4.0, as described in #9246.
Vadim Chugunov [Tue, 17 Sep 2013 08:06:01 +0000 (01:06 -0700)]
The purpose of these headers is to fix issues with mingw v4.0, as described in #9246.

This works by adding this directory to GCC include search path before mingw system headers directories,
so we can intercept their inclusions and add missing definitions without having to modify files in mingw/include.

10 years agoTests for fixed issues.
Huon Wilson [Mon, 16 Sep 2013 13:05:47 +0000 (23:05 +1000)]
Tests for fixed issues.

Closes #2074.
Closes #5008.
Closes #7519.
Closes #7673.
Closes #7770.
Closes #8171.

10 years agoauto merge of #9214 : adridu59/rust/issue-7723, r=thestinger
bors [Tue, 17 Sep 2013 08:00:47 +0000 (01:00 -0700)]
auto merge of #9214 : adridu59/rust/issue-7723, r=thestinger

This avoids default CRLF on msysgit for Windows which can cause trouble.
Cf. https://help.github.com/articles/dealing-with-line-endings#text-eollf

Closes #7723.

10 years agoauto merge of #9130 : alexcrichton/rust/inline-globals, r=thestinger
bors [Tue, 17 Sep 2013 06:45:49 +0000 (23:45 -0700)]
auto merge of #9130 : alexcrichton/rust/inline-globals, r=thestinger

In #8185 cross-crate condition handlers were fixed by ensuring that globals
didn't start appearing in different crates with different addressed. An
unfortunate side effect of that pull request is that constants weren't inlined
across crates (uint::bits is unknown to everything but libstd).

This commit fixes this inlining by using the `available_eternally` linkage
provided by LLVM. It partially reverts #8185, and then adds support for this
linkage type. The main caveat is that not all statics could be inlined into
other crates. Before this patch, all statics were considered "inlineable items",
but an unfortunate side effect of how we deal with `&static` and `&[static]`
means that these two cases cannot be inlined across crates. The translation of
constants was modified to propogate this condition of whether a constant
should be considered inlineable into other crates.

Closes #9036

10 years agostd: merge conflict cleanup from std::str
Jeff Olson [Tue, 17 Sep 2013 06:39:33 +0000 (23:39 -0700)]
std: merge conflict cleanup from std::str

10 years agostd: docstring fixes in io::file
Jeff Olson [Tue, 17 Sep 2013 06:36:39 +0000 (23:36 -0700)]
std: docstring fixes in io::file

10 years agostd: minor cleanup in some io_error descs in io::file
Jeff Olson [Tue, 17 Sep 2013 06:13:16 +0000 (23:13 -0700)]
std: minor cleanup in some io_error descs in io::file

10 years agostd: lots of docs for std::rt::io::file
Jeff Olson [Tue, 17 Sep 2013 06:10:03 +0000 (23:10 -0700)]
std: lots of docs for std::rt::io::file

i hope they don't bitrot

10 years agostd: FsRequest.req_boilerplate() be &mut self
Jeff Olson [Tue, 17 Sep 2013 04:58:49 +0000 (21:58 -0700)]
std: FsRequest.req_boilerplate() be &mut self

10 years agostd: remove impl'd/commented-out fstat signatures
Jeff Olson [Tue, 17 Sep 2013 04:57:17 +0000 (21:57 -0700)]
std: remove impl'd/commented-out fstat signatures

10 years agostd: generlize & move io::file::suppressed_stat to io::ignore_io_error
Jeff Olson [Tue, 17 Sep 2013 04:56:51 +0000 (21:56 -0700)]
std: generlize & move io::file::suppressed_stat to io::ignore_io_error

10 years agostd: correctly pass STDOUT in to naive_print test fn
Jeff Olson [Mon, 16 Sep 2013 22:33:19 +0000 (15:33 -0700)]
std: correctly pass STDOUT in to naive_print test fn

10 years agostd: unignore some file io tests that work on windows, now
Jeff Olson [Mon, 16 Sep 2013 21:02:35 +0000 (14:02 -0700)]
std: unignore some file io tests that work on windows, now

10 years agostd: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanup
Jeff Olson [Mon, 16 Sep 2013 20:25:10 +0000 (13:25 -0700)]
std: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanup

10 years agostd: expose more stat info
Jeff Olson [Mon, 16 Sep 2013 20:24:23 +0000 (13:24 -0700)]
std: expose more stat info

10 years agostd: more work on from_c_multistring.. let it take an optional len param
Jeff Olson [Mon, 16 Sep 2013 20:20:58 +0000 (13:20 -0700)]
std: more work on from_c_multistring.. let it take an optional len param

10 years agostd: clean up Dir/FileInfo inheritence and flesh out Dir Info
Jeff Olson [Sun, 15 Sep 2013 19:23:53 +0000 (12:23 -0700)]
std: clean up Dir/FileInfo inheritence and flesh out Dir Info

10 years agostd: win32 os::env() str parsing to str::raw::from_c_multistring + test
Jeff Olson [Sat, 14 Sep 2013 16:35:11 +0000 (09:35 -0700)]
std: win32 os::env() str parsing to str::raw::from_c_multistring + test

10 years agostd: adding file::{stat,mkdir,rmdir}, FileInfo and FileReader/FileWriter
Jeff Olson [Sat, 14 Sep 2013 16:33:53 +0000 (09:33 -0700)]
std: adding file::{stat,mkdir,rmdir}, FileInfo and FileReader/FileWriter

add ignores for win32 tests on previous file io stuff...

10 years agomerge cleanup
Jeff Olson [Tue, 3 Sep 2013 03:23:12 +0000 (20:23 -0700)]
merge cleanup

10 years agostd/rt: in-progress file io work
Jeff Olson [Mon, 26 Aug 2013 14:24:10 +0000 (07:24 -0700)]
std/rt: in-progress file io work

std: remove unneeded field from RequestData struct

std: rt::uv::file - map us_fs_stat & start refactoring calls into FsRequest

std: stubbing out stat calls from the top-down into uvio

std: us_fs_* operations are now by-val self methods on FsRequest

std: post-rebase cleanup

std: add uv_fs_mkdir|rmdir + tests & minor test cleanup in rt::uv::file

WORKING: fleshing out FileStat and FileInfo + tests

std: reverting test files..

refactoring back and cleanup...

10 years agoauto merge of #9237 : brson/rust/valgrind, r=thestinger
bors [Tue, 17 Sep 2013 05:30:51 +0000 (22:30 -0700)]
auto merge of #9237 : brson/rust/valgrind, r=thestinger

This fixes valgrind on the linux snapshot bot. The command added here
makes us require a fairly recent valgrind.

10 years agoauto merge of #9233 : catamorphism/rust/issue-4208, r=catamorphism
bors [Tue, 17 Sep 2013 04:15:51 +0000 (21:15 -0700)]
auto merge of #9233 : catamorphism/rust/issue-4208, r=catamorphism

Closes #4208

10 years agoauto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton
bors [Tue, 17 Sep 2013 02:35:50 +0000 (19:35 -0700)]
auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton

Fix uint overflow bugs in std::{at_vec, vec, str}

Closes #8742

Fix issue #8742, which summarized is: unsafe code in vec and str did assume
that a reservation for `X + Y` elements always succeeded, and didn't overflow.

Introduce the method `Vec::reserve_additional(n)` to make it easy to check for
overflow in `Vec::push` and `Vec::push_all`.

In std::str, simplify and remove a lot of the unsafe code and use `push_str`
instead. With improvements to `.push_str` and the new function
`vec::bytes::push_bytes`, it looks like this change has either no or positive
impact on performance.

I believe there are many places still where `v.reserve(A + B)` still can overflow.
This by itself is not an issue unless followed by (unsafe) code that steps aside
boundary checks.

10 years agoswitch Drop to `&mut self`
Daniel Micay [Tue, 17 Sep 2013 01:18:07 +0000 (21:18 -0400)]
switch Drop to `&mut self`

10 years agoLimit spans in bytes!() error messages to the argument in question
Kevin Ballard [Tue, 17 Sep 2013 01:02:33 +0000 (18:02 -0700)]
Limit spans in bytes!() error messages to the argument in question

This constrains the span to the appropriate argument, so you know which
one caused the problem. Instead of

  foo.rs:2:4: 2:21 error: Too large integer literal in bytes!
  foo.rs:2    bytes!(1, 256, 2)
              ^~~~~~~~~~~~~~~~~

it will say

  foo.rs:2:14 2:17 error: Too large integer literal in bytes!
  foo.rs:2    bytes!(1, 256, 2)
                        ^~~

10 years agoUpdating rustpkg tutorial from feedback.
Steve Klabnik [Tue, 17 Sep 2013 01:49:47 +0000 (18:49 -0700)]
Updating rustpkg tutorial from feedback.

10 years agoAdd the rustdoc_ng binary to the makefile rules
Alex Crichton [Mon, 16 Sep 2013 23:31:04 +0000 (16:31 -0700)]
Add the rustdoc_ng binary to the makefile rules

Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).

10 years agoauto merge of #9231 : cmr/rust/enum_encoding, r=catamorphism
bors [Tue, 17 Sep 2013 00:55:46 +0000 (17:55 -0700)]
auto merge of #9231 : cmr/rust/enum_encoding, r=catamorphism

10 years agostd::at_vec: Fix segfault on overflow when resizing ~[@T]
blake2-ppc [Thu, 12 Sep 2013 03:00:25 +0000 (05:00 +0200)]
std::at_vec: Fix segfault on overflow when resizing ~[@T]

Easy to reproduce:

    let mut v = ~[@1];
    v.resize(-1);  // success a.k.a silent failure
    v.push(@2); // segfault

10 years agort::io: Use vec::reserve_additional
blake2-ppc [Tue, 10 Sep 2013 23:57:08 +0000 (01:57 +0200)]
rt::io: Use vec::reserve_additional

10 years agostd::str: Fix overflow problems in unsafe code
blake2-ppc [Tue, 10 Sep 2013 22:53:21 +0000 (00:53 +0200)]
std::str: Fix overflow problems in unsafe code

See issue #8742

10 years agoNew rustpkg tutorial.
Steve Klabnik [Mon, 16 Sep 2013 23:30:49 +0000 (16:30 -0700)]
New rustpkg tutorial.

10 years agoUpdate syntax test
Corey Richardson [Mon, 16 Sep 2013 23:12:54 +0000 (19:12 -0400)]
Update syntax test

10 years agoauto merge of #9109 : thestinger/rust/function, r=alexcrichton
bors [Mon, 16 Sep 2013 22:50:47 +0000 (15:50 -0700)]
auto merge of #9109 : thestinger/rust/function, r=alexcrichton

10 years agoset attributes on `invoke` instructions too
Daniel Micay [Mon, 16 Sep 2013 22:30:59 +0000 (18:30 -0400)]
set attributes on `invoke` instructions too

also removes the unused `FastInvoke` wrapper, as it's never actually
going to be used (we can't *partially* switch to `fastcc`, and this is
only used for Rust functions)

10 years agomk: Fix valgrinding with jemalloc
Brian Anderson [Mon, 16 Sep 2013 22:25:01 +0000 (15:25 -0700)]
mk: Fix valgrinding with jemalloc

This fixes valgrind on the linux snapshot bot. The command added here
makes us require a fairly recent valgrind.

10 years agoFix hardcoded string in libsyntax
Corey Richardson [Mon, 16 Sep 2013 21:12:53 +0000 (17:12 -0400)]
Fix hardcoded string in libsyntax

10 years agoUpdate rustpkg man page.
Steve Klabnik [Mon, 16 Sep 2013 20:51:02 +0000 (13:51 -0700)]
Update rustpkg man page.

Closes #9221.

"rustpkg test" isn't implemented yet, so it shouldn't be in the manpage. Referring interested parties to the manual is probably
the right thing for now; eventually, these documents should merge.

10 years agoauto merge of #9223 : sfackler/rust/tasks-fix, r=catamorphism
bors [Mon, 16 Sep 2013 20:30:42 +0000 (13:30 -0700)]
auto merge of #9223 : sfackler/rust/tasks-fix, r=catamorphism

This module was removed a while ago, but the tasks tutorial wasn't
updated, and the old docs page for pipes was never deleted so the link
confusingly still worked!

10 years agotestsuite: Add test for #4208
Tim Chevalier [Mon, 16 Sep 2013 19:02:27 +0000 (12:02 -0700)]
testsuite: Add test for #4208

Closes #4208

10 years agoauto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichton
bors [Mon, 16 Sep 2013 18:30:42 +0000 (11:30 -0700)]
auto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichton

10 years agodocument why attributes are set on CallInst
Daniel Micay [Fri, 13 Sep 2013 04:48:49 +0000 (00:48 -0400)]
document why attributes are set on CallInst

10 years agoadd sret + noalias to the out pointer parameter
Daniel Micay [Tue, 10 Sep 2013 18:28:59 +0000 (14:28 -0400)]
add sret + noalias to the out pointer parameter

This brings Rust in line with how `clang` handles return pointers.

Example:

    pub fn bar() -> [uint, .. 8] {
        let a = [0, .. 8];
        a
    }

Before:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* nocapture, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %a = alloca [8 x i64], align 8
      %2 = bitcast [8 x i64]* %a to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      %3 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 64, i32 8, i1 false)
      ret void
    }

After:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %2 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      ret void
    }

Closes #9072
Closes #7298
Closes #9154

10 years agofix handling of function attributes
Daniel Micay [Tue, 10 Sep 2013 22:42:01 +0000 (18:42 -0400)]
fix handling of function attributes

The `noalias` attributes were being set only on function definitions,
not on all declarations. This is harmless for `noalias`, but prevented
some optimization opportunities and is *not* harmless for other
attributes like `sret` with ABI implications.

Closes #9104

10 years agoauto merge of #9204 : lkuper/rust/workcache, r=alexcrichton
bors [Mon, 16 Sep 2013 17:15:43 +0000 (10:15 -0700)]
auto merge of #9204 : lkuper/rust/workcache, r=alexcrichton

This just removes the stray "foo.c" that `workcache::test` leaves behind when, for example, `make check` runs.

10 years agostd::str: Add bench tests for StrVector::connect() and for str::push_str
blake2-ppc [Wed, 11 Sep 2013 00:16:11 +0000 (02:16 +0200)]
std::str: Add bench tests for StrVector::connect() and for str::push_str

10 years agostd::vec: Add function vec::bytes::push_bytes
blake2-ppc [Tue, 10 Sep 2013 22:52:46 +0000 (00:52 +0200)]
std::vec: Add function vec::bytes::push_bytes

`push_bytes` is implemented with `ptr::copy_memory` here since this
function is intended to be used to implement `.push_str()` for str, so
we want to avoid the overhead.

10 years agostd::vec: Fix hazards with uint overflows in unsafe code
blake2-ppc [Tue, 10 Sep 2013 21:29:10 +0000 (23:29 +0200)]
std::vec: Fix hazards with uint overflows in unsafe code

Issue #8742

Add the method `.reserve_additional(n: uint)`: Check for overflow in
self.len() + n, and reserve that many elements (rounded up to next power
of two). Does nothing if self.len() + n < self.capacity() already.

10 years agoextra::json: use a different encoding for enums.
Corey Richardson [Sat, 10 Aug 2013 00:05:24 +0000 (20:05 -0400)]
extra::json: use a different encoding for enums.

It now uses `{"type": VariantName, "fields": [...]}`, which, according to
@Seldaek, since all enums will have the same "shape" rather than being a weird
ad-hoc array, will optimize better in javascript JITs. It also looks prettier,
and makes more sense.

10 years agoauto merge of #9192 : Kimundi/rust/master, r=huonw
bors [Mon, 16 Sep 2013 16:00:44 +0000 (09:00 -0700)]
auto merge of #9192 : Kimundi/rust/master, r=huonw

A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.

Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.

SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.

This basically reimplements #7599 and has a use case for replacing an similar type in `std::rt::logging` ( Added in #9180).

10 years agoCorrected a few small style issues
Marvin Löbel [Sun, 15 Sep 2013 12:06:30 +0000 (14:06 +0200)]
Corrected a few small style issues
Split up test function a bit

10 years agogitattributes: force LF line endings for all files
adridu59 [Sun, 15 Sep 2013 21:32:18 +0000 (23:32 +0200)]
gitattributes: force LF line endings for all files

This avoids default CRLF on msysgit for Windows which can cause trouble.
Cf. https://help.github.com/articles/dealing-with-line-endings#text-eollf

Commit dad2ccc9b3b27d3f438eeea53b771cc85f6dfa32 followup.
Closes #7723.

10 years agoAdd an SendStr type
Marvin Löbel [Sat, 14 Sep 2013 17:37:45 +0000 (19:37 +0200)]
Add an SendStr type

A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.

Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.

SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.

Replaced std::rt:logging::SendableString with SendStr
Added tests for using an SendStr as key in Hash- and Treemaps

10 years agoauto merge of #9121 : sanxiyn/rust/arm, r=alexcrichton
bors [Mon, 16 Sep 2013 14:45:45 +0000 (07:45 -0700)]
auto merge of #9121 : sanxiyn/rust/arm, r=alexcrichton

Ignore failing tests on Android to prepare for #9120.

10 years agoResume inlining globals across crates
Alex Crichton [Wed, 11 Sep 2013 17:06:16 +0000 (10:06 -0700)]
Resume inlining globals across crates

In #8185 cross-crate condition handlers were fixed by ensuring that globals
didn't start appearing in different crates with different addressed. An
unfortunate side effect of that pull request is that constants weren't inlined
across crates (uint::bits is unknown to everything but libstd).

This commit fixes this inlining by using the `available_eternally` linkage
provided by LLVM. It partially reverts #8185, and then adds support for this
linkage type. The main caveat is that not all statics could be inlined into
other crates. Before this patch, all statics were considered "inlineable items",
but an unfortunate side effect of how we deal with `&static` and `&[static]`
means that these two cases cannot be inlined across crates. The translation of
constants was modified to propogate this condition of whether a constant
should be considered inlineable into other crates.

Closes #9036