Commit Graph

31265 Commits

Author SHA1 Message Date
nham
6df514b061 Use byte literals in libcore 2014-08-06 02:30:17 -04:00
nham
3fb78e29f4 Use byte literals in libstd 2014-08-06 02:02:50 -04:00
nham
dfdea3f116 Use byte literals in libsyntax 2014-08-06 01:31:48 -04:00
nham
20d1ad9b59 Use byte literal in libnum 2014-08-06 01:29:26 -04:00
nham
daf432e8b6 Use byte literals in libterm 2014-08-06 01:25:48 -04:00
nham
30cfce3d92 Use a byte literal in libregex 2014-08-06 01:18:19 -04:00
nham
1c2c4942a6 Use byte literals in libdebug 2014-08-06 01:14:31 -04:00
nham
d45a569995 Use byte literals in libserialize 2014-08-06 01:07:10 -04:00
nham
f36ddf1d0e Use byte literals in libcollections tests 2014-08-06 00:57:49 -04:00
bors
f5ac41185a auto merge of #16247 : TimDumol/rust/patch-1, r=alexcrichton
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2014-08-05 19:06:23 +00:00
bors
6da38890f1 auto merge of #15709 : hirschenberger/rust/issue-14269, r=cmr
Fixes missing overflow lint for i64 #14269

The `type_overflow` lint, doesn't catch the overflow for `i64` because the overflow happens earlier in the parse phase when the `u64` as biggest possible int gets casted to `i64` , without checking the for
overflows.
We can't lint in the parse phase, so we emit a compiler error, as we do for overflowing `u64`

Perhaps a consistent behaviour would be to emit a parse error for *all*  overflowing integer types.

See #14269
2014-08-05 17:21:23 +00:00
bors
ce83301f8c auto merge of #16246 : ruud-v-a/rust/patch-1, r=brson 2014-08-05 15:36:23 +00:00
bors
fd02916f0e auto merge of #16243 : alexcrichton/rust/fix-utime-for-windows, r=brson
Apparently the units are in milliseconds, not in seconds!
2014-08-05 13:11:20 +00:00
bors
cbdae97689 auto merge of #16234 : cakebaker/rust/rename_guessing_game_rs_to_main_rs, r=steveklabnik
Follow-up to #16215
2014-08-05 11:31:22 +00:00
bors
fde58d95af auto merge of #16231 : michaelsproul/rust/gedit-macro, r=alexcrichton
Gedit currently lacks syntax highlighting for macros.
2014-08-05 09:51:23 +00:00
bors
157459be59 auto merge of #16216 : omasanori/rust/nfkc, r=brson
The reference manual said that code is interpreted as UTF-8 text and a implementation will normalize it to NFKC. However, rustc doesn't do any normalization now.

We may want to do any normalization for symbols, but normalizing whole text seems harmful because doing so loses some sort of information even if we choose a non-K variant of normalization.

I'd suggest removing "normalized to Unicode normalization form NFKC" phrase for the present so that the manual represents the current state properly. When we address the problem (with a RFC?), then the manual should be updated.

Closes #12388.

Reference: https://github.com/rust-lang/rust/issues/2253
2014-08-05 08:06:25 +00:00
Falco Hirschenberger
0dc215741b Fixes missing overflow lint for i64 #14269
The `type_overflow` lint, doesn't catch the overflow for `i64` because
the overflow happens earlier in the parse phase when the `u64` as biggest
possible int gets casted to `i64` , without checking the for overflows.
We can't lint in the parse phase, so a refactoring of the `LitInt` type
was necessary.

The types `LitInt`, `LitUint` and `LitIntUnsuffixed` where merged to one
type `LitInt` which stores it's value as `u64`. An additional parameter was
added which indicate the signedness of the type and the sign of the value.
2014-08-05 09:59:03 +02:00
bors
ade92c6e35 auto merge of #16188 : nham/rust/immut_slice_split_at, r=brson
This operation seems common enough that it would be convenient for it to be a standard method.
2014-08-05 03:21:27 +00:00
bors
4b54110c33 auto merge of #16187 : steveklabnik/rust/gh15830, r=alexcrichton
Fixes #15830.
2014-08-05 01:41:25 +00:00
bors
6bb72600cc auto merge of #16179 : SimonPersson/rust/master, r=brson
This should solve issue 14848 for ARM.
2014-08-05 00:01:28 +00:00
bors
463d6680d1 auto merge of #16110 : alexcrichton/rust/issue-15460, r=brson
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not
actually guaranteed to link the library at all. The reason for this is that if
the external library doesn't have any referenced symbols in the object generated
by rustc, the entire library is dropped by the linker.

For dynamic native libraries, this is solved by passing -lfoo for all downstream
compilations unconditionally. For static libraries in rlibs this is solved
because the entire archive is bundled in the rlib. The only situation in which
this was a problem was when a static native library was linked to a rust dynamic
library.

