]> git.lizzy.rs Git - rust.git/log
rust.git
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 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]
          ^~~~~~~
```

10 years agoauto merge of #15586 : aturon/rust/stability-dashboard, r=alexcrichton
bors [Fri, 11 Jul 2014 22:06:43 +0000 (22:06 +0000)]
auto merge of #15586 : aturon/rust/stability-dashboard, r=alexcrichton

This PR adds a crate-level dashboard summarizing the stability levels of all items for all submodules of the crate.

The information is also written as a json file, intended for consumption by pages like http://huonw.github.io/isrustfastyet/

Along the way, fixes a few bugs in stability tracking and places where rustdoc was not pulling the existing stability data.

Closes #13541

10 years agomark std::hash experimental
Aaron Turon [Fri, 11 Jul 2014 21:25:15 +0000 (14:25 -0700)]
mark std::hash experimental

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

10 years agorustdoc: render 1-tuples as (T,) instead of (T)
Kevin Walter [Fri, 11 Jul 2014 19:51:29 +0000 (21:51 +0200)]
rustdoc: render 1-tuples as (T,) instead of (T)

10 years agorustdoc: support tuple and struct patterns in function arguments
Corey Richardson [Fri, 11 Jul 2014 18:59:18 +0000 (11:59 -0700)]
rustdoc: support tuple and struct patterns in function arguments

10 years agounicode: Remove crate_id attr
Brian Anderson [Fri, 11 Jul 2014 18:26:46 +0000 (11:26 -0700)]
unicode: Remove crate_id attr

10 years agoBump version to 0.12.0-pre
Brian Anderson [Fri, 11 Jul 2014 18:25:28 +0000 (11:25 -0700)]
Bump version to 0.12.0-pre

10 years agoUpdate doc URLs for version bump
Brian Anderson [Fri, 11 Jul 2014 18:21:57 +0000 (11:21 -0700)]
Update doc URLs for version bump

10 years agoauto merge of #15565 : alexcrichton/rust/issue-15475, r=huonw
bors [Fri, 11 Jul 2014 18:06:37 +0000 (18:06 +0000)]
auto merge of #15565 : alexcrichton/rust/issue-15475, r=huonw

If a plugin registrar is available, the library must be found in dylib form, not
just in rlib form.

Closes #15475

10 years agoadd Macro Exterminator
John Clements [Wed, 9 Jul 2014 23:41:13 +0000 (16:41 -0700)]
add Macro Exterminator

the Macro Exterminator ensures that there are no macro invocations in
an AST. This should help make later passes confident that there aren't
hidden items, methods, expressions, etc.

10 years agomake walk/visit_mac opt-in only
John Clements [Wed, 9 Jul 2014 21:48:12 +0000 (14:48 -0700)]
make walk/visit_mac opt-in only

macros can expand into arbitrary items, exprs, etc. This
means that using a default walker or folder on an AST before
macro expansion is complete will miss things (the things that
the macros expand into). As a partial fence against this, this
commit moves the default traversal of macros into a separate
procedure, and makes the default trait implementation signal
an error. This means that Folders and Visitors can traverse
macros if they want to, but they need to explicitly add an
impl that calls the walk_mac or fold_mac procedure

This should prevent problems down the road.

10 years agouse side table to store exported macros
John Clements [Thu, 10 Jul 2014 22:41:11 +0000 (15:41 -0700)]
use side table to store exported macros

Per discussion with @sfackler, refactored the expander to
change the way that exported macros are collected. Specifically,
a crate now contains a side table of spans that exported macros
go into.

This has two benefits. First, the encoder doesn't need to scan through
the expanded crate in order to discover exported macros. Second, the
expander can drop all expanded macros from the crate, with the pleasant
result that a fully expanded crate contains no macro invocations (which
include macro definitions).

10 years agorename one of the two confusing MacroExpanders
John Clements [Thu, 10 Jul 2014 19:09:56 +0000 (12:09 -0700)]
rename one of the two confusing MacroExpanders

There were two things named MacroExpander, which was confusing. I renamed
one of them TTMacroExpander.

[breaking change]

10 years agoauto merge of #15503 : pnkfelix/rust/fsk-linear-deriving-partialord, r=huonw
bors [Fri, 11 Jul 2014 15:56:38 +0000 (15:56 +0000)]
auto merge of #15503 : pnkfelix/rust/fsk-linear-deriving-partialord, r=huonw

Instead of generating a separate case (albeit trivial) for each of the N*N cases when comparing two instances of an enum with N variants, this `deriving` uses the strategy outlined here: https://github.com/rust-lang/rust/issues/15375#issuecomment-47994007

In particular, it generates code that looks more like this:

```rust
    match (this, that, ...) {
      (Variant1, Variant1, Variant1) => ... // delegate Matching on Variant1
      (Variant2, Variant2, Variant2) => ... // delegate Matching on Variant2
      ...
      _ => {
        let index_tup = {
          let idx_this = match this { Variant1 => 0u, Variant2 => 1u, ... };
          let idx_that = match that { Variant1 => 0u, Variant2 => 1u, ... };
          ...
          (idx_this, idx_that, ...)
        };
        ... // delegate to catch-all; it can inspect `index_tup` for its logic
      }
    }
