]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agorustc.1: fix typo
Philipp Gesang [Tue, 15 Jul 2014 18:20:08 +0000 (20:20 +0200)]
rustc.1: fix typo

Uses the same wording as ``config.rs`` now.

10 years agoobsolete.rs: fix typo in message
Philipp Gesang [Tue, 15 Jul 2014 18:08:37 +0000 (20:08 +0200)]
obsolete.rs: fix typo in message

10 years agoauto merge of #15585 : bgamari/rust/subst-bug, r=pnkfelix
bors [Wed, 16 Jul 2014 02:11:14 +0000 (02:11 +0000)]
auto merge of #15585 : bgamari/rust/subst-bug, r=pnkfelix

This branch has a fix for #15557 (a2bcef9) as well as a variety of patches I found useful while debugging this issue. These include adding `Show` impls to a variety of types, including the majority of `syntax::ast` and some of `middle::ty`.

10 years agoauto merge of #15695 : alexcrichton/rust/fix-snapshots, r=brson
bors [Wed, 16 Jul 2014 00:31:15 +0000 (00:31 +0000)]
auto merge of #15695 : alexcrichton/rust/fix-snapshots, r=brson

This test seems to yield a different error message on cross compiles, so just
ignore it when cross compiling.

10 years agoAdd test for crash in unsafe destructor check
Ben Gamari [Sat, 12 Jul 2014 14:00:49 +0000 (10:00 -0400)]
Add test for crash in unsafe destructor check

10 years agomiddle::typeck::collect: Add debug output for lifetimes
Ben Gamari [Thu, 10 Jul 2014 19:30:49 +0000 (15:30 -0400)]
middle::typeck::collect: Add debug output for lifetimes

10 years agomiddle::kind: Don't crash when checking safety of Drop
Ben Gamari [Thu, 10 Jul 2014 18:05:28 +0000 (14:05 -0400)]
middle::kind: Don't crash when checking safety of Drop

To verify that a type can satisfy Send
`check_struct_safe_for_destructor` attempts to construct a new `ty::t`
an empty substitution list.

Previously the function would verify that the function has no type
parameters before attempting this. Unfortunately this check would not
catch functions with only regions parameters. In this case, the type
would eventually find its way to the substition engine which would
attempt to perform a substitution on the region parameters. As the
constructed substitution list is empty, this would fail, leading to a
compiler crash.

We fix this by verifying that types have both no type and region
parameters.

10 years agomiddle::subst: Better handling of parameter lookup failure
Ben Gamari [Wed, 9 Jul 2014 19:47:55 +0000 (15:47 -0400)]
middle::subst: Better handling of parameter lookup failure

10 years agotypeck::check::_match: Better error handling
Ben Gamari [Tue, 8 Jul 2014 23:45:36 +0000 (19:45 -0400)]
typeck::check::_match: Better error handling

Previously this was an Option::unwrap() which failed for me.
Unfortunately I've since inadvertently worked around the bug and have
been unable to reproduce it. With this patch hopefully the next person
to encounter this will be in a slightly better position to debug it.

10 years agomiddle: Derive Show impls
Ben Gamari [Sat, 12 Jul 2014 04:51:55 +0000 (00:51 -0400)]
middle: Derive Show impls

And change some uses of the `{:?}` format string to `{}`.

10 years agolibsyntax::ast: Derive Show impls
Ben Gamari [Sat, 12 Jul 2014 04:50:57 +0000 (00:50 -0400)]
libsyntax::ast: Derive Show impls

10 years agoauto merge of #15619 : kwantam/rust/master, r=huonw
bors [Tue, 15 Jul 2014 22:51:17 +0000 (22:51 +0000)]
auto merge of #15619 : kwantam/rust/master, r=huonw

- `width()` computes the displayed width of a string, ignoring the width of control characters.
    - arguably we might do *something* else for control characters, but the question is, what?
    - users who want to do something else can iterate over chars()