This commit brings the behavior of dylibs in line with rlibs by passing the
--whole-archive flag to the linker when linking native libraries. On OSX, this
uses the -force_load flag. This flag ensures that the entire archive is
considered candidate for being linked into the final dynamic library.

This is a breaking change because if any static library is included twice in the
same compilation unit then the linker will start emitting errors about duplicate
definitions now. The fix for this would involve only statically linking to a
library once.

Closes #15460
[breaking-change]
2014-08-04 22:21:25 +00:00
Steve Klabnik
acf66b1027 Clarify Argument docs.
Fixes #15830.
2014-08-04 18:05:10 -04:00
bors
9de20198ae auto merge of #16251 : apoelstra/rust/tcp-fix, r=alexcrichton
Replacement for PR #16208 (make sockaddr* struct padding explicit) to make PR #15763 (fix nested returns) merge without breaking TCP code.
2014-08-04 20:41:25 +00:00
Andrew Poelstra
30452d4cda Change everything returning libc::sockaddr_storage to use an &mut out-ptr instead
The BSD socket code does some cast tricks with the `libc::sockaddr*`
structs, which causes useful data to be stored in struct padding.
Since Load/Store instructions do not copy struct padding, this makes
these structures dangerous to pass or return by value.

In particular, https://github.com/rust-lang/rust/issues/15763 changes
return semantics so that a Load instruction is used, breaking the TCP
code. Once this PR is merged, that one should merge without error.
2014-08-04 12:52:58 -07:00
Tim Joseph Dumol
a9979ada47 doc: Fix the 30-minute intro to use += operator.
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2014-08-05 02:02:41 +08:00
Alex Crichton
1ae1461fbf rustc: Link entire archives of native libraries
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not
actually guaranteed to link the library at all. The reason for this is that if
the external library doesn't have any referenced symbols in the object generated
by rustc, the entire library is dropped by the linker.

For dynamic native libraries, this is solved by passing -lfoo for all downstream
compilations unconditionally. For static libraries in rlibs this is solved
because the entire archive is bundled in the rlib. The only situation in which
this was a problem was when a static native library was linked to a rust dynamic
library.

This commit brings the behavior of dylibs in line with rlibs by passing the
--whole-archive flag to the linker when linking native libraries. On OSX, this
uses the -force_load flag. This flag ensures that the entire archive is
considered candidate for being linked into the final dynamic library.

This is a breaking change because if any static library is included twice in the
same compilation unit then the linker will start emitting errors about duplicate
definitions now. The fix for this would involve only statically linking to a
library once.

Closes #15460
[breaking-change]
2014-08-04 11:02:26 -07:00
bors
efe1f7ee9e auto merge of #15986 : Florob/rust/nfKc-new, r=alexcrichton
This adds a new `Recompositions` iterator, which performs canonical composition on the result of the `Decompositions` iterator (which is canonical or compatibility decomposition). In effect this implements Unicode normalization forms C and KC.
2014-08-04 17:06:19 +00:00
Ruud van Asseldonk
662f58f5a3 docs: Fix typo in tutorial. 2014-08-04 18:01:54 +02:00
Daniel Hofstetter
d0bd10b891 Rename guessing_game.rs to main.rs in guide 2014-08-04 16:41:37 +02:00
bors
31590bd349 auto merge of #16235 : cakebaker/rust/rename_modules_rs_to_main_rs, r=steveklabnik 2014-08-04 14:41:18 +00:00
Daniel Hofstetter
c586bf21aa Rename modules.rs to main.rs in guide 2014-08-04 16:23:46 +02:00
bors
795f6ae829 auto merge of #16213 : huonw/rust/more-token-numbers, r=pnkfelix
Using the Show impl for Names created global symbols with names like
`"str\"str\"(1027)"`. This adjusts strings, binaries and vtables to
avoid using that impl.
2014-08-04 07:01:10 +00:00
Huon Wilson
e753dbb431 rustc: use Name numbers rather than the Show impl for constants.
Using the Show impl for Names created global symbols with names like
`"str\"str\"(1027)"`. This adjusts strings, binaries and vtables to
avoid using that impl.

Fixes #15799.
2014-08-04 16:32:35 +10:00
bors
765a23f73d auto merge of #16233 : omasanori/rust/abs_sub, r=steveklabnik
Use proper argument names and unbackquote the word "zero" because it is not an identifier.
2014-08-04 05:16:35 +00:00
OGINO Masanori
3e6edee002 num: Fix the documentation of abs_sub.
Use proper argument names and unbackquote the word "zero" because it is
not an identifier.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-04 14:04:28 +09:00
bors
d3ac386ea9 auto merge of #16139 : michaelwoerister/rust/rlib-bc-versioning, r=alexcrichton
Before this commit, the LLVM IR of exported items was simply zip-compressed and stored as an object file inside rlib archives. This commit adds a header to this "object" containing a file identifier and a format version number so the compiler can deal with changes in the way bytecode objects are stored within rlibs.