```

While adding a new variant to the `const_nonmatching` flag (and renaming it to `on_nonmatching`) to allow expressing the above (while still allowing one to opt back into the old `O(N^2)` and in general `O(N^K)` (where `K` is the number of self arguments) code generation behavior), I had two realizations:

 1. Observation: Nothing except for the comparison derivings (`PartialOrd`, `Ord`, `PartialEq`, `Eq`) were even using the old `O(N^K)` code generator.  So after this hypothetically lands, *nothing* needs to use them, and thus that code generation strategy could be removed, under the assumption that it is very unlikely that any `deriving` mode will actually need that level of generality.
 2. Observation: The new code generator I am adding can actually be unified with all of the other code generators that just dispatch on the variant tag (they all assume that there is only one self argument).

These two observations mean that one can get rid of the `const_nonmatching` (aka `on_nonmatching`) entirely.  So I did that too in this PR.

The question is: Do we actually want to follow through on both of the above observations?  I'm pretty sure the second observation is a pure win.  But there *might* be someone out there with an example that invalidates the reasoning in the first observation.  That is, there might be a client out there with an example of hypothetical deriving mode that wants to opt into the `O(N^K)` behavior.  So, if that is true, then I can revise this PR to resurrect the `on_nonmatching` flag and provide a way to access the `O(N^K)` behavior.

The manner in which I choose to squash these commits during a post-review rebase depends on the answer to the above question.

Fix #15375.

10 years agoRemoved dead structures after changes to PartialOrd/Ord derivings.
Felix S. Klock II [Mon, 7 Jul 2014 07:13:49 +0000 (09:13 +0200)]
Removed dead structures after changes to PartialOrd/Ord derivings.

Remove the `NonMatchesExplode` variant now that no deriving impl uses it.
Removed `EnumNonMatching` entirely.
Remove now irrelevant `on_matching` field and `HandleNonMatchingEnums` type.
Removed unused `EnumNonMatchFunc` type def.

Drive-by: revise `EnumNonMatchCollapsedFunc` doc.
Made all calls to `expand_enum_method_body` go directly to
`build_enum_match_tuple`.

Alpha-rename `enum_nonmatch_g` back to `enum_nonmatch_f` to reduce overall diff noise.
Inline sole call of `some_ordering_const`.
Inline sole call of `ordering_const`.

Removed a bunch of code that became dead after the above changes.

10 years ago`O(n*k)` code-size deriving on enums (better than previous `O(n^k)`).
Felix S. Klock II [Sun, 6 Jul 2014 19:19:12 +0000 (21:19 +0200)]
`O(n*k)` code-size deriving on enums (better than previous `O(n^k)`).

In the above formulas, `n` is the number of variants, and `k` is the
number of self-args fed into deriving.  In the particular case of
interest (namely `PartialOrd` and `Ord`), `k` is always 2, so we are
basically comparing `O(n)` versus `O(n^2)`.

Also, the stage is set for having *all* enum deriving codes go through
`build_enum_match_tuple` and getting rid of `build_enum_match`.

Also, seriously attempted to clean up the code itself.  Added a bunch
of comments attempting to document what I learned as I worked through
the original code and adapted it to this new strategy.

10 years agoRevise the `const_nonmatching` flag with more info about author's intent.
Felix S. Klock II [Sat, 5 Jul 2014 06:04:07 +0000 (08:04 +0200)]
Revise the `const_nonmatching` flag with more info about author's intent.

In particular, I want authors of deriving modes to understand what
they are opting into (namely quadratic code size or worse) when they
select NonMatchesExplode.

10 years agoauto merge of #15580 : pnkfelix/rust/fsk-fix-15558, r=alexcrichton
bors [Fri, 11 Jul 2014 13:51:39 +0000 (13:51 +0000)]
auto merge of #15580 : pnkfelix/rust/fsk-fix-15558, r=alexcrichton

Fix #15558.

10 years agoAdd rustc --pretty flowgraph to man page
Kevin Walter [Fri, 11 Jul 2014 13:51:01 +0000 (15:51 +0200)]
Add rustc --pretty flowgraph to man page

10 years agoAllow writes of length 0 to a full buffer
Arjan Topolovec [Thu, 10 Jul 2014 22:51:14 +0000 (00:51 +0200)]
Allow writes of length 0 to a full buffer

10 years agoauto merge of #15576 : mrmonday/rust/patch-1, r=alexcrichton
bors [Fri, 11 Jul 2014 12:06:40 +0000 (12:06 +0000)]
auto merge of #15576 : mrmonday/rust/patch-1, r=alexcrichton

Add a couple of lines mentioning event_loop_factory - no clear error message is given if you attempt to perform I/O in tasks created in this fashion. I spent a many hours debugging this yesterday which would have been avoided if it were documented.

10 years agoauto merge of #15575 : mvdnes/rust/spinlock_error, r=alexcrichton
bors [Fri, 11 Jul 2014 10:21:42 +0000 (10:21 +0000)]
auto merge of #15575 : mvdnes/rust/spinlock_error, r=alexcrichton

The current example of a spinlock was not correct. The lock is actually acquired
when `old == result`. So we only need to deschedule when this is not the case.

10 years agorustdoc: Change type name of raw pointer from *T to *const T
root [Fri, 11 Jul 2014 09:35:02 +0000 (11:35 +0200)]
rustdoc: Change type name of raw pointer from *T to *const T

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

10 years agoauto merge of #15574 : omasanori/rust/hidden, r=huonw
bors [Fri, 11 Jul 2014 08:36:40 +0000 (08:36 +0000)]
auto merge of #15574 : omasanori/rust/hidden, r=huonw

10 years agowebfonts: name fix
Adrien Tétar [Fri, 11 Jul 2014 07:49:59 +0000 (09:49 +0200)]
webfonts: name fix

10 years agoauto merge of #15570 : omasanori/rust/radix, r=alexcrichton
bors [Fri, 11 Jul 2014 05:36:37 +0000 (05:36 +0000)]
auto merge of #15570 : omasanori/rust/radix, r=alexcrichton

10 years agoBug fixes for stability tracking
Aaron Turon [Thu, 10 Jul 2014 18:17:40 +0000 (11:17 -0700)]
Bug fixes for stability tracking

This commit adds correct stability tracking for struct fields and
corrects some places where rustdoc was not pulling the stability data.

10 years agorustdoc: Add stability dashboard
Aaron Turon [Fri, 4 Jul 2014 07:51:46 +0000 (00:51 -0700)]
rustdoc: Add stability dashboard

This commit adds a crate-level dashboard summarizing the stability
levels of all items for all submodules of the crate.

The information is also written as a json file, intended for consumption
by pages like http://huonw.github.io/isrustfastyet/

Closes #13541

10 years agoinstall: Run ldconfig when installing on Unix. Closes #15596.
Brian Anderson [Fri, 11 Jul 2014 01:25:50 +0000 (18:25 -0700)]
install: Run ldconfig when installing on Unix. Closes #15596.

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 agoinstall: Make the LD_LIRARY_PATH warning more aesthetic
Brian Anderson [Fri, 11 Jul 2014 01:16:48 +0000 (18:16 -0700)]
install: Make the LD_LIRARY_PATH warning more aesthetic

10 years agoauto merge of #15564 : alexcrichton/rust/moar-hash, r=huonw
bors [Fri, 11 Jul 2014 01:11:36 +0000 (01:11 +0000)]
auto merge of #15564 : alexcrichton/rust/moar-hash, r=huonw

- semver::Version is now Eq, Ord, and Hash
- Path is now PartialOrd and Ord

10 years agoSome documentation fixes and improvements
Yuri Albuquerque [Thu, 10 Jul 2014 19:57:04 +0000 (15:57 -0400)]
Some documentation fixes and improvements

10 years agoauto merge of #15336 : jakub-/rust/diagnostics, r=brson
bors [Thu, 10 Jul 2014 23:26:39 +0000 (23:26 +0000)]
auto merge of #15336 : jakub-/rust/diagnostics, r=brson

This is a continuation of @brson's work from https://github.com/rust-lang/rust/pull/12144.

This implements the minimal scaffolding that allows mapping diagnostic messages to alpha-numeric codes, which could improve the searchability of errors. In addition, there's a new compiler option, `--explain {code}` which takes an error code and prints out a somewhat detailed explanation of the error. Example:

```rust
fn f(x: Option<bool>) {
match x {
Some(true) | Some(false) => (),
None => (),
Some(true) => ()
}
}
```

```shell
[~/rust]$ ./build/x86_64-apple-darwin/stage2/bin/rustc ./diagnostics.rs --crate-type dylib
diagnostics.rs:5:3: 5:13 error: unreachable pattern [E0001] (pass `--explain E0001` to see a detailed explanation)
diagnostics.rs:5  Some(true) => ()
                  ^~~~~~~~~~
