Commit Graph

612 Commits

Author SHA1 Message Date
Alfie John 8da284a045 docs: typo 2015-01-17 23:31:13 +00:00
Earl St Sauver 6ab95bdd62 s/deriving/derives in Comments/Docs
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

Fixes #20984
2015-01-17 11:08:02 -08:00
Steve Klabnik a2e277edf4 Add enum discriminats to the reference.
Fixes #15755
2015-01-17 10:49:49 -05:00
Alex Crichton d7009e6f31 rollup merge of #21105: csouth3/kill-box-import
Closes #21093.
r? @steveklabnik
cc @alexcrichton

I tested with `make check-docs` and this passes that.  Hope that was enough.
2015-01-15 14:11:46 -08:00
Alex Crichton ff9ae8815b rollup merge of #21014: steveklabnik/gh20876
Fixes #20876
2015-01-15 14:11:33 -08:00
Alex Crichton 855c3e5af5 rollup merge of #20632: gchp/reference
I noticed that the `deriving` keyword is deprecated and that `derive` is the replacement. This updates the reference (and other docs) to remove the use `deriving`.
2015-01-15 14:11:27 -08:00
NODA, Kai 195fd9a2b4 reference.md: change "mod" to "self" in "use" declaration.
This should have been done together with 56dcbd17fd
for rust-lang/rust#20361

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2015-01-15 13:57:02 +08:00
bors 0c96037ec1 auto merge of #20980 : richo/rust/final-power, r=alexcrichton
Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it.

This gets you as far as being able to target powerpc with, eg:

    LD_LIBRARY_PATH=./x86_64-unknown-linux-gnu/stage2/lib/ x86_64-unknown-linux-gnu/stage2/bin/rustc -C linker=powerpc-linux-gnu-gcc --target powerpc-unknown-linux-gnu hello.rs

Would really love to get this out before 1.0. r? @alexcrichton
2015-01-15 05:12:30 +00:00
Chase Southwood 07f723f19b Remove unneeded box import in examples 2015-01-13 12:56:10 -06:00
Greg Chapple 4b14f67df3 Replace usage of deriving with derive in docs 2015-01-13 13:57:09 +00:00
Steve Klabnik 285277dd80 Clean up unary operators in the reference
Fixes #20876
2015-01-12 10:52:34 -05:00
Richo Healey 194ed4f5a0 powerpc: Document the existance of powerpc 2015-01-11 21:14:30 -08:00
bors 0aec4db1c0 auto merge of #20889 : Manishearth/rust/trait-error, r=nikomatsakis
fixes #20783

r? @nikomatsakis
2015-01-12 04:45:18 +00:00
bors 668325190d Merge pull request #20902 from stevencrockett/master
reference: Small grammar fixes for correctness/consistency and updates for language changes.

Reviewed-by: steveklabnik
2015-01-12 00:21:26 +00:00
Manish Goregaokar 02d0a8bbcf docs 2015-01-12 01:44:28 +05:30
Steven Crockett e7e308f447 reference: Made a number of small gramatical fixes changes for correctness/consistency. Small updates to text and code where the language has since changed. 2015-01-10 23:58:38 +00:00
Armin Preiml e4a2de7ed1 Update 7.2.9 Array expressions 2015-01-10 19:08:07 +01:00
Steve Klabnik 16a6ebd1f6 "The Rust Programming Language"
This pulls all of our long-form documentation into a single document,
nicknamed "the book" and formally titled "The Rust Programming
Language."

A few things motivated this change:

* People knew of The Guide, but not the individual Guides. This merges
  them together, helping discoverability.
* You can get all of Rust's longform documentation in one place, which
  is nice.
* We now have rustbook in-tree, which can generate this kind of
  documentation. While its style is basic, the general idea is much
  better: a table of contents on the left-hand side.
* Rather than a almost 10,000-line guide.md, there are now smaller files
  per section.
2015-01-08 12:02:11 -05:00
Alex Crichton 0dc48b47a8 Test fixes and rebase conflicts 2015-01-07 19:27:27 -08:00
bors c0216c8945 Merge pull request #20674 from jbcrail/fix-misspelled-comments
Fix misspelled comments.

Reviewed-by: steveklabnik
2015-01-07 15:35:30 +00:00
Joseph Crail e3b7fedc20 Fix misspelled comments.
I cleaned up comments prior to the 1.0 alpha release.
2015-01-06 20:53:18 -05:00
Piotr Czarnecki d85c017f92 Cleanup and followup to PR #17830: parsing changes
Prevents breaking down `$name` tokens into separate `$` and `name`.
Reports unknown macro variables.

Fixes #18775
Fixes #18839
Fixes #15640
2015-01-07 00:24:48 +01:00
Alex Crichton 7975fd9cee rollup merge of #20482: kmcallister/macro-reform
Conflicts:
	src/libflate/lib.rs
	src/libstd/lib.rs
	src/libstd/macros.rs
	src/libsyntax/feature_gate.rs
	src/libsyntax/parse/parser.rs
	src/libsyntax/show_span.rs
	src/test/auxiliary/macro_crate_test.rs
	src/test/compile-fail/lint-stability.rs
	src/test/run-pass/intrinsics-math.rs
	src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05 19:01:17 -08:00
