Commit Graph

32771 Commits

Author SHA1 Message Date
Keegan McAllister c9f0ff3813 Reserve the keyword 'macro' 2015-01-05 18:21:14 -08:00
Keegan McAllister aa69cbde82 Allow selective macro import 2015-01-05 18:21:13 -08:00
Keegan McAllister 0816255c80 Move #[macro_reexport] to extern crate 2015-01-05 18:21:13 -08:00
Keegan McAllister 60be2f52d2 Replace #[phase] with #[plugin] / #[macro_use] / #[no_link] 2015-01-05 18:21:13 -08:00
Keegan McAllister f314e2c4ea creader: Load parts of plugin metadata on demand 2015-01-05 18:21:13 -08:00
Keegan McAllister 677b7cad3d Reformat metadata for exported macros
Instead of copy-pasting the whole macro_rules! item from the original .rs file,
we serialize a separate name, attributes list, and body, the latter as
pretty-printed TTs.  The compilation of macro_rules! macros is decoupled
somewhat from the expansion of macros in item position.

This filters out comments, and facilitates selective imports.
2015-01-05 12:00:57 -08:00
Keegan McAllister 24aa7f0e38 creader: Use a single struct 2015-01-05 12:00:57 -08:00
Keegan McAllister 5171b325bd creader: Convert free functions to Env methods 2015-01-05 12:00:57 -08:00
Keegan McAllister 5bf385be6a Rename macro_escape to macro_use
In the future we want to support

    #[macro_use(foo, bar)]
    mod macros;

but it's not an essential part of macro reform.  Reserve the syntax for now.
2015-01-05 12:00:57 -08:00
Keegan McAllister fc58479323 Stop using macro_escape as an inner attribute
In preparation for the rename.
2015-01-05 12:00:57 -08:00
Keegan McAllister 73806ddd0f Use $crate and macro reexport to reduce duplicated code
Many of libstd's macros are now re-exported from libcore and libcollections.
Their libstd definitions have moved to a macros_stage0 module and can disappear
after the next snapshot.

Where the two crates had already diverged, I took the libstd versions as
they're generally newer and better-tested. See e.g. d3c831b, which was a fix to
libstd's assert_eq!() that didn't make it into libcore's.

Fixes #16806.
2015-01-05 12:00:56 -08:00
Keegan McAllister 1c2fddc6bf Remove unused if_ok! macro 2015-01-05 11:38:12 -08:00
Keegan McAllister 538288176a Implement macro re-export
Fixes #17103.
2015-01-05 11:38:12 -08:00
Keegan McAllister e2a9c04e19 Allow leading :: in use items 2015-01-05 11:38:12 -08:00
Keegan McAllister ad7c647773 Add a special macro nonterminal $crate 2015-01-05 11:38:12 -08:00
Keegan McAllister 5e5924b799 Replace LetSyntaxTT with MacroRulesTT
The implementation of LetSyntaxTT was specialized to macro_rules! in various
ways. This gets rid of the false generality and simplifies the code.
2015-01-05 11:38:12 -08:00
Keegan McAllister d1cf1b1e6b Don't test codegen-units errors on stage1 (c.f. #20184) 2015-01-05 11:38:11 -08:00
bors 03268bbf35 auto merge of #20514 : alexcrichton/rust/serialize-associated-type, r=aturon
This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
2015-01-05 14:51:03 +00:00
bors 8e83af6e87 auto merge of #20451 : brson/rust/installer, r=alexcrichton
This fixes a mostly harmless syntax error in the install script.
2015-01-05 11:10:57 +00:00
Alex Crichton 0cb7a4062a serialize: Use assoc types + less old_orphan_check
This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
2015-01-04 22:59:26 -08:00
bors 1f732ef53d auto merge of #20395 : huonw/rust/char-stab-2, r=aturon
cc #19260 