error: aborting due to previous error
[~/rust]$ ./build/x86_64-apple-darwin/stage2/bin/rustc --explain E0001

    This error suggests that the expression arm corresponding to the noted pattern
    will never be reached as for all possible values of the expression being matched,
    one of the preceeding patterns will match.

    This means that perhaps some of the preceeding patterns are too general, this
    one is too specific or the ordering is incorrect.

```

I've refrained from migrating many errors to actually use the new macros as it can be done in an incremental fashion but if we're happy with the approach, it'd be good to do all of them sooner rather than later.

Originally, I was going to make libdiagnostics a separate crate but that's posing some interesting challenges with semi-circular dependencies. In particular, librustc would have a plugin-phase dependency on libdiagnostics, which itself depends on librustc. Per my conversation with @alexcrichton, it seems like the snapshotting process would also have to change. So for now the relevant modules from libdiagnostics are included using `#[path = ...] mod`.

10 years agoAdd scaffolding for assigning alpha-numeric codes to rustc diagnostics
Jakub Wieczorek [Tue, 1 Jul 2014 16:39:41 +0000 (18:39 +0200)]
Add scaffolding for assigning alpha-numeric codes to rustc diagnostics

10 years agoauto merge of #15353 : aturon/rust/env-hashmap, r=alexcrichton
bors [Thu, 10 Jul 2014 21:41:36 +0000 (21:41 +0000)]
auto merge of #15353 : aturon/rust/env-hashmap, r=alexcrichton