Alex Crichton bb5e16b4b8 rollup merge of #20554: huonw/mut-pattern
Conflicts:
	src/librustc_typeck/check/_match.rs
2015-01-05 18:38:51 -08:00
Alex Crichton b8e404f289 rollup merge of #19998: th0114nd/unicode-bottom
In the HTML version of the documentation, it isn't rendered so might as well use the unicode representation.
2015-01-05 18:36:20 -08:00
Alex Crichton d46b8f1fce rollup merge of #19235: bjz/reference
cc. @steveklabnik
2015-01-05 18:36:16 -08:00
Keegan McAllister 78e841d8b1 Update docs 2015-01-05 18:21:14 -08:00
Keegan McAllister c9f0ff3813 Reserve the keyword 'macro' 2015-01-05 18:21:14 -08:00
Jorge Aparicio 97f870a1fc unignore and fix doctests in guide and reference 2015-01-05 17:22:18 -05:00
Jorge Aparicio ab0c7af376 ignore boxed closure doctests in the guide/reference 2015-01-05 17:22:17 -05:00
Huon Wilson bf6c007760 Change `&` pat to only work with &T, and `&mut` with &mut T.
This implements RFC 179 by making the pattern `&<pat>` require matching
against a variable of type `&T`, and introducing the pattern `&mut
<pat>` which only works with variables of type `&mut T`.