- `graphemes()` returns a `Graphemes` struct, which implements an iterator over the grapheme clusters of a &str.
    - fully compliant with [UAX#29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)
    - passes all [Unicode-supplied tests](http://www.unicode.org/reports/tr41/tr41-15.html#Tests29)

- added code to generate additionial categories in `unicode.py`
    - `Cn` aka `Not_Assigned`
    - categories necessary for grapheme cluster breaking

- tidied up the exports from libunicode
  - all exports are exposed through a module rather than directly at crate root.
  - std::prelude imports UnicodeChar and UnicodeStrSlice from std::char and std::str rather than directly from libunicode

closes #7043

10 years agoauto merge of #15615 : jakub-/rust/diagnostics, r=brson
bors [Tue, 15 Jul 2014 21:06:12 +0000 (21:06 +0000)]
auto merge of #15615 : jakub-/rust/diagnostics, r=brson

10 years agotest: Try to fix a failing snapshot test
Alex Crichton [Tue, 15 Jul 2014 21:00:37 +0000 (14:00 -0700)]
test: Try to fix a failing snapshot test

This test seems to yield a different error message on cross compiles, so just
ignore it when cross compiling.

10 years agoauto merge of #15426 : aochagavia/rust/str, r=alexcrichton
bors [Tue, 15 Jul 2014 18:41:05 +0000 (18:41 +0000)]
auto merge of #15426 : aochagavia/rust/str, r=alexcrichton

* Deprecated `str::from_utf8_owned` in favor of `String::from_utf8`
* Deprecated `str::from_utf8_lossy` in favor of `String::from_utf8_lossy`
* Deprecated `str::from_utf16` in favor of `String::from_utf16`
* Deprecated `str::from_utf16_lossy` in favor of `String::from_utf16_lossy`
* Deprecated `str::from_chars` in favor of `String::from_chars`
* Deprecated `str::from_char` in favor of `String::from_char` and `.to_string()`
* Deprecated `str::from_byte` in favor of `String::from_byte`

[breaking-change]

10 years agoFix errors
Adolfo Ochagavía [Fri, 4 Jul 2014 20:38:13 +0000 (22:38 +0200)]
Fix errors

10 years agoDeprecate `str::from_utf8_lossy`
Adolfo Ochagavía [Thu, 10 Jul 2014 16:21:16 +0000 (18:21 +0200)]
Deprecate `str::from_utf8_lossy`

Use `String::from_utf8_lossy` instead

[breaking-change]

10 years agoDeprecate `str::from_utf16_lossy`
Adolfo Ochagavía [Thu, 10 Jul 2014 15:53:51 +0000 (17:53 +0200)]
Deprecate `str::from_utf16_lossy`

Use `String::from_utf16_lossy` instead.

[breaking-change]

10 years agoDeprecate `str::from_utf16`
Adolfo Ochagavía [Thu, 10 Jul 2014 15:43:03 +0000 (17:43 +0200)]
Deprecate `str::from_utf16`

Use `String::from_utf16` instead

[breaking-change]

10 years agoDeprecate str::from_byte
Adolfo Ochagavía [Fri, 4 Jul 2014 20:18:11 +0000 (22:18 +0200)]
Deprecate str::from_byte

Replaced by `String::from_byte`

[breaking-change]

10 years agoDeprecate `str::from_char`
Adolfo Ochagavía [Fri, 4 Jul 2014 20:08:16 +0000 (22:08 +0200)]
Deprecate `str::from_char`

Use `String::from_char` or `.to_str` instead

[breaking-change]

10 years agoDeprecate `str::from_chars`
Adolfo Ochagavía [Fri, 4 Jul 2014 19:55:58 +0000 (21:55 +0200)]
Deprecate `str::from_chars`

Use `String::from_chars` instead

[breaking-change]

10 years agoDeprecate `str::from_utf8_owned`
Adolfo Ochagavía [Mon, 30 Jun 2014 14:41:30 +0000 (16:41 +0200)]
Deprecate `str::from_utf8_owned`

Use `String::from_utf8` instead

[breaking-change]

10 years agoauto merge of #15604 : mrmonday/rust/raw-socket-libc, r=alexcrichton
bors [Tue, 15 Jul 2014 17:01:07 +0000 (17:01 +0000)]
auto merge of #15604 : mrmonday/rust/raw-socket-libc, r=alexcrichton

This pull request adds some necessary function definitions and types for doing low level networking with Rust.

10 years agoauto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton
bors [Tue, 15 Jul 2014 14:26:11 +0000 (14:26 +0000)]
auto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton

Signed-off-by: Anton Lofgren <alofgren@op5.com>
10 years agoAdd low level support for polling with librustuv.
Robert Clipsham [Fri, 11 Jul 2014 09:11:14 +0000 (10:11 +0100)]
Add low level support for polling with librustuv.

 * Adds functions for using arbitrary sockets with libuv
 * Adds types and functions required to support this.

10 years agoauto merge of #15371 : pnkfelix/rust/fsk-render-dataflow-on-dot, r=alexcrichton
bors [Tue, 15 Jul 2014 12:46:14 +0000 (12:46 +0000)]
auto merge of #15371 : pnkfelix/rust/fsk-render-dataflow-on-dot, r=alexcrichton

Use one or more of the following `-Z` flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  * `-Z flowgraph-print-loans` : loans computed via middle::borrowck
  * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data
  * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data
  * `-Z flowgraph-print-all` : all of the available sets are included.

Fix #15016.

10 years agoExtend --pretty flowgraph=ID to include dataflow results in output.
Felix S. Klock II [Wed, 2 Jul 2014 15:50:18 +0000 (17:50 +0200)]
Extend --pretty flowgraph=ID to include dataflow results in output.

Use one or more of the following `-Z` flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  * `-Z flowgraph-print-loans` : loans computed via middle::borrowck
  * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data
  * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data
  * `-Z flowgraph-print-all` : all of the available sets are included.

Fix #15016.

----

This also adds a module, `syntax::ast_map::blocks`, that captures a
common abstraction shared amongst code blocks and procedure-like
things.  As part of this, moved `ast_map.rs` to subdir
`ast_map/mod.rs`, to follow our directory layout conventions.

(incorporated review feedback from huon, acrichto.)

10 years agoauto merge of #15534 : steveklabnik/rust/guide_stdin, r=brson
bors [Tue, 15 Jul 2014 07:36:17 +0000 (07:36 +0000)]
auto merge of #15534 : steveklabnik/rust/guide_stdin, r=brson

10 years agoauto merge of #15531 : steveklabnik/rust/guide_looping, r=brson
bors [Tue, 15 Jul 2014 05:56:19 +0000 (05:56 +0000)]
auto merge of #15531 : steveklabnik/rust/guide_looping, r=brson

10 years agoauto merge of #15511 : brson/rust/extract-rustc-back, r=alexcrichton
bors [Tue, 15 Jul 2014 04:16:20 +0000 (04:16 +0000)]
auto merge of #15511 : brson/rust/extract-rustc-back, r=alexcrichton

This was my weekend project, to start breaking up rustc. It first pulls out LLVM into `rustc_llvm`, then parts of `rustc::back` and `rustc::util` to `rustc_back`. The immediate intent is just to reduce the size of rustc, to reduce memory pressure when building rustc, but this is also a good starting point for further refactoring.

The `rustc_back` crate is definitely misnamed (`rustc::back` was never a very cohesive module anyway) - it's mostly just somewhere to stuff parts of rustc that don't have many deps. Right now it's main dep is `syntax`; it has no dep on `rustc_llvm`.

Some next steps might be to split `rustc_back` into `rustc_util` (with no `syntax` dep), and `rustc_syntax_util` (with a syntax dep); move the rest of `rustc::util` into `rustc_syntax_util`; move all of `rustc::front` to a new crate, `rustc_front`. At that point the refactoring necessary to keep extracting crates will get harder.

10 years agoauto merge of #15434 : steveklabnik/rust/guide_match, r=brson
bors [Tue, 15 Jul 2014 01:21:22 +0000 (01:21 +0000)]
auto merge of #15434 : steveklabnik/rust/guide_match, r=brson

10 years agoadd Graphemes iterator; tidy unicode exports
kwantam [Fri, 11 Jul 2014 21:23:45 +0000 (17:23 -0400)]
add Graphemes iterator; tidy unicode exports

- Graphemes and GraphemeIndices structs implement iterators over
  grapheme clusters analogous to the Chars and CharOffsets for chars in
  a string. Iterator and DoubleEndedIterator are available for both.

- tidied up the exports for libunicode. crate root exports are now moved
  into more appropriate module locations:
  - UnicodeStrSlice, Words, Graphemes, GraphemeIndices are in str module
  - UnicodeChar exported from char instead of crate root
  - canonical_combining_class is exported from str rather than crate root

Since libunicode's exports have changed, programs that previously relied
on the old export locations will need to change their `use` statements
to reflect the new ones. See above for more information on where the new
exports live.

closes #7043
[breaking-change]

10 years agoadd UnicodeStrSlice width() function
kwantam [Fri, 11 Jul 2014 00:28:40 +0000 (20:28 -0400)]
add UnicodeStrSlice width() function

10 years agoauto merge of #15227 : alexcrichton/rust/windows-unlink, r=brson
bors [Mon, 14 Jul 2014 23:36:23 +0000 (23:36 +0000)]
auto merge of #15227 : alexcrichton/rust/windows-unlink, r=brson

Currently when a read-only file has unlink() invoked on it on windows, the call
will fail. On unix, however, the call will succeed. In order to have a more
consistent behavior across platforms, this error is recognized on windows and
the file is changed to read-write before removal is attempted.

10 years agostd: Make unlink() more consistent
Alex Crichton [Fri, 27 Jun 2014 21:39:01 +0000 (14:39 -0700)]
std: Make unlink() more consistent

Currently when a read-only file has unlink() invoked on it on windows, the call
will fail. On unix, however, the call will succeed. In order to have a more
consistent behavior across platforms, this error is recognized on windows and
the file is changed to read-write before removal is attempted.

10 years agoFix rebase fallout. Sorry.
Brian Anderson [Sat, 12 Jul 2014 00:57:45 +0000 (17:57 -0700)]
Fix rebase fallout. Sorry.

10 years agorustc_llvm: Remove the inner llvm module
Brian Anderson [Tue, 8 Jul 2014 00:58:01 +0000 (17:58 -0700)]
rustc_llvm: Remove the inner llvm module

This makes it much saner for clients to use the library since
they don't have to worry about shadowing one llvm with another.

10 years agorustc_llvm: Remove an unnecessary workaround
Brian Anderson [Mon, 7 Jul 2014 23:54:02 +0000 (16:54 -0700)]
rustc_llvm: Remove an unnecessary workaround

Just some leftover junk from extracting llvm.

10 years agorustc: Move util::sha2 to rustc_back
Brian Anderson [Mon, 7 Jul 2014 05:21:04 +0000 (22:21 -0700)]
rustc: Move util::sha2 to rustc_back

10 years agorustc: Move util::fs to rustc_back
Brian Anderson [Mon, 7 Jul 2014 05:13:55 +0000 (22:13 -0700)]
rustc: Move util::fs to rustc_back

10 years agorustc_back: Update crate docs
Brian Anderson [Mon, 7 Jul 2014 04:58:30 +0000 (21:58 -0700)]
rustc_back: Update crate docs

Indicate that anything that can be extracted here should and that things with
syntax deps should be split out someday.

10 years agorustc: Move archive to rustc_back
Brian Anderson [Mon, 7 Jul 2014 04:50:37 +0000 (21:50 -0700)]
rustc: Move archive to rustc_back

10 years agorustc: Move ArchiveRO to rustc_llvm
Brian Anderson [Mon, 7 Jul 2014 04:43:22 +0000 (21:43 -0700)]
rustc: Move ArchiveRO to rustc_llvm

It is a wrapper around LLVM.

10 years agorustc: Invert some archive deps
Brian Anderson [Mon, 7 Jul 2014 03:46:00 +0000 (20:46 -0700)]
rustc: Invert some archive deps

10 years agoExtract rpath to rustc_back::rpath
Brian Anderson [Mon, 7 Jul 2014 01:01:16 +0000 (18:01 -0700)]
Extract rpath to rustc_back::rpath

10 years agorustc: Invert some rpath dependencies
Brian Anderson [Sun, 6 Jul 2014 21:08:09 +0000 (14:08 -0700)]
rustc: Invert some rpath dependencies

10 years agoExtract librustc_back from librustc
Brian Anderson [Sat, 5 Jul 2014 02:41:54 +0000 (19:41 -0700)]
Extract librustc_back from librustc

10 years agoMove llvm bindings to their own crate
Brian Anderson [Sat, 5 Jul 2014 20:24:57 +0000 (13:24 -0700)]
Move llvm bindings to their own crate

10 years agoauto merge of #15666 : yorkie/rust/patch-1, r=alexcrichton
bors [Mon, 14 Jul 2014 18:06:22 +0000 (18:06 +0000)]
auto merge of #15666 : yorkie/rust/patch-1, r=alexcrichton

10 years agodoc: missing quote in keyword Send
Yazhong Liu [Mon, 14 Jul 2014 17:26:41 +0000 (01:26 +0800)]
doc: missing quote in keyword Send

10 years agoauto merge of #15655 : lightsofapollo/rust/glob-match-options-pub, r=alexcrichton
bors [Mon, 14 Jul 2014 15:41:22 +0000 (15:41 +0000)]
auto merge of #15655 : lightsofapollo/rust/glob-match-options-pub, r=alexcrichton

Not sure how to test this correctly I assume the current tests pass now because of the crate boundaries [and that this is fallout from private by default]?

10 years agoauto merge of #15632 : masklinn/rust/patch-1, r=alexcrichton
bors [Mon, 14 Jul 2014 13:51:29 +0000 (13:51 +0000)]
auto merge of #15632 : masklinn/rust/patch-1, r=alexcrichton

I saw that it was bounded by `Show` but the implication is no guarantee (and had only 0.10 to test, where this behavior has been added to 0.11)

10 years agoDocument that Result.unwrap prints the Err's value
masklinn [Sat, 12 Jul 2014 15:02:15 +0000 (17:02 +0200)]
Document that Result.unwrap prints the Err's value

It is implied by the Show bound, but that implication can be missed.

10 years agoglob::MatchOptions struct fields should be public
James Lal [Mon, 14 Jul 2014 05:06:52 +0000 (22:06 -0700)]
glob::MatchOptions struct fields should be public

10 years agoauto merge of #15653 : erickt/rust/master, r=alexcrichton
bors [Mon, 14 Jul 2014 04:01:26 +0000 (04:01 +0000)]
auto merge of #15653 : erickt/rust/master, r=alexcrichton

10 years agoauto merge of #15497 : jasonthompson/rust/docs/str3, r=cmr
bors [Mon, 14 Jul 2014 02:16:28 +0000 (02:16 +0000)]
auto merge of #15497 : jasonthompson/rust/docs/str3, r=cmr

  - for 3 implementations of into_maybe_owned()
  - is_slice()
  - is_owned()

10 years agoauto merge of #15649 : catharsis/rust/rust-libstd-examples, r=alexcrichton
bors [Mon, 14 Jul 2014 00:31:30 +0000 (00:31 +0000)]
auto merge of #15649 : catharsis/rust/rust-libstd-examples, r=alexcrichton

This patch adds doc examples for the make_absolute, change_dir,
errors_string and args functions in the os module.

10 years agostd: make std::io::IoError{,Kind} implement Eq
Erick Tryzelaar [Sun, 13 Jul 2014 23:28:01 +0000 (16:28 -0700)]
std: make std::io::IoError{,Kind} implement Eq

10 years agoauto merge of #15158 : alexcrichton/rust/windows-paths, r=brson
bors [Sun, 13 Jul 2014 22:46:28 +0000 (22:46 +0000)]
auto merge of #15158 : alexcrichton/rust/windows-paths, r=brson

In order to have the spawning semantics be the same for unix/windows, the
child's PATH environment variable needs to be searched rather than the parent's
environment variable.

If the child is inheriting the parent's PATH, then no action need be taken as
windows will do the heavy lifting. If the child specifies its own PATH, then it
is searched beforehand for the target program and the result is favored if a hit
is found.

cc #15149, but does not close the issue because libgreen still needs to be
updated.

10 years agonative: Search the child's PATH on win32
Alex Crichton [Tue, 24 Jun 2014 19:10:31 +0000 (12:10 -0700)]
native: Search the child's PATH on win32

In order to have the spawning semantics be the same for unix/windows, the
child's PATH environment variable needs to be searched rather than the parent's
environment variable.

If the child is inheriting the parent's PATH, then no action need be taken as
windows will do the heavy lifting. If the child specifies its own PATH, then it
is searched beforehand for the target program and the result is favored if a hit
is found.

cc #15149, but does not close the issue because libgreen still needs to be
updated.

10 years agoauto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichton
bors [Sun, 13 Jul 2014 21:01:28 +0000 (21:01 +0000)]
auto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichton

This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]

10 years agoStabilization for `owned` (now `boxed`) and `cell`
Aaron Turon [Thu, 10 Jul 2014 21:19:17 +0000 (14:19 -0700)]
Stabilization for `owned` (now `boxed`) and `cell`

This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]