This commit adds `env_insert` and `env_remove` methods to the `Command`
builder, easing updates to the environment variables for the child
process. The existing method, `env`, is still available for overriding
the entire environment in one shot (after which the `env_insert` and
`env_remove` methods can be used to make further adjustments).

To support these new methods, the internal `env` representation for
`Command` has been changed to an optional `HashMap` holding owned
`CString`s (to support non-utf8 data). The `HashMap` is only
materialized if the environment is updated. The implementation does not
try hard to avoid allocation, since the cost of launching a process will
dwarf any allocation cost.

This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
`CString`.

10 years agoio::process::Command: add fine-grained env builder
Aaron Turon [Wed, 2 Jul 2014 20:50:45 +0000 (13:50 -0700)]
io::process::Command: add fine-grained env builder

This commit changes the `io::process::Command` API to provide
fine-grained control over the environment:

* The `env` method now inserts/updates a key/value pair.
* The `env_remove` method removes a key from the environment.
* The old `env` method, which sets the entire environment in one shot,
  is renamed to `env_set_all`. It can be used in conjunction with the
  finer-grained methods. This renaming is a breaking change.

To support these new methods, the internal `env` representation for
`Command` has been changed to an optional `HashMap` holding owned
`CString`s (to support non-utf8 data). The `HashMap` is only
materialized if the environment is updated. The implementation does not
try hard to avoid allocation, since the cost of launching a process will
dwarf any allocation cost.

This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
`CString`.

[breaking-change]

10 years agoauto merge of #15559 : fhahn/rust/issue-15445-mut-cast, r=alexcrichton
bors [Thu, 10 Jul 2014 19:06:59 +0000 (19:06 +0000)]
auto merge of #15559 : fhahn/rust/issue-15445-mut-cast, r=alexcrichton