The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match
through a `&T` or a `&mut T` that binds the variable `x` to have type
`T` and to be mutable. This should be rewritten as follows, for example,

    for &mut x in slice.iter() {

becomes

    for &x in slice.iter() {
        let mut x = x;

Due to this, this is a

[breaking-change]

Closes #20496.
2015-01-05 16:14:17 +11:00
Alex Crichton 7d8d06f86b Remove deprecated functionality
This removes a large array of deprecated functionality, regardless of how
recently it was deprecated. The purpose of this commit is to clean out the
standard libraries and compiler for the upcoming alpha release.

Some notable compiler changes were to enable warnings for all now-deprecated
command line arguments (previously the deprecated versions were silently
accepted) as well as removing deriving(Zero) entirely (the trait was removed).

The distribution no longer contains the libtime or libregex_macros crates. Both
of these have been deprecated for some time and are available externally.
2015-01-03 23:43:57 -08:00
Brendan Zabarauskas 144f4b88ac Update influence list 2015-01-04 14:15:49 +11:00
Akos Kiss 6e5fb8bd1b Initial version of AArch64 support.
Adds AArch64 knowledge to:
* configure,
* make files,
* sources,
* tests, and
* documentation.
2015-01-03 15:16:10 +00:00
Alex Crichton e921e3f045 Rollup test fixes and rebase conflicts 2015-01-02 10:50:13 -08:00
Alex Crichton b9a26bf4b1 rollup merge of #20334: nagisa/ffi-llvm
Fixes #20313

r? @huonw
2015-01-02 09:22:18 -08:00
Alex Crichton 009ec5d2b0 rollup merge of #20315: alexcrichton/std-sync
Conflicts:
	src/libstd/rt/exclusive.rs
	src/libstd/sync/barrier.rs
	src/libstd/sys/unix/pipe.rs
	src/test/bench/shootout-binarytrees.rs
	src/test/bench/shootout-fannkuch-redux.rs
2015-01-02 09:19:00 -08:00
Alex Crichton 8b7d032014 rollup merge of #20273: alexcrichton/second-pass-comm
Conflicts:
	src/doc/guide.md
	src/libcollections/bit.rs
	src/libcollections/btree/node.rs
	src/libcollections/slice.rs
	src/libcore/ops.rs
	src/libcore/prelude.rs
	src/librand/rand_impls.rs
	src/librustc/middle/check_match.rs
	src/librustc/middle/infer/region_inference/mod.rs
	src/librustc_driver/lib.rs
	src/librustdoc/test.rs
	src/libstd/bitflags.rs
	src/libstd/io/comm_adapters.rs
	src/libstd/io/mem.rs
	src/libstd/io/mod.rs
	src/libstd/io/net/pipe.rs
	src/libstd/io/net/tcp.rs
	src/libstd/io/net/udp.rs
	src/libstd/io/pipe.rs
	src/libstd/io/process.rs
	src/libstd/io/stdio.rs
	src/libstd/io/timer.rs
	src/libstd/io/util.rs
	src/libstd/macros.rs
	src/libstd/os.rs
	src/libstd/path/posix.rs
	src/libstd/path/windows.rs
	src/libstd/prelude/v1.rs
	src/libstd/rand/mod.rs
	src/libstd/rand/os.rs
	src/libstd/sync/barrier.rs
	src/libstd/sync/condvar.rs
	src/libstd/sync/future.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/mpsc/mpsc_queue.rs
	src/libstd/sync/mpsc/select.rs
	src/libstd/sync/mpsc/spsc_queue.rs
	src/libstd/sync/mutex.rs
	src/libstd/sync/once.rs
	src/libstd/sync/rwlock.rs
	src/libstd/sync/semaphore.rs
	src/libstd/sync/task_pool.rs
	src/libstd/sys/common/helper_thread.rs
	src/libstd/sys/unix/process.rs
	src/libstd/sys/unix/timer.rs
	src/libstd/sys/windows/c.rs
	src/libstd/sys/windows/timer.rs
	src/libstd/sys/windows/tty.rs
	src/libstd/thread.rs
	src/libstd/thread_local/mod.rs
	src/libstd/thread_local/scoped.rs
	src/libtest/lib.rs
	src/test/auxiliary/cci_capture_clause.rs
	src/test/bench/shootout-reverse-complement.rs
	src/test/bench/shootout-spectralnorm.rs
	src/test/compile-fail/array-old-syntax-2.rs
	src/test/compile-fail/bind-by-move-no-guards.rs
	src/test/compile-fail/builtin-superkinds-self-type.rs
	src/test/compile-fail/comm-not-freeze-receiver.rs
	src/test/compile-fail/comm-not-freeze.rs
	src/test/compile-fail/issue-12041.rs
	src/test/compile-fail/unsendable-class.rs
	src/test/run-pass/builtin-superkinds-capabilities-transitive.rs
	src/test/run-pass/builtin-superkinds-capabilities-xc.rs
	src/test/run-pass/builtin-superkinds-capabilities.rs
	src/test/run-pass/builtin-superkinds-self-type.rs
	src/test/run-pass/capturing-logging.rs
	src/test/run-pass/closure-bounds-can-capture-chan.rs
	src/test/run-pass/comm.rs
	src/test/run-pass/core-run-destroy.rs
	src/test/run-pass/drop-trait-enum.rs
	src/test/run-pass/hashmap-memory.rs
	src/test/run-pass/issue-13494.rs
	src/test/run-pass/issue-3609.rs
	src/test/run-pass/issue-4446.rs
	src/test/run-pass/issue-4448.rs
	src/test/run-pass/issue-8827.rs
	src/test/run-pass/issue-9396.rs
	src/test/run-pass/ivec-tag.rs
	src/test/run-pass/rust-log-filter.rs
	src/test/run-pass/send-resource.rs
	src/test/run-pass/send-type-inference.rs
	src/test/run-pass/sendable-class.rs
	src/test/run-pass/spawn-types.rs
	src/test/run-pass/task-comm-0.rs
	src/test/run-pass/task-comm-10.rs
	src/test/run-pass/task-comm-11.rs
	src/test/run-pass/task-comm-13.rs
	src/test/run-pass/task-comm-14.rs
	src/test/run-pass/task-comm-15.rs
	src/test/run-pass/task-comm-16.rs
	src/test/run-pass/task-comm-3.rs
	src/test/run-pass/task-comm-4.rs
	src/test/run-pass/task-comm-5.rs
	src/test/run-pass/task-comm-6.rs
	src/test/run-pass/task-comm-7.rs
	src/test/run-pass/task-comm-9.rs
	src/test/run-pass/task-comm-chan-nil.rs
	src/test/run-pass/task-spawn-move-and-copy.rs
	src/test/run-pass/task-stderr.rs
	src/test/run-pass/tcp-accept-stress.rs
	src/test/run-pass/tcp-connect-timeouts.rs
	src/test/run-pass/tempfile.rs
	src/test/run-pass/trait-bounds-in-arc.rs
	src/test/run-pass/trivial-message.rs
	src/test/run-pass/unique-send-2.rs
	src/test/run-pass/unique-send.rs
	src/test/run-pass/unwind-resource.rs
2015-01-02 09:15:54 -08:00
Alex Crichton 56290a0044 std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization
story for the prelude. Most of the RFC was directly applied, removing reexports.
Some reexports are kept around, however:

* `range` remains until range syntax has landed to reduce churn.
* `Path` and `GenericPath` remain until path reform lands. This is done to
  prevent many imports of `GenericPath` which will soon be removed.
* All `io` traits remain until I/O reform lands so imports can be rewritten all
  at once to `std::io::prelude::*`.

This is a breaking change because many prelude reexports have been removed, and
the RFC can be consulted for the exact list of removed reexports, as well as to
find the locations of where to import them.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md
[breaking-change]

Closes #20068
2015-01-02 08:54:06 -08:00
Alex Crichton f3a7ec7028 std: Second pass stabilization of sync
This pass performs a second pass of stabilization through the `std::sync`
module, avoiding modules/types that are being handled in other PRs (e.g.
mutexes, rwlocks, condvars, and channels).

The following items are now stable

* `sync::atomic`
* `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`)
* `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`)
* `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`)
* `sync::Once`
* `sync::ONCE_INIT`
* `sync::Once::call_once` (was `doit`)
  * C == `pthread_once(..)`
  * Boost == `call_once(..)`
  * Windows == `InitOnceExecuteOnce`
* `sync::Barrier`
* `sync::Barrier::new`
* `sync::Barrier::wait` (now returns a `bool`)
* `sync::Semaphore::new`
* `sync::Semaphore::acquire`
* `sync::Semaphore::release`

The following items remain unstable