10 years agolibstd: Add a few doc examples
Anton Lofgren [Sun, 13 Jul 2014 09:49:53 +0000 (11:49 +0200)]
libstd: Add a few doc examples

This patch adds doc examples for the make_absolute, change_dir,
errors_string and args functions in the os module.

10 years agoauto merge of #15646 : jbclements/rust/method-macros, r=cmr
bors [Sun, 13 Jul 2014 19:16:28 +0000 (19:16 +0000)]
auto merge of #15646 : jbclements/rust/method-macros, r=cmr

This patch adds support for macros in method position. It follows roughly the template for Item macros, where an outer `Method` wrapper contains a `Method_` enum which can either be a macro invocation or a standard macro definition.

One note; adding support for macros that expand into multiple methods is not included here, but should be a simple parser change, since this patch updates the type of fold_macro to return a smallvector of methods.

For reviewers, please pay special attention to the parser changes; these are the ones I'm most concerned about.

Because of the small change to the interface of fold_method, this is a ...

[breaking change]

10 years agomacro expansion for methods
John Clements [Sun, 13 Jul 2014 16:35:48 +0000 (09:35 -0700)]
macro expansion for methods

Closes #4621

10 years agoexpansion abstraction
John Clements [Sat, 12 Jul 2014 22:00:23 +0000 (15:00 -0700)]
expansion abstraction