The casing transformations are left unstable (it is highly likely to be better to adopt the proper non-1-to-1 case mappings, per #20333) as are `is_xid_*`.

I've got a little todo list in the last commit of things I thought about/was told about that I haven't yet handled (I'd also like some feedback).
2015-01-05 06:45:39 +00:00
bors ed22606c83 auto merge of #20285 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
This commit introduces the syntax for negative implementations of traits
as shown below:

`impl !Trait for Type {}`

cc #13231
Part of RFC rust-lang/rfcs#127

r? @nikomatsakis
2015-01-05 04:20:46 +00:00
Huon Wilson 990a79f097 char: small tweak since `is_some` > equivalent `match`. 2015-01-05 12:30:51 +11:00
Huon Wilson e670fb484b Apply explicit stabilities to unicode parts of CharExt. 2015-01-05 12:30:51 +11:00
Huon Wilson 0302d37977 Merge `UnicodeChar` and `CharExt`.
This "reexports" all the functionality of `core::char::CharExt` as
methods on `unicode::u_char::UnicodeChar` (renamed to `CharExt`).

Imports may need to be updated (one now just imports
`unicode::CharExt`, or `std::char::CharExt` rather than two traits from
either), so this is a

[breaking-change]
2015-01-05 12:30:51 +11:00
Huon Wilson 19120209d8 Rename `core::char::Char` to `CharExt` to match prelude guidelines.
Imports may need to be updated so this is a

[breaking-change]
2015-01-05 12:30:30 +11:00
Huon Wilson 01417f245c Mark the contents of `char` stable. 2015-01-05 12:29:41 +11:00
Huon Wilson 8018293e08 Switch encode_utf* to by-value self. 2015-01-05 12:28:54 +11:00
Huon Wilson abdeefdbcc Remove deprecated functionality from `char`. 2015-01-05 12:28:54 +11:00
bors ad9e759382 auto merge of #20163 : bfops/rust/master, r=Gankro
TODOs:
  - ~~Entry is still `<'a, K, V>` instead of `<'a, O, V>`~~
  - ~~BTreeMap is still outstanding~~.
  - ~~Transform appropriate things into `.entry(...).get().or_else(|e| ...)`~~

Things that make me frowny face:
  - I'm not happy about the fact that this `clone`s the key even when it's already owned.
  - With small keys (e.g. `int`s), taking a reference seems wasteful.

r? @Gankro
cc: @cgaebel
2015-01-05 00:26:28 +00:00
Flavio Percoco c062fac835 Put negative trait implemtations behind a feature gate 2015-01-04 23:16:14 +01:00
Flavio Percoco 8b883ab268 Add syntax for negative implementations of traits
This commit introduces the syntax for negative implmenetations of traits
as shown below:

`impl !Trait for Type {}`

cc #13231
Part of RFC #3
2015-01-04 23:16:13 +01:00
bors 5773bdefff Merge pull request #20520 from nhowell/patch-1
doc: Add missing `$`s in the Installing Rust guide

Reviewed-by: steveklabnik, steveklabnik
2015-01-04 21:36:41 +00:00
bors 589c38a3af Merge pull request #20515 from tshepang/modernise-ping-pong-benchmark
bench: remove warnings from rt-messaging-ping-pong.rs

Reviewed-by: alexcrichton
2015-01-04 21:36:41 +00:00
bors f1cda51bb4 Merge pull request #20512 from bjz/rustdoc
Allow rustdoc to accept vector pattern arguments

Reviewed-by: alexcrichton, alexcrichton
2015-01-04 21:36:40 +00:00
bors 0fd2c84c6f Merge pull request #20510 from tshepang/patch-6
doc: remove incomplete sentence

Reviewed-by: steveklabnik, steveklabnik
2015-01-04 21:36:40 +00:00
bors eb6f340d2a Merge pull request #20505 from estsauver/doc_20504
Update guide index to point to the task page

Reviewed-by: alexcrichton
2015-01-04 21:36:39 +00:00
bors 612be77c1f Merge pull request #20500 from globin/fix/range-sugar
Fix range sugar

Reviewed-by: nick29581
2015-01-04 21:36:39 +00:00
bors 05164ba1e0 Merge pull request #20495 from brson/cargo
Update guide for Cargo installation

Reviewed-by: steveklabnik
2015-01-04 21:36:38 +00:00
bors 0b28a7990f Merge pull request #20487 from trapp/doc-namespace-typo
Fix typo in documentation.

Reviewed-by: alexcrichton
2015-01-04 21:36:38 +00:00
bors 59c9f5e250 Merge pull request #20485 from ipetkov/man-fix
Man page/--help dialog fix

Reviewed-by: alexcrichton
2015-01-04 21:36:37 +00:00
bors 05abc65b99 Merge pull request #20464 from ranma42/improve-make-hash
Improve `make_hash` function

Reviewed-by: Gankro, Gankro
2015-01-04 21:36:36 +00:00
bors 56795ad8c3 Merge pull request #20457 from frewsxcv/rm-reexports
Remove graphviz::LabelText::* public reexport

Reviewed-by: cmr
2015-01-04 21:36:36 +00:00
bors 48c6c80795 Merge pull request #20452 from brson/rustup
Move rustup to the combined installer

Reviewed-by: brson
2015-01-04 21:36:35 +00:00
bors 0eb7da758d Merge pull request #20442 from csouth3/vim-syntax
Fix vim syntax highlighting for `derive`

Reviewed-by: alexcrichton
2015-01-04 21:36:34 +00:00
bors 69479e2ba6 Merge pull request #20428 from tbu-/pr_guide_int_to_i32_2nd_take
Make all integers in the guide `i32`, implicitely

Reviewed-by: steveklabnik
2015-01-04 21:36:34 +00:00
bors 1436b92898 Merge pull request #19963 from tshepang/patch-3
doc: mailing list is deprecated

Reviewed-by: brson
2015-01-04 21:36:33 +00:00
bors e9818564bd Merge pull request #20295 from eddyb/poly-const
Allow paths in constants to refer to polymorphic items.

Reviewed-by: nikomatsakis
2015-01-04 21:36:33 +00:00
Ben Foppa 400c3a0ddc [breaking change] Update entry API as part of RFC 509. 2015-01-04 15:55:54 -05:00
bors b2085d9674 auto merge of #20527 : nikomatsakis/rust/japaric-boxed-uc-ice-fix, r=aturon
This fixes an ICE that japaric was encountering in the wf checker.

r? @aturon
2015-01-04 19:06:46 +00:00