]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #15742 : pnkfelix/rust/fsk-fix-15019, r=pcwalton
bors [Fri, 18 Jul 2014 18:26:34 +0000 (18:26 +0000)]
auto merge of #15742 : pnkfelix/rust/fsk-fix-15019, r=pcwalton

Removed `index_to_bitset` field and `_frozen` methods.

Drive-by: Added some missing docs on the `each_bit` method.
Drive-by: Put in a regular pattern: when calling `compute_id_range`, ensure `words_per_id > 0` by either asserting it or checking and returning early. (The prior code did the latter in a few cases where necessary, but debugging is much aided by the asserts.)
Fix #15019.

9 years agoauto merge of #14539 : pcwalton/rust/unboxed-closures, r=pnkfelix
bors [Fri, 18 Jul 2014 16:46:33 +0000 (16:46 +0000)]
auto merge of #14539 : pcwalton/rust/unboxed-closures, r=pnkfelix

@nikomatsakis r?

9 years agolibrustc: Implement unboxed closures with mutable receivers
Patrick Walton [Thu, 29 May 2014 05:26:56 +0000 (22:26 -0700)]
librustc: Implement unboxed closures with mutable receivers

9 years agoauto merge of #15737 : huonw/rust/lint-level-here, r=pnkfelix
bors [Fri, 18 Jul 2014 13:31:22 +0000 (13:31 +0000)]
auto merge of #15737 : huonw/rust/lint-level-here, r=pnkfelix

This allows lint traversals to emit more information (when a lint is
non-allow), or avoid doing expensive computations (when a lint is
allow).

9 years agoauto merge of #15733 : sanxiyn/rust/use-from-type, r=alexcrichton
bors [Fri, 18 Jul 2014 11:51:20 +0000 (11:51 +0000)]
auto merge of #15733 : sanxiyn/rust/use-from-type, r=alexcrichton

Importing from types was disallowed in #6462. Flag was set for paths whether it is a module or a type. Type flag was set when impl was seen. The problem is, for cross-crate situations, when reexport is involved, it is possible that impl is seen too late because metadata is loaded lazily.

Fix #15664.

9 years agoRemoved the `_frozen` methods from dataflow API.
Felix S. Klock II [Thu, 17 Jul 2014 13:36:38 +0000 (15:36 +0200)]
Removed the `_frozen` methods from dataflow API.

Calls to methods like `each_bit_on_entry_frozen` and
`each_gen_bit_frozen` now go to the `each_bit_on_entry` and
`each_gen_bit` methods.

9 years agoRemoved `index_to_bitset` from the dataflow context.
Felix S. Klock II [Thu, 17 Jul 2014 12:28:03 +0000 (14:28 +0200)]
Removed `index_to_bitset` from the dataflow context.

Part of addressing 15019.

9 years agoauto merge of #15732 : bgamari/rust/to-tokens, r=alexcrichton
bors [Fri, 18 Jul 2014 09:31:22 +0000 (09:31 +0000)]
auto merge of #15732 : bgamari/rust/to-tokens, r=alexcrichton

Here I add a `ToTokens` impl for `Attribute_` and `Option<T>`, as well as generalize the impl for `Vec<T>`

9 years agoauto merge of #15727 : fhahn/rust/remove-some-unwraps, r=alexcrichton
bors [Fri, 18 Jul 2014 07:51:22 +0000 (07:51 +0000)]
auto merge of #15727 : fhahn/rust/remove-some-unwraps, r=alexcrichton

When looking through the `btree` code, I stumbled over a couple of `unwraps` that could be avoided.

9 years agoauto merge of #15726 : aturon/rust/macro-stability, r=alexcrichton
bors [Fri, 18 Jul 2014 06:11:24 +0000 (06:11 +0000)]
auto merge of #15726 : aturon/rust/macro-stability, r=alexcrichton

This small patch causes the stability lint to bail out when traversing
any AST produced via a macro expansion. Ultimately, we would like to
lint the contents of the macro at the place where the macro is defined,
but regardless we should not be linting it at the use site.

Closes #15703

9 years agoauto merge of #15725 : aochagavia/rust/vec, r=alexcrichton
bors [Fri, 18 Jul 2014 03:46:23 +0000 (03:46 +0000)]
auto merge of #15725 : aochagavia/rust/vec, r=alexcrichton

* Deprecated `to_owned` in favor of `to_vec`
* Deprecated `into_owned` in favor of `into_vec`

[breaking-change]