10 years agoadd make_method method to MacResult trait
John Clements [Fri, 11 Jul 2014 00:46:09 +0000 (17:46 -0700)]
add make_method method to MacResult trait

this allows macro results to be parsed as methods

10 years agomacro in method position parsing
John Clements [Mon, 7 Jul 2014 22:15:31 +0000 (15:15 -0700)]
macro in method position parsing

10 years agoremove no-stmt check
John Clements [Sun, 13 Jul 2014 01:25:39 +0000 (18:25 -0700)]
remove no-stmt check

nothing wrong with a statement expanding into 0 stmts, that I can see.

10 years agoupdate fold_method to return a smallvector
John Clements [Sun, 13 Jul 2014 05:33:30 +0000 (22:33 -0700)]
update fold_method to return a smallvector

This is nice for macros, to allow them to expand into multiple methods

10 years agomacro method unit test case fix
John Clements [Sat, 12 Jul 2014 04:17:17 +0000 (21:17 -0700)]
macro method unit test case fix

10 years agotest case for method macros
John Clements [Sat, 12 Jul 2014 03:56:46 +0000 (20:56 -0700)]
test case for method macros

10 years agorefactor Method definition to make space for macros
John Clements [Sat, 12 Jul 2014 04:22:11 +0000 (21:22 -0700)]
refactor Method definition to make space for macros

