Commit Graph

174 Commits

Author SHA1 Message Date
Alexis Beingessner 67d3823fc3 enumset fallout 2014-12-18 16:20:32 -05:00
Patrick Walton ddb2466f6a librustc: Always parse `macro!()`/`macro![]` as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]
2014-12-18 12:09:07 -05:00
Niko Matsakis 5c3d398919 Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`) 2014-12-14 04:21:56 -05:00
Jorge Aparicio e792338318 librustdoc: use tuple indexing 2014-12-13 20:04:41 -05:00
Jorge Aparicio 4d4915aa28 librustdoc: fix fallout 2014-12-13 17:03:45 -05:00
Alex Crichton 52edb2ecc9 Register new snapshots 2014-12-11 11:30:38 -08:00
Jorge Aparicio e6bd217ce8 librustdoc: remove unnecessary `as_slice()` calls 2014-12-06 19:05:58 -05:00
Corey Richardson 7f8f4abc55 rollup merge of #19422: scialex/fix-fmt-macro-doc
these are missing standard #![doc(...)]. add them
2014-12-05 10:06:55 -08:00
Niko Matsakis 61edb0ccb7 Separate the driver into its own crate that uses trans, typeck. 2014-12-04 10:04:52 -05:00
Alexander Light e621116b86 make fmt_macros and rustdoc have standard doc attributes 2014-12-03 12:49:59 -05:00
Jorge Aparicio 09707d70a4 Fix fallout 2014-12-03 10:41:48 -05:00
bors 66601647cd auto merge of #19343 : sfackler/rust/less-special-attrs, r=alexcrichton
Descriptions and licenses are handled by Cargo now, so there's no reason
to keep these attributes around.
2014-11-27 06:41:17 +00:00
Alex Crichton 60541cdc1e Test fixes and rebase conflicts 2014-11-26 16:50:13 -08: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
Tom Jakubowski dd4c7c00d8 rustdoc: Render associated types on traits and impls 2014-11-24 05:23:10 -08:00
Alex Crichton a9c1152c4b std: Add a new top-level thread_local module
This commit removes the `std::local_data` module in favor of a new
`std::thread_local` module providing thread local storage. The module provides
two variants of TLS: one which owns its contents and one which is based on
scoped references. Each implementation has pros and cons listed in the
documentation.

Both flavors have accessors through a function called `with` which yield a
reference to a closure provided. Both flavors also panic if a reference cannot
be yielded and provide a function to test whether an access would panic or not.
This is an implementation of [RFC 461][rfc] and full details can be found in
that RFC.

This is a breaking change due to the removal of the `std::local_data` module.
All users can migrate to the new thread local system like so:

    thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None)))

The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as
an implementation detail which must now be explicitly stated by users.

[rfc]: https://github.com/rust-lang/rfcs/pull/461
[breaking-change]
2014-11-23 23:37:16 -08:00
bors 2a4c0100fe auto merge of #19122 : Kintaro/rust/remove_struct_variant, r=jakub-
The struct_variant is not gated anymore. This commit just removes it and the resulting warnings when compiling rust. Now compiles with the snapshot from 11/18 (as opposed to PR #19014)
2014-11-22 04:06:45 +00:00
Alexander Light 26107f6181 rustdoc: Allow private modules be included in docs
Made it so that what passes are used is passed onto the renderer so it
can intelligently deal with private modules.
2014-11-20 17:02:58 -05:00
Simon Wollwage 4a83726517 removed usage of struct_variant feature as it is no longer gated 2014-11-20 00:21:32 +01:00
Alex Crichton 4af3494bb0 std: Stabilize std::fmt
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc].
There are a number of breaking changes as a part of this commit which will need
to be handled to migrated old code:

* A number of formatting traits have been removed: String, Bool, Char, Unsigned,
  Signed, and Float. It is recommended to instead use Show wherever possible or
  to use adaptor structs to implement other methods of formatting.

* The format specifier for Boolean has changed from `t` to `b`.

* The enum `FormatError` has been renamed to `Error` as well as becoming a unit
  struct instead of an enum. The `WriteError` variant no longer exists.

* The `format_args_method!` macro has been removed with no replacement. Alter
  code to use the `format_args!` macro instead.

* The public fields of a `Formatter` have become read-only with no replacement.
  Use a new formatting string to alter the formatting flags in combination with
  the `write!` macro. The fields can be accessed through accessor methods on the
  `Formatter` structure.

Other than these breaking changes, the contents of std::fmt should now also all
contain stability markers. Most of them are still #[unstable] or #[experimental]

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md
[breaking-change]

Closes #18904
2014-11-18 21:16:22 -08:00
bors 618bd5d1c5 auto merge of #19070 : nikomatsakis/rust/crates, r=nikomatsakis
Reduces memory usage significantly and opens opportunities for more parallel compilation.

This PR was previously #19002 but I closed it because bors didn't seem to recognize the `r+` annotations there.
2014-11-18 15:26:43 +00:00
Niko Matsakis dc6e414e6f Move trans, back, driver, and back into a new crate, rustc_trans. Reduces memory usage significantly and opens opportunities for more parallel compilation. 2014-11-18 07:32:43 -05:00
Daniel Micay 85c2c2e38c implement Writer for Vec<u8>
The trait has an obvious, sensible implementation directly on vectors so
the MemWriter wrapper is unnecessary. This will halt the trend towards
providing all of the vector methods on MemWriter along with eliminating
the noise caused by conversions between the two types. It also provides
the useful default Writer methods on Vec<u8>.

After the type is removed and code has been migrated, it would make
sense to add a new implementation of MemWriter with seeking support. The
simple use cases can be covered with vectors alone, and ones with the
need for seeks can use a new MemWriter implementation.
2014-11-18 01:09:46 -05:00
Alex Crichton fcd05ed99f time: Deprecate the library in the distribution
This commit deprecates the entire libtime library in favor of the
externally-provided libtime in the rust-lang organization. Users of the
`libtime` crate as-is today should add this to their Cargo manifests:

    [dependencies.time]
    git = "https://github.com/rust-lang/time"

To implement this transition, a new function `Duration::span` was added to the
`std::time::Duration` time. This function takes a closure and then returns the
duration of time it took that closure to execute. This interface will likely
improve with `FnOnce` unboxed closures as moving in and out will be a little
easier.

Due to the deprecation of the in-tree crate, this is a:

[breaking-change]

cc #18855, some of the conversions in the `src/test/bench` area may have been a
little nicer with that implemented
2014-11-12 09:18:35 -08:00
Aaron Turon 5f09a50e8f rustdoc: revise method counts in stability summary
Previously, the stability summary page attempted to associate impl
blocks with the module in which they were defined, rather than the
module defining the type they apply to (which is usually, but not
always, the same). Unfortunately, due to the basic architecture of
rustdoc, this meant that impls from re-exports were not being counted.

This commit makes the stability summary work the same way that rustdoc's
rendered output does: all methods are counted alongside the type they
apply to, no matter where the methods are defined.

In addition, for trait impl blocks only the stability of the overall
block is counted; the stability of the methods within is not
counted (since that stability level is part of the trait definition).

Fixes #18812
2014-11-10 15:36:03 -08:00
Alexis Beingessner eec145be3f Fallout from collection conventions 2014-11-06 12:26:08 -05: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
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
Luqman Aden 322aedd462 librustdoc: Remove all uses of {:?}. 2014-10-16 11:15:35 -04:00
Luqman Aden 38aca17c47 Remove libdebug and update tests. 2014-10-16 11:15:34 -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 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 db55e70c97 syntax: mark the managed_boxes feature as Removed. 2014-10-02 17:02:03 +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
Brian Anderson 2acd6b7741 Remove windows TCB hack from rustdoc 2014-09-26 10:17:04 -07:00
Alexis Beingessner fe8a413fc0 handling fallout from entry api 2014-09-24 21:53:58 -04:00
Aaron Turon fc525eeb4e Fallout from renaming 2014-09-16 14:37:48 -07:00
Eduard Burtescu 8bfbcddf53 rustdoc: fix fallout from the addition of a 'tcx lifetime on tcx. 2014-09-08 15:28:25 +03:00
inrustwetrust 61414a9850 Changed addl_lib_search_paths from HashSet to Vec
This makes the extra library paths given to the gcc linker come in
the same order as the -L options on the rustc command line.
2014-09-07 11:42:02 +02:00
wickerwaka 2cb210d2c6 Updated to new extern crate syntax.
Added warning for old deprecated syntax
2014-09-01 09:02:00 -07:00
Aaron Turon 276b8b125d Fallout from stabilizing core::option 2014-08-28 09:12:54 -07:00
Brian Anderson bc450b17e3 core: Change the argument order on splitn and rsplitn for strs.
This makes it consistent with the same functions for slices,
and allows the search closure to be specified last.

[breaking-change]
2014-08-13 15:27:37 -07:00
Alex Crichton d9038fc3b3 rustdoc: Set a nonzero exit status on failure
Now that rustdoc is spawning a child task, the program won't exit with a default
error code if the main task fails (because it never fails). This commit forces
the main task to wait for a child task in order to correctly propagate failure.

Closes #16341
2014-08-07 20:19:18 -07:00
Alex Crichton cb8bd83888 rustdoc: Run all work in a separate task
There's a good long comment explaining why. The tl;dr; is that I have no idea
why this is necessary, but it gets --test to work on windows which is something,
right?

cc #13259
cc #16275
cc rust-lang/cargo#302
2014-08-05 20:20:54 -07:00
Alex Crichton 4dbe3eb657 rustdoc: Use --crate-name with --test
This ensures that the name of the crate is set from the command line for tests
so the auto-injection of `extern crate <name>` in doc tests works correctly.
2014-07-31 23:01:24 -07:00
Alex Crichton 51355478f4 rustdoc: Add a --target flag
Closes #13893
2014-07-25 07:55:25 -07:00
Alex Crichton 237738fa3e rustdoc: Add a --crate-name option
Like rustc, this is required by cargo to build documentation.
2014-07-24 07:26:26 -07:00
Aaron Turon 31ac8a90f1 rustdoc: make table of contents optional
rustdoc currently determines whether to produce a table of
contents (along with numbered sections) from the input type: yes for
markdown input, no for Rust input. This commit adds a flag to disable
the table of contents for markdown input, which is useful for embedding
the output in a larger context.
2014-07-24 07:26:17 -07:00
Brian Anderson 9db1d35687 collections: Deprecate shift/unshift
Use insert/remove instead.
2014-07-23 13:20:16 -07:00