9 years agoauto merge of #15593 : steveklabnik/rust/string_guide, r=kballard
bors [Fri, 18 Jul 2014 01:46:24 +0000 (01:46 +0000)]
auto merge of #15593 : steveklabnik/rust/string_guide, r=kballard

I decided to change it up a little today and hack out the beginning of the String guide. Strings are different enough in Rust that I think they deserve a specific guide, especially for those who are used to managed languages.

I decided to start with Strings because they get asked about a lot in IRC, and also based on discussions like this one on reddit: http://www.reddit.com/r/rust/comments/2ac390/generic_string_literals/

I blatantly stole bits from our other documentation on Strings. It's a little sparse at current, but I wanted to start somewhere.

I am not exactly sure what should go in "Best Practices," and would like the feedback from the team on this. Specifically due to comments like this one: http://www.reddit.com/r/rust/comments/2ac390/generic_string_literals/citmxb5

9 years agoGuide: strings
Steve Klabnik [Thu, 17 Jul 2014 23:24:12 +0000 (19:24 -0400)]
Guide: strings

9 years agoauto merge of #15719 : michaelwoerister/rust/global_var_null_span_fix, r=alexcrichton
bors [Fri, 18 Jul 2014 00:01:22 +0000 (00:01 +0000)]
auto merge of #15719 : michaelwoerister/rust/global_var_null_span_fix, r=alexcrichton

This should fix issue #15541. It would be good to have an test case for this would also be nice but I haven't had the time to write one. The change is very small though and it doesn't break anything in the existing test suite, so I guess we can add it without test for now.

9 years agoauto merge of #15515 : pcwalton/rust/cross-borrowing, r=alexcrichton
bors [Thu, 17 Jul 2014 22:16:23 +0000 (22:16 +0000)]
auto merge of #15515 : pcwalton/rust/cross-borrowing, r=alexcrichton

except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]

r? @alexcrichton

9 years agolibrustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,
Patrick Walton [Mon, 7 Jul 2014 23:35:15 +0000 (16:35 -0700)]
librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,
except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]

9 years agoauto merge of #15718 : treeman/rust/integer-doc, r=alexcrichton
bors [Thu, 17 Jul 2014 20:36:19 +0000 (20:36 +0000)]
auto merge of #15718 : treeman/rust/integer-doc, r=alexcrichton

Simple usage examples for Integer methods. Also group `div_rem` and `div_mod_floor` together at the bottom of the trait, to reflect the documentation rendering.

9 years agoauto merge of #15716 : treeman/rust/bigint-doc, r=alexcrichton
bors [Thu, 17 Jul 2014 18:56:22 +0000 (18:56 +0000)]
auto merge of #15716 : treeman/rust/bigint-doc, r=alexcrichton

Also use `///` for documentation instead of `/**`. End comments with `.`.

9 years agoauto merge of #15706 : phi-gamma/rust/master, r=huonw
bors [Thu, 17 Jul 2014 17:16:23 +0000 (17:16 +0000)]
auto merge of #15706 : phi-gamma/rust/master, r=huonw

I kept changes to each file in a separate commit. Please let me know if you prefer them
squashed!

9 years agoauto merge of #15705 : klutzy/rust/cross-ld-library, r=alexcrichton
bors [Thu, 17 Jul 2014 15:36:23 +0000 (15:36 +0000)]
auto merge of #15705 : klutzy/rust/cross-ld-library, r=alexcrichton

9 years agoRename functions in the CloneableVector trait
Adolfo Ochagavía [Wed, 16 Jul 2014 20:37:28 +0000 (22:37 +0200)]
Rename functions in the CloneableVector trait

* Deprecated `to_owned` in favor of `to_vec`
* Deprecated `into_owned` in favor of `into_vec`

[breaking-change]

9 years agoauto merge of #15675 : errordeveloper/rust/json_docs, r=steveklabnik
bors [Thu, 17 Jul 2014 13:56:19 +0000 (13:56 +0000)]
auto merge of #15675 : errordeveloper/rust/json_docs, r=steveklabnik

- add one simple example of using `ToJson` trait
- make example code more readable

9 years agosyntax: Add ToTokens impl for Method
Ben Gamari [Thu, 17 Jul 2014 12:54:43 +0000 (08:54 -0400)]
syntax: Add ToTokens impl for Method

9 years agoauto merge of #15698 : Zoxc/rust/code-model, r=alexcrichton
bors [Thu, 17 Jul 2014 12:11:19 +0000 (12:11 +0000)]
auto merge of #15698 : Zoxc/rust/code-model, r=alexcrichton