This change propagates to many locations, but because of the
Macro Exterminator (or, more properly, the invariant that it
protects), macro invocations can't occur downstream of expansion.
This means that in librustc and librustdoc, extracting the
desired field can simply assume that it can't be a macro
invocation. Functions in ast_util abstract over this check.

10 years agoauto merge of #15507 : jakub-/rust/iterate, r=alexcrichton
bors [Sun, 13 Jul 2014 15:51:27 +0000 (15:51 +0000)]
auto merge of #15507 : jakub-/rust/iterate, r=alexcrichton

The new iterator takes a function and produces an infinite stream
of results of repeated applications of the function, starting from
the provided seed value.

10 years agoAdd an iterate function to core::iter
Jakub Wieczorek [Sun, 6 Jul 2014 22:50:53 +0000 (00:50 +0200)]
Add an iterate function to core::iter

Implementation by Kevin Ballard.

The function returns an Unfold iterator producing an infinite stream
of results of repeated applications of the function, starting from
the provided seed value.

10 years agoauto merge of #15639 : supr/rust/master, r=sfackler
bors [Sun, 13 Jul 2014 08:16:26 +0000 (08:16 +0000)]
auto merge of #15639 : supr/rust/master, r=sfackler

* Fixes a typo in the libstd documentation, referring UPD instead of UDP