While updating the format of bytecode objects, this commit also worksaround a problem in LLDB which could not handle odd-sized objects within archives before mid-2014.

Fixes #15950.
2014-08-04 01:31:09 +00:00
Michael Sproul
806e4f0b14 Gedit/GTKSourceView: Add macro syntax highlighting. 2014-08-04 11:28:37 +10:00
bors
25741603fe auto merge of #16215 : cakebaker/rust/remove_bin_section_from_toml, r=alexcrichton
According to the [source code](https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_new.rs#L31) <code>cargo new</code> doesn't generate a <code>[[bin]]</code> section in the <code>Cargo.toml</code>, hence removing it from the example.
2014-08-03 23:46:10 +00:00
Michael Woerister
ff0fa8f1d1 Use a versioning scheme for bytecode objects in rlibs.
Before this commit, the LLVM IR of exported items was simply zip-compressed and stored as an object file inside rlib archives. This commit adds a header to this "object" containing a file identifier and a format version number so the compiler can deal with changes in the way bytecode objects are stored within rlibs.

While updating the format of bytecode objects, this commit also worksaround a problem in LLDB which could not handle odd-sized objects within archives before mid-2014.
2014-08-03 20:27:06 +02:00
bors
d34e011b8e auto merge of #16209 : tomjakubowski/rust/rustdoc-html-changes, r=alexcrichton
This PR introduces a couple of minor changes to the rustdoc html templates:

1. The `<meta name="generator" content="rustdoc">` tag now appears in API documentation as well.
2. Adds a `rustdoc` class to the top-level `<body>` tag on all HTML pages.

The second point is a nice-to-have for those who would like to apply a user stylesheet to Rust documentation regardless of where it is hosted. Easier use of user stylesheets may alleviate much of the bikeshedding of personal taste on the rustdoc styles.
2014-08-03 17:01:06 +00:00
OGINO Masanori
bf2d98e190 Remove the "NFKC clause" in the reference manual.
The reference manual said that code is interpreted as UTF-8 text and a
implementation will normalize it to NFKC. However, rustc doesn't do
any normalization now.

We may want to do any normalization for symbols, but normalizing whole
text seems harmful because doing so loses some sort of information even
if we choose a non-K variant of normalization.

I'd suggest removing "normalized to Unicode normalization form NFKC"
phrase for the present so that the manual represents the current state
properly. When we address the problem (with a RFC?), then the manual
should be updated.

Closes #12388.

Reference: https://github.com/rust-lang/rust/issues/2253

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-03 23:41:05 +09:00
bors
8b9ab0d912 auto merge of #16212 : huonw/rust/unicode-gitignore, r=pnkfelix 2014-08-03 14:01:06 +00:00
Daniel Hofstetter
7ba9c44b94 Remove "bin" section from Cargo.toml 2014-08-03 14:19:05 +02:00
bors
845ff6567f auto merge of #16203 : Gankro/rust/vec_flow, r=alexcrichton
fixes #16200
2014-08-03 11:36:07 +00:00
bors
9a3b25fa98 auto merge of #16202 : db48x/rust/eq-for-time-tm, r=alexcrichton 2014-08-03 09:56:07 +00:00
bors
ed264286dd auto merge of #16198 : cakebaker/rust/remove_unused_tuple_struct, r=steveklabnik 2014-08-03 08:11:10 +00:00
Huon Wilson
c41c1edf3b gitignore: Add the autogenerated/downloaded unicode data files. 2014-08-03 17:32:53 +10:00
bors
ce01b4b1b7 auto merge of #16155 : huonw/rust/Ordering-reverse, r=alexcrichton
This flips the comparison and is designed to be used when sorting etc.
2014-08-03 06:31:09 +00:00
bors
055e25acbe auto merge of #16194 : omasanori/rust/gitignore, r=alexcrichton
I also sorted lines in .gitignore. The file might include some obsoleted lines but I left.
2014-08-03 04:51:10 +00:00
bors
46d1ee72ac auto merge of #16191 : DaGenix/rust/fix-aligned-access, r=alexcrichton
When I originally wrote the read_u32v_be() and write_u32_be() functions, I didn't consider memory alignment requirements of various architectures. Unfortunately, the current implementations may result in unaligned reads and writes. This doesn't impact x86 / x86_64, but it can cause a compiler crash on ARM. This pull requests rewrites those functions to make sure that all memory access is always correctly aligned.

This fix is a little bit academic - due to the way that LLVM aligns the structures that are passed as arguments to these functions, I believe that the end result is that all memory access happens to be aligned anyway. However, there is nothing in that code that actually enforces that, at least not explicitly. The new implementations are definitely slower than the existing ones. However, I don't believe that these functions are all that significant when looking at the overall performance of the compiler. I think getting rid of some unsafe code and removing a potential portability landmine justifies a very slight decrease in raw performance.
2014-08-03 03:06:12 +00:00