The default code model is usually unsuitable for kernels,
so we add an option to specify which model we want.

Testing for this would be fragile and very architecture specific and is better left to LLVM.

9 years agolint: add method to get level of a specific lint.
Huon Wilson [Thu, 17 Jul 2014 10:07:43 +0000 (20:07 +1000)]
lint: add method to get level of a specific lint.

This allows lint traversals to emit more information (when a lint is
non-allow), or avoid doing expensive computations (when a lint is
allow).

9 years agoauto merge of #15668 : steveklabnik/rust/tree_set_example, r=alexcrichton
bors [Thu, 17 Jul 2014 08:01:21 +0000 (08:01 +0000)]
auto merge of #15668 : steveklabnik/rust/tree_set_example, r=alexcrichton

Someone asked for an example usage of this on IRC, so I tossed together the simplest one. Obviously, this isn't up to snuff, but it's better than nothing.

9 years agoauto merge of #14022 : pcwalton/rust/explicit-self, r=pnkfelix
bors [Thu, 17 Jul 2014 06:21:21 +0000 (06:21 +0000)]
auto merge of #14022 : pcwalton/rust/explicit-self, r=pnkfelix

r? @nikomatsakis

9 years agolibrustc: Allow the new UFCS explicit self in trait definitions, and
Patrick Walton [Tue, 8 Jul 2014 06:19:35 +0000 (23:19 -0700)]
librustc: Allow the new UFCS explicit self in trait definitions, and
remove `~self` from the test suite.

10 years agosyntax: Add quote_method!
Ben Gamari [Thu, 17 Jul 2014 05:02:27 +0000 (01:02 -0400)]
syntax: Add quote_method!

10 years agoDisallow importing from types when reexport is involved
Seo Sanghyeon [Thu, 17 Jul 2014 04:50:54 +0000 (13:50 +0900)]
Disallow importing from types when reexport is involved

10 years agolibsyntax: Remove `Send` from `PtrTy` in `deriving`.
Patrick Walton [Tue, 8 Jul 2014 04:52:28 +0000 (21:52 -0700)]
libsyntax: Remove `Send` from `PtrTy` in `deriving`.

It'll be complex to port to the new explicit-self regime and it seems to
be unused.

10 years agolibrustc: Implement the fully-expanded, UFCS form of explicit self.
Patrick Walton [Tue, 6 May 2014 23:37:32 +0000 (16:37 -0700)]
librustc: Implement the fully-expanded, UFCS form of explicit self.

This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.

This relates to #13885. This does not remove `~self` from the language
yet, however.

[breaking-change]

10 years agosyntax: Generalize ToTokens impl for Vec<T>
Ben Gamari [Thu, 17 Jul 2014 02:24:42 +0000 (22:24 -0400)]
syntax: Generalize ToTokens impl for Vec<T>

It will now `flat_map` over the elements of a `Vec<T>` if
`T: ToTokens`

10 years agosyntax: Add ToTokens for Attribute_
Ben Gamari [Thu, 17 Jul 2014 02:17:16 +0000 (22:17 -0400)]
syntax: Add ToTokens for Attribute_

10 years agosyntax: Add ToTokens for Option<T>
Ben Gamari [Thu, 17 Jul 2014 02:16:55 +0000 (22:16 -0400)]
syntax: Add ToTokens for Option<T>

10 years agoauto merge of #15652 : nick29581/rust/vec_index, r=acrichto
bors [Thu, 17 Jul 2014 01:16:19 +0000 (01:16 +0000)]
auto merge of #15652 : nick29581/rust/vec_index, r=acrichto

10 years agodeprecate Vec::get
Nick Cameron [Mon, 14 Jul 2014 23:37:25 +0000 (11:37 +1200)]
deprecate Vec::get

10 years agoAdd TreeSet example.
Steve Klabnik [Wed, 16 Jul 2014 22:11:40 +0000 (18:11 -0400)]
Add TreeSet example.

10 years agoauto merge of #15696 : Zoxc/rust/redzone, r=alexcrichton
bors [Wed, 16 Jul 2014 21:46:21 +0000 (21:46 +0000)]
auto merge of #15696 : Zoxc/rust/redzone, r=alexcrichton

Disabling the redzone is required in x86-64's kernel mode to avoid interrupts trashing the stack.

I'm not sure if decl_fn is the right place to tag all functions with noredzone. It might have interactions with external functions when linking with bitcode built without -C no-redzone although I see no reason to do that.