10 years agoauto merge of #15633 : nham/rust/hash_treeset, r=alexcrichton
bors [Sun, 13 Jul 2014 06:31:29 +0000 (06:31 +0000)]
auto merge of #15633 : nham/rust/hash_treeset, r=alexcrichton

cc #15294

10 years agoImplement Hash trait for TreeSet and TreeMap.
nham [Sat, 12 Jul 2014 17:23:20 +0000 (13:23 -0400)]
Implement Hash trait for TreeSet and TreeMap.

10 years agoauto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmr
bors [Sun, 13 Jul 2014 04:46:31 +0000 (04:46 +0000)]
auto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmr

* Don't warn about `#[crate_name]` if `--crate-name` is specified
* Don't warn about non camel case identifiers on `#[repr(C)]` structs
* Switch `mode` to `mode_t` in libc.

10 years agoUse a nicer Show impl for Name
Corey Richardson [Fri, 11 Jul 2014 02:53:09 +0000 (19:53 -0700)]
Use a nicer Show impl for Name

10 years agoauto merge of #15621 : sfackler/rust/attr-span, r=cmr
bors [Sun, 13 Jul 2014 03:01:32 +0000 (03:01 +0000)]
auto merge of #15621 : sfackler/rust/attr-span, r=cmr

They used to be one token too long, so you'd see things like
```
rust/rust/test.rs:1:1: 2:2 warning: unused attribute,
rust/rust/test.rs:1 #![foo]
rust/rust/test.rs:2 #![bar]
```
instead of
```
test.rs:1:1: 1:8 warning: unused attribute, #[warn(unused_attribute)] on
by default
test.rs:1 #![foo]
          ^~~~~~~
```