* `sync::SemaphoreGuard`
* `sync::Semaphore::access` - it's unclear how this relates to the poisoning
                              story of mutexes.
* `sync::TaskPool` - the semantics of a failing task and whether a thread is
                     re-attached to a thread pool are somewhat unclear, and the
                     utility of this type in `sync` is question with respect to
                     the jobs of other primitives. This type will likely become
                     stable or move out of the standard library over time.
* `sync::Future` - futures as-is have yet to be deeply re-evaluated with the
                   recent core changes to Rust's synchronization story, and will
                   likely become stable in the future but are unstable until
                   that time comes.

[breaking-change]
2015-01-01 22:02:59 -08:00
Nick Cameron 7e2b9ea235 Fallout - change array syntax to use `;` 2015-01-02 10:28:19 +13:00
Simonas Kazlauskas f1b64017d0 Feature gate FFI imports of LLVM intrinsics
Fixes #20313
2014-12-31 15:58:36 +02:00
Alex Crichton 7b5b0b1caf rollup merge of #20270: bombless/patch-2 2014-12-29 16:36:37 -08:00
Alex Crichton 4717f07989 rollup merge of #20248: steveklabnik/gh20038
A part of #20038

This is just the beginning of what needs to be done, but it's some of it.

/cc @aturon
2014-12-29 16:36:20 -08:00
Alex Crichton c32d03f417 std: Stabilize the prelude module
This commit is an implementation of [RFC 503][rfc] which is a stabilization
story for the prelude. Most of the RFC was directly applied, removing reexports.
Some reexports are kept around, however:

* `range` remains until range syntax has landed to reduce churn.
* `Path` and `GenericPath` remain until path reform lands. This is done to
  prevent many imports of `GenericPath` which will soon be removed.
* All `io` traits remain until I/O reform lands so imports can be rewritten all
  at once to `std::io::prelude::*`.

This is a breaking change because many prelude reexports have been removed, and
the RFC can be consulted for the exact list of removed reexports, as well as to
find the locations of where to import them.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md
[breaking-change]

Closes #20068
2014-12-29 08:58:21 -08:00
bombless c095bf545e `once` is not keyword now 2014-12-28 12:15:28 +08:00
Steve Klabnik b8ffad5964 s/task/thread/g
A part of #20038
2014-12-26 16:04:27 -05:00
Chris Wong 85c1a4b1ba Rename include_bin! to include_bytes!
According to [RFC 344][], methods that return `&[u8]` should have names
ending in `bytes`. Though `include_bin!` is a macro not a method, it
seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning
when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]
2014-12-23 22:06:32 +13:00
Alex Crichton 082bfde412 Fallout of std::str stabilization 2014-12-21 23:31:42 -08:00
Alex Crichton 4ae3107e72 rollup merge of #19996: th0114nd/boolean-inden
The current indentation level would indicate that Boolean literals are on the same level as Integer and Float literals under Number literals, unindenting moves it to the same scope as Character and string literals, Byte and byte string literals, and Number literals under Literals.
2014-12-21 09:27:33 -08:00
th0114nd 4ee73a124c Changed LaTex $\bot$s to ⊥
In the HTML version of the documentation, it isn't rendered so might as well use the unicode representation.
Part of the problem was that putting a math unicode character wasn't
rendering properly in the pdf, so extra steps were needed to define
the unicode charecter ⊥ in reference.tex

closes #15285
2014-12-19 18:09:33 -05:00
th0114nd edb39b8b33 Boolean literals are not Number literals
The current indentation level would indicate that Boolean literals are on the same level as Integer and Float literals under Number literals, unindenting moves it to the same scope as Character and string literals, Byte and byte string literals, and Number literals under Literals.
2014-12-18 17:55:34 -05:00
th0114nd 15d54549d7 Put quotes around "as", because it's a keyword. 2014-12-18 14:47:43 -05:00
Brian Anderson e717362ce5 rollup merge of #19763: csouth3/remove-featuregates
This is a revival of #19517 (per request of @alexcrichton) now that the new snapshots have landed.  We can now remove the last feature gates for if_let, while_let, and tuple_indexing scattered throughout the test sources since these features have been added to Rust.

Closes #19473.
2014-12-15 06:45:34 -08:00
Brian Anderson 8404ea66d9 rollup merge of #19746: steveklabnik/gh9266
Fixes #9266
2014-12-15 06:45:33 -08:00
Niko Matsakis 112faabf94 Update guide/intro to take into account the removal of `proc`.
cc @steveklabnick
2014-12-14 04:21:57 -05:00
bors f07526a999 auto merge of #19669 : alfie/rust/master, r=sanxiyn 2014-12-14 01:07:31 +00:00
Chase Southwood cd3bdeb91a Remove feature gate directives for `if_let`, `while_let`, and `tuple_indexing`. 2014-12-12 13:23:54 -06:00
Steve Klabnik 38d29092f9 reference: type definition -> type alias
Fixes #9266
2014-12-11 12:35:03 -05:00
Alfie John b9c3b5693a doc: grammar fix 2014-12-09 20:17:40 +00:00
Alex Crichton e6d8190b0c rollup merge of #19615: steveklabnik/gh19595
Fixes #19595.
2014-12-09 09:25:05 -08:00
Niko Matsakis 096a28607f librustc: Make `Copy` opt-in.
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.

