Commit Graph

31270 Commits

Author SHA1 Message Date
Alexis Beingessner e8006f3c74 Make small doc contributions less onerous/intimidating 2014-08-08 19:36:32 -04:00
bors 8fcfd02d85 auto merge of #16276 : nham/rust/fix_marker_docs, r=steveklabnik 2014-08-06 13:21:27 +00:00
bors b09a02b415 auto merge of #16263 : brson/rust/morestack, r=alexcrichton 2014-08-06 10:26:30 +00:00
bors 84782c4e26 auto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichton
This commit stabilizes the `std::sync::atomics` module, renaming it to
`std::sync::atomic` to match library precedent elsewhere, and tightening
up behavior around incorrect memory ordering annotations.

The vast majority of the module is now `stable`. However, the
`AtomicOption` type has been deprecated, since it is essentially unused
and is not truly a primitive atomic type. It will eventually be replaced
by a higher-level abstraction like MVars.

Due to deprecations, this is a:

[breaking-change]
2014-08-06 08:31:28 +00:00
bors 223c043110 auto merge of #16254 : brson/rust/rustdocmeta, r=aturon
This teach rustdoc to add `<meta name="description">` and `<meta name="keywords">` tags to crate docs. Description is important for search engines because they display it as the page description. Keywords are less useful but still generally recommended.

This also changes the "stability dashboard" link to just say "stability", because the current link takes up a lot of space.

cc https://github.com/rust-lang/rust/issues/12466
2014-08-06 04:56:25 +00:00
bors 2a47fa708c auto merge of #16252 : conradkleinespel/rust/master, r=alexcrichton
I found the current docs to be a little confusing. I believe this makes them straight to the point and less confusing.
2014-08-06 03:11:29 +00:00
nham 8650040b8a Remove references to `~[]` in core::kinds::marker docs. 2014-08-05 15:23:23 -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
Brian Anderson 140825218d Remove obsolete stack growth tests 2014-08-04 21:52:57 -07: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
Aaron Turon 68bde0a073 stabilize atomics (now atomic)
This commit stabilizes the `std::sync::atomics` module, renaming it to
`std::sync::atomic` to match library precedent elsewhere, and tightening
up behavior around incorrect memory ordering annotations.

The vast majority of the module is now `stable`. However, the
`AtomicOption` type has been deprecated, since it is essentially unused
and is not truly a primitive atomic type. It will eventually be replaced
by a higher-level abstraction like MVars.

Due to deprecations, this is a:

[breaking-change]
2014-08-04 16:03:21 -07: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
Brian Anderson bcdc8fb812 rustdoc: Just "stability" instead of "stability dashboard"
The words "stability dashboard" take up too much space on small screens.
2014-08-04 14:37:07 -07:00
Brian Anderson 57e53d5c2f rustdoc: Emit keywords for all crate pages
cc #12466
2014-08-04 14:37:07 -07:00
Brian Anderson 2b0a15494a rustdoc: Put field instantiation in declaration order.
cc #12466
2014-08-04 14:37:06 -07:00
Brian Anderson 08d44f5512 rustdoc: Use more descriptive description metadata.
This text appears in and improves search results.

cc #12466
2014-08-04 14:37:06 -07:00
Conrad Kleinespel c74d320662 libgetopts: tweak HasHarg/Occur docs. 2014-08-04 23:20:49 +02: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