10 years agoauto merge of #15614 : lucidd/rust/#15474, r=alexcrichton
bors [Sun, 13 Jul 2014 01:16:34 +0000 (01:16 +0000)]
auto merge of #15614 : lucidd/rust/#15474, r=alexcrichton

This fixes #15474

10 years agoFix Documentation Typo in libstd
Prudhvi Krishna Surapaneni [Sun, 13 Jul 2014 01:06:53 +0000 (18:06 -0700)]
Fix Documentation Typo in libstd

10 years agoauto merge of #15617 : aturon/rust/std-more-experimental, r=alexcrichton
bors [Sat, 12 Jul 2014 23:31:33 +0000 (23:31 +0000)]
auto merge of #15617 : aturon/rust/std-more-experimental, r=alexcrichton

The `hash` module was not included in an earlier pass that sets baseline
stability of modules within `std` to `experimental`.

10 years agoConvert a first batch of diagnostics to have error codes
Jakub Wieczorek [Fri, 11 Jul 2014 16:54:01 +0000 (18:54 +0200)]
Convert a first batch of diagnostics to have error codes

10 years agoauto merge of #15613 : cmr/rust/rustdoc-arg-patterns, r=alexcrichton
bors [Sat, 12 Jul 2014 19:51:35 +0000 (19:51 +0000)]
auto merge of #15613 : cmr/rust/rustdoc-arg-patterns, r=alexcrichton

10 years agoauto merge of #15610 : brson/rust/0.12.0, r=alexcrichton
bors [Sat, 12 Jul 2014 18:06:36 +0000 (18:06 +0000)]
auto merge of #15610 : brson/rust/0.12.0, r=alexcrichton

10 years agoauto merge of #15607 : lucidd/rust/master, r=pnkfelix
bors [Sat, 12 Jul 2014 16:21:36 +0000 (16:21 +0000)]
auto merge of #15607 : lucidd/rust/master, r=pnkfelix

I used the same description rustc --help outputs.

10 years agoauto merge of #15605 : blake2-ppc/rust/rustdoc-const-t, r=alexcrichton
bors [Sat, 12 Jul 2014 14:36:35 +0000 (14:36 +0000)]
auto merge of #15605 : blake2-ppc/rust/rustdoc-const-t, r=alexcrichton

Update the formatting of raw immutable pointers to print *const T.