A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.

For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.

This breaks code like:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

Change this code to:

    #[deriving(Show)]
    struct Point2D {
        x: int,
        y: int,
    }

    impl Copy for Point2D {}

    fn main() {
        let mypoint = Point2D {
            x: 1,
            y: 1,
        };
        let otherpoint = mypoint;
        println!("{}{}", mypoint, otherpoint);
    }

This is the backwards-incompatible part of #13231.

Part of RFC #3.

[breaking-change]
2014-12-08 13:47:44 -05:00
Steve Klabnik 131f20279e Correct the reference with regards to floats
Fixes #19595.
2014-12-07 07:30:15 -05:00
Corey Farwell 4ef16741e3 Utilize fewer reexports
In regards to:

https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729

This commit:

* Changes the #deriving code so that it generates code that utilizes fewer
  reexports (in particur Option::* and Result::*), which is necessary to
  remove those reexports in the future
* Changes other areas of the codebase so that fewer reexports are utilized
2014-12-05 18:13:04 -05:00
kulakowski 9460d1744f Fix typo in reference.md 2014-11-29 01:38:32 -06:00
Steven Fackler 348cc9418a Remove special casing for some meta attributes
Descriptions and licenses are handled by Cargo now, so there's no reason
to keep these attributes around.
2014-11-26 11:44:45 -08:00
bors 2264049577 auto merge of #19172 : alfie/rust/impl-traitless, r=steveklabnik
An example of how implementations work without traits would be handy
2014-11-25 11:46:39 +00:00
bors ccc4a7cebc auto merge of #19136 : alfie/rust/master, r=steveklabnik
An example of how type definitions work would be handy
2014-11-22 22:36:40 +00:00
Alfie John 93ba558588 doc: adding example for implementations without traits 2014-11-21 04:43:07 +00:00
bors c9f6d69642 auto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton
This PR completes the removal of the runtime system and green-threaded abstractions as part of implementing [RFC 230](https://github.com/rust-lang/rfcs/pull/230).

Specifically:

* It removes the `Runtime` trait, welding the scheduling infrastructure directly to native threads.

* It removes `libgreen` and `libnative` entirely.

* It rewrites `sync::mutex` as a trivial layer on top of native mutexes. Eventually, the two modules will be merged.

* It hides the vast majority of `std::rt`.

This completes the basic task of removing the runtime system (I/O and scheduling) and components that depend on it. 

After this lands, a follow-up PR will pull the `rustrt` crate back into `std`, turn `std::task` into `std::thread` (with API changes to go along with it), and completely cut out the remaining startup/teardown sequence. Other changes, including new [TLS](https://github.com/rust-lang/rfcs/pull/461) and synchronization are in the RFC or pre-RFC phase.

Closes #17325
Closes #18687

[breaking-change]

r? @alexcrichton
2014-11-21 03:41:45 +00:00
Aaron Turon 40c78ab037 Fallout from libgreen and libnative removal 2014-11-20 17:19:24 -08:00
mdinger 16bb4e6400 Add examples for all literal types in reference grouped together 2014-11-20 16:05:33 -05:00
Alfie John e87894ef04 doc: adding example for type definitions 2014-11-20 09:44:57 +00:00
bors dd5ce5ae2f auto merge of #19105 : alfie/rust/master, r=thestinger
As discussed in pull #19068, trying to make the wording more clear for unsafe code vs undefined behavior.
2014-11-20 06:11:36 +00:00
Jakub Bukaj 1b8ee82b54 rollup merge of #19107: cakebaker/change_an_box_to_a_box 2014-11-19 22:41:24 +01:00
Jakub Bukaj f71b852d38 rollup merge of #19103: huonw/literal-suffixes
Futureproof Rust for fancier suffixed literals. The Rust compiler tokenises a literal followed immediately (no whitespace) by an identifier as a single token: (for example) the text sequences `"foo"bar`, `1baz` and `1u1024` are now a single token rather than the pairs `"foo"` `bar`, `1` `baz` and `1u` `1024` respectively.

The compiler rejects all such suffixes in the parser, except for the 12 numeric suffixes we have now.

I'm fairly sure this will affect very few programs, since it's not currently legal to have `<literal><identifier>` in a Rust program, except in a macro invocation. Any macro invocation relying on this behaviour can simply separate the two tokens with whitespace: `foo!("bar"baz)` becomes `foo!("bar" baz)`.

This implements [RFC 463](https://github.com/rust-lang/rfcs/blob/master/text/0463-future-proof-literal-suffixes.md), and so closes https://github.com/rust-lang/rust/issues/19088.
2014-11-19 22:41:05 +01:00
Jakub Bukaj 8997b098d3 rollup merge of #19072: cakebaker/add_missing_dot 2014-11-19 22:39:06 +01:00
Daniel Hofstetter ebe812f0c6 Reference: Change "an box" to "a box" 2014-11-19 15:11:09 +01:00
Huon Wilson a11078f8c3 Update documentation for literal suffixes.
This changes the stated grammar of literals to move all suffixes into
the generic literal production.
2014-11-20 00:03:21 +11:00
Alfie John e0b0c83138 doc: clarifying unsafe code vs undefined behavior 2014-11-19 12:43:13 +00:00
Daniel Micay 210e059750 clearly define `int` and `uint` to fix unsoundness
This fixes the gap in the language definition causing #18726 by defining
a clear bound on the maximum size for libraries to enforce.

Closes #18069
2014-11-19 05:17:56 -05:00
Niko Matsakis 56ba260749 Update test for equivalency to include region binders in object types, add new tests relating to HRTB, consolidate the `unboxed_closures` and `overloaded_calls` feature gates. 2014-11-18 12:32:38 -05:00
Niko Matsakis 058abcc209 Place parenthetical notation under the `unboxed_closure` feature-gate.
Consolidate the `unboxed_closure_sugar` and `unboxed_closure` feature gates.
2014-11-18 12:26:04 -05:00
Daniel Hofstetter 2aa241d76f Reference: Add missing third dot of range 2014-11-18 15:14:34 +01:00
Jakub Bukaj f3759dd2b6 rollup merge of #19026: alfie/doc-fixes
Updated all the adjacent character literals in the BCNF that cannot have an optional space between them
2014-11-18 00:24:06 +01:00
Steven Fackler 3dcd215740 Switch to purely namespaced enums
This breaks code that referred to variant names in the same namespace as
their enum. Reexport the variants in the old location or alter code to
refer to the new locations:

```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
=>
```
pub use self::Foo::{A, B};

pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
or
```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = Foo::A;
}
```

[breaking-change]
2014-11-17 07:35:51 -08:00
Alfie John 9a5237d7ae doc: extend a893397 to make whole document consistent 2014-11-17 05:15:24 +00:00
bors 245c7fbef5 auto merge of #18995 : alfie/rust/comment-docs, r=aturon
Start comment is a string literal while end comment is made up of two character literals. This change is to make them consistent.
2014-11-16 20:32:12 +00:00
Jakub Bukaj c425ed2a8d Update the reference 2014-11-16 14:23:15 +01:00
Jakub Bukaj a9f9e80de5 rollup merge of #18989: alex/fix-typos 2014-11-16 10:22:35 +01:00
Alfie John a8933973f9 doc: make end comment consistent with start comment 2014-11-16 04:12:43 +00:00
Brendan Zabarauskas 29bc9c632e Move FromStr to core::str 2014-11-16 12:41:55 +11:00
Alex Gaynor e94cd40f7e Fixed several typos 2014-11-15 15:00:47 -08:00
Daniel Hofstetter e8056a452f Reference: Fix list in Expressions section 2014-11-13 16:05:07 +01:00
Alex Crichton fcfd307493 rollup merge of #18373 : steveklabnik/gh18288 2014-11-06 13:30:10 -08:00
Steve Klabnik d108613ba0 expand description of the link attribute
Fixes #18288
2014-11-06 10:13:29 -05:00
Alex Crichton 1b363f08e1 rollup merge of #18572 : cakebaker/small_doc_changes 2014-11-03 15:56:00 -08:00
Alex Crichton b3f8b8f238 rollup merge of #18522 : jbcrail/rename-missing-doc-attribute 2014-11-03 08:31:46 -08:00
Alex Crichton e5a8840033 rollup merge of #18519 : Gankro/collect-smash 2014-11-03 08:31:45 -08:00
Daniel Hofstetter e9618ce701 Small doc fixes 2014-11-03 15:34:56 +01:00
Alexis Beingessner 112c8a966f refactor libcollections as part of collection reform
* Moves multi-collection files into their own directory, and splits them into seperate files
* Changes exports so that each collection has its own module
* Adds underscores to public modules and filenames to match standard naming conventions

(that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet)

* Renames PriorityQueue to BinaryHeap
* Renames SmallIntMap to VecMap
* Miscellanious fallout fixes

[breaking-change]
2014-11-02 18:58:11 -05:00
Joseph Crail 835b92efb8 Replace deprecated missing_doc attribute. 2014-11-01 21:12:13 -04:00
Daniel Hofstetter 83225cc38d Reference: Add missing of's 2014-11-01 15:34:01 +01:00
bors 221fc1e3cd auto merge of #18459 : alexcrichton/rust/rollup, r=alexcrichton 2014-10-31 02:27:15 +00:00
Alex Crichton 1e919c93c7 rollup merge of #18408 : thestinger/unsafe 2014-10-30 09:29:23 -07:00
bors 301ed5e579 auto merge of #18376 : steveklabnik/rust/gh7963, r=alexcrichton
FIxes #7963.
2014-10-30 15:57:03 +00:00
bors 77f44d4a7b auto merge of #17894 : steveklabnik/rust/fail_to_panic, r=aturon
This in-progress PR implements https://github.com/rust-lang/rust/issues/17489.

I made the code changes in this commit, next is to go through alllllllll the documentation and fix various things.

- Rename column headings as appropriate, `# Panics` for panic conditions and `# Errors` for `Result`s.
- clean up usage of words like 'fail' in error messages

Anything else to add to the list, @aturon ? I think I should leave the actual functions with names like `slice_or_fail` alone, since you'll get to those in your conventions work?

I'm submitting just the code bits now so that we can see it separately, and I also don't want to have to keep re-building rust over and over again if I don't have to 😉 

Listing all the bits so I can remember as I go:

- [x] compiler-rt
- [x] compiletest
- [x] doc
- [x] driver
- [x] etc
- [x] grammar
- [x] jemalloc
- [x] liballoc
- [x] libarena
- [x] libbacktrace
- [x] libcollections
- [x] libcore
- [x] libcoretest
- [x] libdebug
- [x] libflate
- [x] libfmt_macros
- [x] libfourcc
- [x] libgetopts
- [x] libglob
- [x] libgraphviz
- [x] libgreen
- [x] libhexfloat
- [x] liblibc
- [x] liblog
- [x] libnative
- [x] libnum
- [x] librand
- [x] librbml
- [x] libregex
- [x] libregex_macros
- [x] librlibc
- [x] librustc
- [x] librustc_back
- [x] librustc_llvm
- [x] librustdoc
- [x] librustrt
- [x] libsemver
- [x] libserialize
- [x] libstd
- [x] libsync
- [x] libsyntax
- [x] libterm
- [x] libtest
- [x] libtime
- [x] libunicode
- [x] liburl
- [x] libuuid
- [x] llvm
- [x] rt
- [x] test
2014-10-29 20:16:57 +00:00
Steve Klabnik 7828c3dd28 Rename fail! to panic!
https://github.com/rust-lang/rfcs/pull/221

The current terminology of "task failure" often causes problems when
writing or speaking about code. You often want to talk about the
possibility of an operation that returns a Result "failing", but cannot
because of the ambiguity with task failure. Instead, you have to speak
of "the failing case" or "when the operation does not succeed" or other
circumlocutions.

Likewise, we use a "Failure" header in rustdoc to describe when
operations may fail the task, but it would often be helpful to separate
out a section describing the "Err-producing" case.

We have been steadily moving away from task failure and toward Result as
an error-handling mechanism, so we should optimize our terminology
accordingly: Result-producing functions should be easy to describe.

To update your code, rename any call to `fail!` to `panic!` instead.
Assuming you have not created your own macro named `panic!`, this
will work on UNIX based systems:

    grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g'

You can of course also do this by hand.

[breaking-change]
2014-10-29 11:43:07 -04:00
Daniel Micay 8a71925558 reference: document unwinding unsafety issues 2014-10-28 19:00:16 -04:00
Daniel Micay 768a7e1a4a reference: slices are now regular types 2014-10-28 18:37:42 -04:00
Daniel Micay 321de979d8 reference: note the existence of UnsafeCell 2014-10-28 18:31:09 -04:00
Steve Klabnik b7e177d242 update keyword list
Fixes #17969
2014-10-28 15:55:04 -04:00
Steve Klabnik 4d43d163df Describe doc attribute in the reference
FIxes #7963.
2014-10-28 12:11:26 -04:00
bors fa59bb0869 auto merge of #18052 : IvanUkhov/rust/raw-byte-string-literals, r=aturon
Hello,


The pull request fixes a typo in the description of raw string literals in [reference.md](https://github.com/rust-lang/rust/blob/master/src/doc/reference.md#byte-and-byte-string-literals).


Regards,
Ivan
2014-10-17 07:32:17 +00:00
Luqman Aden 3410c52eec librustc: Remove trans::reflect and the opaque and ty_visitor lang items. 2014-10-16 11:15:36 -04:00
Luqman Aden 38aca17c47 Remove libdebug and update tests. 2014-10-16 11:15:34 -04:00
Ivan Ukhov a923b4ff6d Fix the description of raw byte string literals 2014-10-15 06:36:13 +02:00
Alex Crichton 0dd4cd57fe rollup merge of #17968 : nodakai/really-fix-kw-table 2014-10-13 15:09:35 -07:00
bors c7e0724274 auto merge of #17733 : jgallagher/rust/while-let, r=alexcrichton
This is *heavily* based on `if let` (#17634) by @jakub- and @kballard

This should close #17687
2014-10-13 19:37:40 +00:00
bors d670d76221 auto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichton
All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".
2014-10-13 12:27:43 +00:00
Steven Fackler aa3b1261b1 Continue cfg syntax transition
All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".
2014-10-12 11:40:19 -07:00
NODA, Kai b2949ae543 Fix HTML version of the keyword table.
This should really fix rust-lang/rust#17528.
2014-10-12 17:26:37 +08:00
Jakub Wieczorek 4442e6d890 Remove `virtual` structs from the reference 2014-10-11 19:42:26 +02:00
John Gallagher 0d6dafa51f Add `while let` to the reference
Closes #17687
2014-10-10 20:30:32 -04:00
John Gallagher 660cf18070 Move `while let` behind `while_let` feature gate 2014-10-10 20:30:32 -04:00
Alex Crichton a3e8f41212 doc: Document constants in the reference 2014-10-09 09:44:52 -07:00
bors 8f96590150 auto merge of #17873 : steveklabnik/rust/gh16413, r=alexcrichton
A fix for the issues mentioned in https://github.com/rust-lang/rust/issues/16413
2014-10-09 05:22:27 +00:00
Steve Klabnik 557014cd83 add mention of test attribute
Fixes #16413
2014-10-08 16:46:01 -04:00
Steve Klabnik 3f1ed8608d remove crate_id attribute, add crate_name one
this is true as of https://github.com/rust-lang/rust/pull/15319
2014-10-08 16:44:40 -04:00
Steve Klabnik 3610f8fdc2 Fix keyword table
Markdown tables require a header, and we don't want one.

Fixes #17528
2014-10-07 15:01:26 -04:00
Nick Cameron 2d3823441f Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07 15:49:53 +13:00
Alex Crichton 39f4bf7b1c Test fixes from the rollup 2014-10-03 11:43:15 -07:00
bors 9a2286d3a1 auto merge of #16995 : kmcallister/rust/plugin-tutorial, r=alexcrichton
@steveklabnik, are you interested in looking this over?
2014-10-03 07:33:26 +00:00
Alex Crichton 7ae802f57b rollup merge of #17666 : eddyb/take-garbage-out
Conflicts:
	src/libcollections/lib.rs
	src/libcore/lib.rs
	src/librustdoc/lib.rs
	src/librustrt/lib.rs
	src/libserialize/lib.rs
	src/libstd/lib.rs
	src/test/run-pass/issue-8898.rs
2014-10-02 14:53:18 -07:00
Aaron Turon 7bf56df4c8 Revert "Put slicing syntax behind a feature gate."
This reverts commit 95cfc35607.
2014-10-02 11:47:51 -07:00
Eduard Burtescu aa0b350c97 docs: remove mentions of Gc. 2014-10-02 16:59:31 +03:00
Nick Cameron 95cfc35607 Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02 13:23:36 +13:00
Keegan McAllister eb1cbf3d1d Link plugins guide from elsewhere 2014-10-01 13:21:52 -07:00
bors 2f15dcd4d3 auto merge of #17584 : pcwalton/rust/range-patterns-dotdotdot, r=nick29581
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

r? @nick29581
2014-10-01 03:17:24 +00:00
Jakub Wieczorek e53f4a6b94 Add `if let` to the reference 2014-09-30 18:54:03 +02:00
Kevin Ballard 13e00e4a3d Update based on PR feedback 2014-09-30 18:54:03 +02:00
Kevin Ballard 8a60952100 Move `if let` behind a feature gate 2014-09-30 18:54:03 +02:00
Patrick Walton 416144b827 librustc: Forbid `..` in range patterns.
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

[breaking-change]
2014-09-30 09:11:26 -07:00
Steve Klabnik c765178bf6 clean up some references to 'owned' 2014-09-22 17:54:10 -04:00
Steve Klabnik 64813d33d8 vectors are not in the language 2014-09-22 17:54:10 -04:00
Steve Klabnik c94d479a90 die 'managed' 2014-09-22 17:54:10 -04:00
Steve Klabnik 84bd6bba45 logging is an external crate 2014-09-22 17:54:10 -04:00
Steve Klabnik 68b8901fff no it won't 2014-09-22 17:54:10 -04:00
Steve Klabnik 7866f515a5 runtime has no C++ 2014-09-22 17:54:10 -04:00
Steve Klabnik 667276040f Remove lies about task scheduling
it's 1:1 by default now, and N:M is on its way out
2014-09-22 17:54:10 -04:00
Steve Klabnik fdd511d124 Fix terminology around boxes
it's just 'box' not 'owned box'
2014-09-22 17:54:10 -04:00
Steve Klabnik 72c27aba9c fix example 2014-09-22 17:54:10 -04:00
Steve Klabnik f95958b526 glob imports are an external crate 2014-09-22 17:54:10 -04:00
Steve Klabnik 6c348dfe72 rust -> Rust 2014-09-22 17:54:09 -04:00
Steve Klabnik 19e814ed98 uhhh weird triple backticks 2014-09-22 17:54:09 -04:00
Steve Klabnik 96180d7e6b 'merican English 2014-09-22 17:54:09 -04:00
Steve Klabnik 64a77b1ff5 move keywords to table 2014-09-22 17:54:09 -04:00
Steve Klabnik 68227d01f9 '. ' -> '. ' 2014-09-22 17:54:09 -04:00
Steve Klabnik bfb5fb3b45 Remove disclaimer
This is just true of all of Rust, and doesn't make a lot of sense now.
Especially as we move towards finalizing things, I think it's time for
this to go.
2014-09-22 17:54:09 -04:00
Steve Klabnik eaa7b8eb4c make note of language vs libraries 2014-09-22 17:54:09 -04:00
Steve Klabnik 1f2b5061d3 modernize code blocks 2014-09-22 17:54:09 -04:00
Steve Klabnik 47682f96de manual -> reference & formatting
'reference' sounds better than 'manual' to me here, and rust.html is
certainly wrong.

I also wrapped everything to 80 cols.
2014-09-22 17:54:09 -04:00