I've added an error message for casts from raw pointers to floats #15445.

10 years agorustc: Exclude #[repr(C)] from non camel case
Alex Crichton [Thu, 10 Jul 2014 17:19:38 +0000 (10:19 -0700)]
rustc: Exclude #[repr(C)] from non camel case

C structs predominately do not use camel case identifiers, and we have a clear
indicator for what's a C struct now, so excuse all of them from this stylistic
lint.

10 years agorustc: Always mark #[crate_name] as used
Alex Crichton [Thu, 10 Jul 2014 17:19:10 +0000 (10:19 -0700)]
rustc: Always mark #[crate_name] as used

It's just an annoying error if you use --crate-name on the command line and you
also have a #[crate_name] specified

10 years agoMore robust install.sh: do runnability test in fresh subdirectory.
Felix S. Klock II [Thu, 10 Jul 2014 17:18:46 +0000 (19:18 +0200)]
More robust install.sh: do runnability test in fresh subdirectory.

Fix #15558.

10 years agoauto merge of #14519 : hirschenberger/rust/issue-10934, r=alexcrichton
bors [Thu, 10 Jul 2014 17:16:30 +0000 (17:16 +0000)]
auto merge of #14519 : hirschenberger/rust/issue-10934, r=alexcrichton

Issue #10934

10 years agoDocument event_loop_factory usage
Robert Clipsham [Thu, 10 Jul 2014 14:12:00 +0000 (15:12 +0100)]
Document event_loop_factory usage

Add a couple of lines mentioning event_loop_factory - no clear error message is
given if you attempt to perform I/O in tasks created in this fashion.

10 years agoauto merge of #15578 : alexcrichton/rust/fix-dist-again, r=pnkfelix
bors [Thu, 10 Jul 2014 15:34:02 +0000 (15:34 +0000)]
auto merge of #15578 : alexcrichton/rust/fix-dist-again, r=pnkfelix

This is already checked by the install script, no need to check it twice.

10 years agomk: Don't run rustc manually during distcheck
Alex Crichton [Thu, 10 Jul 2014 15:09:43 +0000 (08:09 -0700)]
mk: Don't run rustc manually during distcheck

This is already checked by the install script, no need to check it twice.

10 years agorustc: Forbid plugin_registrar in only rlib form
Alex Crichton [Thu, 10 Jul 2014 02:13:28 +0000 (19:13 -0700)]
rustc: Forbid plugin_registrar in only rlib form

If a plugin registrar is available, the library must be found in dylib form, not
just in rlib form.

Closes #15475

10 years agostd: Add some implementation of common traits
Alex Crichton [Thu, 10 Jul 2014 01:16:16 +0000 (18:16 -0700)]
std: Add some implementation of common traits

- semver::Version is now Eq, Ord, and Hash
- Path is now PartialOrd and Ord

10 years agoauto merge of #15569 : pcwalton/rust/reexport-intrinsics, r=cmr
bors [Thu, 10 Jul 2014 12:46:30 +0000 (12:46 +0000)]
auto merge of #15569 : pcwalton/rust/reexport-intrinsics, r=cmr

code bloat.

This didn't make a difference in any compile times that I saw, but it
fits what we're doing with `transmute` and seems prudent.

r? @alexcrichton

10 years agoRemove deprecated std::unstable module.
OGINO Masanori [Thu, 10 Jul 2014 10:45:00 +0000 (19:45 +0900)]
Remove deprecated std::unstable module.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #15563 : luqmana/rust/nif, r=pcwalton
bors [Thu, 10 Jul 2014 11:01:32 +0000 (11:01 +0000)]
auto merge of #15563 : luqmana/rust/nif, r=pcwalton

10 years agotypeck: check casts from pointers to floats, closes #15445
Florian Hahn [Wed, 9 Jul 2014 20:01:31 +0000 (22:01 +0200)]
typeck: check casts from pointers to floats, closes #15445

10 years agoMistake in AtomicBool spinlock example
Mathijs van de Nes [Thu, 10 Jul 2014 09:51:19 +0000 (11:51 +0200)]
Mistake in AtomicBool spinlock example

The current example of a spinlock was not correct. The lock is actually acquired
when old == result. So we only need to deschedule when this is not the case.