10 years agoauto merge of #15602 : adrientetar/rust/name-fix, r=huonw
bors [Sat, 12 Jul 2014 12:51:38 +0000 (12:51 +0000)]
auto merge of #15602 : adrientetar/rust/name-fix, r=huonw

Not sure how I did miss that in the first place...

r? @alexcrichton

10 years agoauto merge of #15601 : jbclements/rust/disable-default-macro-behavior, r=alexcrichton
bors [Sat, 12 Jul 2014 11:06:39 +0000 (11:06 +0000)]
auto merge of #15601 : jbclements/rust/disable-default-macro-behavior, r=alexcrichton

Our AST definition can include macro invocations, which can expand into all kinds of things. Macro invocations are expanded away during expansion time, and the rest of the compiler doesn't have to deal with them. However, we have no way of enforcing this.

This patch adds two protective mechanisms.

First, it adds a (quick) explicit check that ensures there are no macro invocations remaining in the AST after expansion. Second, it updates the visit and fold mechanisms so that by default, they will not traverse macro invocations. It's easy enough to add this, if desired (it's documented in the source, and examples appear, e.g. in the IdentFinder.

Along the way, I also consulted with @sfackler to refactor the macro export mechanism so that it stores macro text spans in a side table, rather than leaving them in the AST.

10 years agoauto merge of #15592 : arjantop/rust/bufwriter-write-fix, r=alexcrichton
bors [Sat, 12 Jul 2014 09:21:39 +0000 (09:21 +0000)]
auto merge of #15592 : arjantop/rust/bufwriter-write-fix, r=alexcrichton

First condition is not needed and just prevents 0 length writes

Fixes #15583

10 years agoauto merge of #15588 : alexcrichton/rust/issue-15478, r=cmr
bors [Sat, 12 Jul 2014 06:46:42 +0000 (06:46 +0000)]
auto merge of #15588 : alexcrichton/rust/issue-15478, r=cmr

If modified, you can safely unmap arbitrary memory. These fields are not
intended to be modified, so read-only accessors are the only ones that are
provided.

Closes #15478

10 years agolibc: Switch open to use a mode_t on unix
Alex Crichton [Thu, 10 Jul 2014 17:33:15 +0000 (10:33 -0700)]
libc: Switch open to use a mode_t on unix

While I'm at it, export O_SYNC with the other flags that are exported.

Closes #15582

10 years agostd: Move MemoryMap fields to methods
Alex Crichton [Thu, 10 Jul 2014 20:20:39 +0000 (13:20 -0700)]
std: Move MemoryMap fields to methods

If modified, you can safely unmap arbitrary memory. These fields are not
intended to be modified, so read-only accessors are the only ones that are
provided.

Closes #15478

10 years agoauto merge of #15597 : brson/rust/ldconfig, r=pcwalton
bors [Sat, 12 Jul 2014 04:16:44 +0000 (04:16 +0000)]
auto merge of #15597 : brson/rust/ldconfig, r=pcwalton

If ldconfig fails it emits a warning. This is very possible when installing
to a non-system directory, so the warning tries to indicate that it may
not be a problem.

10 years agoOnly run ldconfig on Linux
Brian Anderson [Sat, 12 Jul 2014 00:08:58 +0000 (17:08 -0700)]
Only run ldconfig on Linux

10 years agoauto merge of #15589 : Denommus/rust/master, r=alexcrichton
bors [Sat, 12 Jul 2014 00:31:46 +0000 (00:31 +0000)]
auto merge of #15589 : Denommus/rust/master, r=alexcrichton

I have noticed some errors and some absences that I considered essential to the usability of rustc in zsh, so I included them and updated some of the man page.

10 years agoFix spans for attributes
Steven Fackler [Fri, 11 Jul 2014 22:26:26 +0000 (15:26 -0700)]
Fix spans for attributes

They used to be one token too long, so you'd see things like
```
rust/rust/test.rs:1:1: 2:2 warning: unused attribute,
rust/rust/test.rs:1 #![foo]
rust/rust/test.rs:2 #![bar]
```
instead of
```
test.rs:1:1: 1:8 warning: unused attribute, #[warn(unused_attribute)] on
by default
test.rs:1 #![foo]
          ^~~~~~~
```