I'm not sure how to write a test inspecting the bitcode output for noredzone attributes on all functions either.

10 years agobtree: use pattern matching instead of unwrap
Florian Hahn [Wed, 16 Jul 2014 21:22:14 +0000 (23:22 +0200)]
btree: use pattern matching instead of unwrap

10 years agoImplement Index and IndexMut for Vec
Nick Cameron [Sun, 13 Jul 2014 23:03:23 +0000 (11:03 +1200)]
Implement Index and IndexMut for Vec

10 years agostability lint: ignore code from macro expansion
Aaron Turon [Wed, 16 Jul 2014 20:50:33 +0000 (13:50 -0700)]
stability lint: ignore code from macro expansion

This small patch causes the stability lint to bail out when traversing
any AST produced via a macro expansion. Ultimately, we would like to
lint the contents of the macro at the place where the macro is defined,
but regardless we should not be linting it at the use site.

Closes #15703

10 years agoauto merge of #15667 : treeman/rust/set-doc, r=alexcrichton
bors [Wed, 16 Jul 2014 18:56:18 +0000 (18:56 +0000)]
auto merge of #15667 : treeman/rust/set-doc, r=alexcrichton

Example code for HashSet, similar to the [HashMap example](http://doc.rust-lang.org/std/collections/hashmap/struct.HashMap.html).

10 years agoImprove docs on JSON.
Ilya Dmitrichenko [Mon, 14 Jul 2014 21:41:16 +0000 (22:41 +0100)]
Improve docs on JSON.

- add one simple example of using `ToJson` trait
- make example code more readable

10 years agoauto merge of #15573 : michaelwoerister/rust/lldb-tests-rebased-09-Jul, r=alexcrichton
bors [Wed, 16 Jul 2014 17:16:20 +0000 (17:16 +0000)]
auto merge of #15573 : michaelwoerister/rust/lldb-tests-rebased-09-Jul, r=alexcrichton

This PR adds the LLDB autotests to the debuginfo test suite so I don't have to keep rebasing them locally. They are still disabled by default in `tests.mk`. One of the commits also contains a Python pretty printer which can make LLDB print values with Rust syntax. This was mainly added to deal with output format differences between LLDB versions but you can also use it for your normal LLDB debugging sessions.
```
// The following LLDB commands will load and activate the Rust printers
command script import ./src/etc/lldb_rust_formatters.py
type summary add --no-value --python-function lldb_rust_formatters.print_val -x .* --category Rust
type category enable Rust
```
Expect some rough edges with these, they have not been tested apart from there use in the autotests...

10 years agoauto merge of #15476 : kballard/rust/more_vim_tweaks, r=chris
bors [Wed, 16 Jul 2014 15:36:21 +0000 (15:36 +0000)]
auto merge of #15476 : kballard/rust/more_vim_tweaks, r=chris

Tweak the text editing settings (softtabstop, textwidth, etc).

Add some settings to turn on folding and colorcolumn.

Add the undo_ftplugin changes that my previous patch forgot.

10 years agoExtend HashSet documentation.
Jonas Hietala [Mon, 14 Jul 2014 17:29:29 +0000 (19:29 +0200)]
Extend HashSet documentation.

Add main example and simple examples for the methods.

10 years agoMain example for bigint usage.
Jonas Hietala [Wed, 16 Jul 2014 13:51:51 +0000 (15:51 +0200)]
Main example for bigint usage.

Also use `///` for documentation instead of `/**`. End comments with
`.`.

Show imports for bigint example.

They might be useful.

10 years agoExamples for Integer trait methods.
Jonas Hietala [Wed, 16 Jul 2014 14:17:41 +0000 (16:17 +0200)]
Examples for Integer trait methods.

10 years agoauto merge of #15693 : steveklabnik/rust/guide_fix_cargo, r=cmr
bors [Wed, 16 Jul 2014 12:06:15 +0000 (12:06 +0000)]
auto merge of #15693 : steveklabnik/rust/guide_fix_cargo, r=cmr

Cargo now comes with Rust!

10 years agoAdd an option to disable the use of the redzone
John Kåre Alsaker [Wed, 16 Jul 2014 11:35:50 +0000 (13:35 +0200)]
Add an option to disable the use of the redzone

Disabling the redzone is required in x86-64's kernel mode to avoid interrupts trashing the stack.

10 years agoauto merge of #15691 : jbclements/rust/method-field-cleanup, r=alexcrichton
bors [Wed, 16 Jul 2014 10:26:16 +0000 (10:26 +0000)]
auto merge of #15691 : jbclements/rust/method-field-cleanup, r=alexcrichton

This patch applies the excellent suggestion of @pnkfelix to group the helper methods for method field access into a Trait, making the code much more readable, and much more similar to the way it was before.

10 years agodebuginfo: Don't crash when encountering global variable with unknown source span.
Michael Woerister [Thu, 10 Jul 2014 13:38:57 +0000 (15:38 +0200)]
debuginfo: Don't crash when encountering global variable with unknown source span.

10 years agodebuginfo: Make sure that only one LLDB test task is run at a time.
Michael Woerister [Wed, 9 Jul 2014 14:22:39 +0000 (16:22 +0200)]
debuginfo: Make sure that only one LLDB test task is run at a time.

Some older versions of LLDB have problems with multiple instances running in parallel. This commit makes sure we don't do that.

10 years agodebuginfo: Add LLDB autotests to debuginfo test suite.
Michael Woerister [Wed, 9 Jul 2014 12:46:09 +0000 (14:46 +0200)]
debuginfo: Add LLDB autotests to debuginfo test suite.

This commit adds LLDB autotests to the test suite but does not activate them by default yet.

10 years agodebuginfo: Remove atexit()-debugger shutdown from lldb_batchmode.py
Michael Woerister [Wed, 9 Jul 2014 12:16:50 +0000 (14:16 +0200)]
debuginfo: Remove atexit()-debugger shutdown from lldb_batchmode.py

The shutdown call would always result in an exception being printed to standard error.

10 years agodebuginfo: Inject 'Rust-mode' LLDB prelude into debuginfo test scripts.
Michael Woerister [Wed, 9 Jul 2014 09:33:48 +0000 (11:33 +0200)]
debuginfo: Inject 'Rust-mode' LLDB prelude into debuginfo test scripts.

10 years agodebuginfo: Add python formatters that allow LLDB to print values with Rust syntax
Michael Woerister [Wed, 9 Jul 2014 08:18:40 +0000 (10:18 +0200)]
debuginfo: Add python formatters that allow LLDB to print values with Rust syntax

10 years agocomplement-lang-faq.md: fix typos
Philipp Gesang [Tue, 15 Jul 2014 21:59:13 +0000 (23:59 +0200)]
complement-lang-faq.md: fix typos

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 #15656 : nick29581/rust/index-bck, r=pnkfelix
bors [Wed, 16 Jul 2014 04:31:12 +0000 (04:31 +0000)]
auto merge of #15656 : nick29581/rust/index-bck, r=pnkfelix

Closes #15525

The important bit of this are the changes from line 445 in mem_categorization.rs. Most of the other changes are about adding an Implicit PointerKind, and this is only necessary for getting a decent error message :-s An alternative would have been to add an implciti/explicit flag to cat_deref, which could be mostly ignored and so would mean much fewer changes. However, the implicit state would only be valid if the PointerKind was BorrowedPtr, so it felt like it ought to be another kind of PointerKind. I still don't know which is the better design.

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 agomk: Fix LD_LIBRARY_PATH_ENV_NAMES in cross build
klutzy [Mon, 14 Jul 2014 08:45:06 +0000 (17:45 +0900)]
mk: Fix LD_LIBRARY_PATH_ENV_NAMES in cross build

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 agoSupport for specifying the code model
John Kåre Alsaker [Tue, 15 Jul 2014 23:14:02 +0000 (23:14 +0000)]
Support for specifying the code model

The default code model is usually unsuitable for kernels,
so we add an option to specify which model we want.

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 agochange to new trait style for method field refs
John Clements [Mon, 14 Jul 2014 23:31:52 +0000 (16:31 -0700)]
change to new trait style for method field refs

Per @pnkfelix 's suggestion, using a trait to make these
field accesses more readable (and vastly more similar
to the original code.

oops fix new ast_map fix

10 years agouse trait rather than fns
John Clements [Mon, 14 Jul 2014 23:27:54 +0000 (16:27 -0700)]
use trait rather than fns

please note the snapshot-waiting unpleasantness. I'm
unable to use the traditional #[cfg(stage0)] mechanism
to swap the new style in for later compiler stages,
because macros invocations in method positions cause
the parser to choke before cfg can strip it out.

Parenthetical note: this problem wouldn't arise with
an interleaved parsing/expansion....

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 agoFix cargo install instructions
Steve Klabnik [Tue, 15 Jul 2014 20:26:22 +0000 (16:26 -0400)]
Fix cargo install instructions

Cargo now comes with Rust

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.