]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #20611: simnalamburt/master
Alex Crichton [Thu, 8 Jan 2015 01:17:18 +0000 (17:17 -0800)]
rollup merge of #20611: simnalamburt/master

This PR fixes the issue #20460, and it doesn't touch any existing behavior except the bug of the SIMD types.

Closes #20460.

9 years agorollup merge of #20237: RustOS-Fork-Holding-Ground/master
Alex Crichton [Thu, 8 Jan 2015 01:17:15 +0000 (17:17 -0800)]
rollup merge of #20237: RustOS-Fork-Holding-Ground/master

libc is only used when the heap allocations are not defined externally, or defined in another crate. I assume these extern* configurations were added for the sake of those of us experimenting with freestanding Rust. Avoiding libc where possible is often very important for us.

9 years agoFix warning in liballoc about unused constant MIN_ALIGN when cfg(feature = external_*)
John Ericson [Tue, 30 Dec 2014 05:13:08 +0000 (06:13 +0100)]
Fix warning in liballoc about unused constant MIN_ALIGN when cfg(feature = external_*)

9 years agoliballoc's "extern_funcs" impl mod had a duplicate and missing item
John Ericson [Fri, 26 Dec 2014 23:34:51 +0000 (00:34 +0100)]
liballoc's "extern_funcs" impl mod had a duplicate and missing item

9 years agoShorten cfg line lengths in liballoc
John Ericson [Fri, 26 Dec 2014 23:09:04 +0000 (00:09 +0100)]
Shorten cfg line lengths in liballoc

9 years agoliballoc's "external_funcs" and "external_crate" are now features
John Ericson [Fri, 26 Dec 2014 22:28:04 +0000 (23:28 +0100)]
liballoc's "external_funcs" and "external_crate" are now features

This allows the vanilla libary to built for kernel use with Cargo.

9 years agoliballoc does not need liblibc under certain configurations
John Ericson [Fri, 26 Dec 2014 00:38:07 +0000 (01:38 +0100)]
liballoc does not need liblibc under certain configurations

9 years agoauto merge of #20655 : nikomatsakis/rust/carl-ice, r=aturon
bors [Wed, 7 Jan 2015 17:45:11 +0000 (17:45 +0000)]
auto merge of #20655 : nikomatsakis/rust/carl-ice, r=aturon

Remember to check the name of the associated type being projected when searching the environment. Fixes #20651.

9 years agoRemember to check the name of the associated type being projected when searching...
Niko Matsakis [Tue, 6 Jan 2015 18:41:14 +0000 (13:41 -0500)]
Remember to check the name of the associated type being projected when searching the environment. Fixes #20651.

9 years agoMerge pull request #20689 from huonw/editor-_size
bors [Wed, 7 Jan 2015 15:35:34 +0000 (15:35 +0000)]
Merge pull request #20689 from huonw/editor-_size

Update editor syntax files for isize/usize.

Reviewed-by: nikomatsakis
9 years agoMerge pull request #20682 from sfackler/fix-impls
bors [Wed, 7 Jan 2015 15:35:33 +0000 (15:35 +0000)]
Merge pull request #20682 from sfackler/fix-impls

Fix JS error

Reviewed-by: alexcrichton
9 years agoMerge pull request #20679 from geekcraik/master
bors [Wed, 7 Jan 2015 15:35:31 +0000 (15:35 +0000)]
Merge pull request #20679 from geekcraik/master

unused variable 'i'

Reviewed-by: sfackler
9 years agoMerge pull request #20675 from jbcrail/fix-test-comments
bors [Wed, 7 Jan 2015 15:35:30 +0000 (15:35 +0000)]
Merge pull request #20675 from jbcrail/fix-test-comments

Fix misspelled comments in tests.

Reviewed-by: steveklabnik
9 years agoMerge pull request #20674 from jbcrail/fix-misspelled-comments
bors [Wed, 7 Jan 2015 15:35:30 +0000 (15:35 +0000)]
Merge pull request #20674 from jbcrail/fix-misspelled-comments

Fix misspelled comments.

Reviewed-by: steveklabnik
9 years agoMerge pull request #20672 from vrana/patch-3
bors [Wed, 7 Jan 2015 15:35:28 +0000 (15:35 +0000)]
Merge pull request #20672 from vrana/patch-3

Fix a typo in guide

Reviewed-by: steveklabnik
9 years agoMerge pull request #20670 from vrana/patch-2
bors [Wed, 7 Jan 2015 15:35:27 +0000 (15:35 +0000)]
Merge pull request #20670 from vrana/patch-2

Fix type annotation in guide

Reviewed-by: steveklabnik
9 years agoMerge pull request #20669 from vrana/patch-1
bors [Wed, 7 Jan 2015 15:35:26 +0000 (15:35 +0000)]
Merge pull request #20669 from vrana/patch-1

Use a better word in the guide

Reviewed-by: steveklabnik
9 years agoauto merge of #20606 : alexcrichton/rust/stabilize-libc, r=brson
bors [Wed, 7 Jan 2015 12:25:15 +0000 (12:25 +0000)]
auto merge of #20606 : alexcrichton/rust/stabilize-libc, r=brson

This commit prepares the liblibc library to be moved to crates.io. Unlike the
log, serialize, term, etc crates, the source for this crate will *not* be
duplicated out-of-tree. Instead a new rust-lang/libc repository will be created
with a submodule to this repository and it will use the source directly.

In order to compile within the stable ecosystem of Rust, this crate cannot link
to libcore, and it also needs some tweaks for the other attributes that it has.
As a result this commit tweaks the source of the crate to link to libcore when
built in tree but link to libstd when built via cargo.

Note that the rust-lang/libc crate isn't quite prepared just yet, there's a
Cargo bug or two that I'd like to iron out before publishing it. This is simply
preparing the in-tree source.

9 years agoUpdate editor syntax files for isize/usize.
Huon Wilson [Wed, 7 Jan 2015 09:19:58 +0000 (20:19 +1100)]
Update editor syntax files for isize/usize.

Yay, syntax highlighting.

9 years agolibc: Prepare for movement to crates.io
Alex Crichton [Tue, 6 Jan 2015 02:01:03 +0000 (18:01 -0800)]
libc: Prepare for movement to crates.io

This commit prepares the liblibc library to be moved to crates.io. Unlike the
log, serialize, term, etc crates, the source for this crate will *not* be
duplicated out-of-tree. Instead a new rust-lang/libc repository will be created
with a submodule to this repository and it will use the source directly.

In order to compile within the stable ecosystem of Rust, this crate cannot link
to libcore, and it also needs some tweaks for the other attributes that it has.
As a result this commit tweaks the source of the crate to link to libcore when
built in tree but link to libstd when built via cargo.

Note that the rust-lang/libc crate isn't quite prepared just yet, there's a
Cargo bug or two that I'd like to iron out before publishing it. This is simply
preparing the in-tree source.

9 years agoauto merge of #20620 : brson/rust/relnotes, r=huonw
bors [Wed, 7 Jan 2015 08:32:46 +0000 (08:32 +0000)]
auto merge of #20620 : brson/rust/relnotes, r=huonw

A whole lot happened this cycle. I tried to highlight the best stuff. Please review and note important stuff I'm missing or foolish mistakes.

9 years agoSync -> Send
Brian Anderson [Wed, 7 Jan 2015 06:16:34 +0000 (22:16 -0800)]
Sync -> Send

9 years agoMerge pull request #25 from aturon/relnotes-updates
Brian Anderson [Wed, 7 Jan 2015 06:15:10 +0000 (22:15 -0800)]
Merge pull request #25 from aturon/relnotes-updates

Add int discussion, tweak wording

9 years agoauto merge of #20677 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 7 Jan 2015 05:31:23 +0000 (05:31 +0000)]
auto merge of #20677 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoMore test fixes
Alex Crichton [Wed, 7 Jan 2015 00:16:35 +0000 (16:16 -0800)]
More test fixes

9 years agoAdd int discussion, tweak wording
Aaron Turon [Wed, 7 Jan 2015 04:53:55 +0000 (20:53 -0800)]
Add int discussion, tweak wording

9 years agoFix JS error
Steven Fackler [Wed, 7 Jan 2015 04:48:06 +0000 (20:48 -0800)]
Fix JS error

ECMAScript 6 isn't really supported anywhere

Closes #20681

9 years agoLet `size_of` always be multiple of `min_align_of`
Hyeon Kim [Mon, 5 Jan 2015 03:59:47 +0000 (12:59 +0900)]
Let `size_of` always be multiple of `min_align_of`

This change fixes the issue #20460

9 years agoCorrect the comment of the function `llsize_of_real`
Hyeon Kim [Tue, 6 Jan 2015 02:18:32 +0000 (11:18 +0900)]
Correct the comment of the function `llsize_of_real`

Consult the issue #20460

9 years agoUpdate arc.rs
克雷 [Wed, 7 Jan 2015 03:16:41 +0000 (11:16 +0800)]
Update arc.rs

9 years agoUse a better reference for unboxed closures
Brian Anderson [Wed, 7 Jan 2015 02:18:56 +0000 (18:18 -0800)]
Use a better reference for unboxed closures

9 years agoFix misspelled comments in tests.
Joseph Crail [Wed, 7 Jan 2015 01:54:54 +0000 (20:54 -0500)]
Fix misspelled comments in tests.

I separated these changes out from the other commit to minimize issues
with tests.

9 years agoFix misspelled comments.
Joseph Crail [Wed, 7 Jan 2015 01:53:18 +0000 (20:53 -0500)]
Fix misspelled comments.

I cleaned up comments prior to the 1.0 alpha release.

9 years agoFix a typo in guide
Jakub Vrána [Wed, 7 Jan 2015 00:53:45 +0000 (16:53 -0800)]
Fix a typo in guide

9 years agoSoften pre-1.0 API stability commitment in relnotes
Brian Anderson [Wed, 7 Jan 2015 00:50:54 +0000 (16:50 -0800)]
Soften pre-1.0 API stability commitment in relnotes

9 years agoLittle more relnotes
Brian Anderson [Wed, 7 Jan 2015 00:44:17 +0000 (16:44 -0800)]
Little more relnotes

9 years agoAdd new authors, more relnotes
Brian Anderson [Wed, 7 Jan 2015 00:37:38 +0000 (16:37 -0800)]
Add new authors, more relnotes

9 years agoRevert "Remove the unneeded Sized bound on TypeId creation"
Alex Crichton [Wed, 7 Jan 2015 00:11:23 +0000 (16:11 -0800)]
Revert "Remove the unneeded Sized bound on TypeId creation"

This reverts commit 240423236906a2df976edd6065bbc595711b83c0.

Conflicts:
src/libcore/intrinsics.rs

9 years agoTest fixes and rebase conflicts
Alex Crichton [Tue, 6 Jan 2015 23:57:50 +0000 (15:57 -0800)]
Test fixes and rebase conflicts

9 years agoAddress feedback
Brian Anderson [Tue, 6 Jan 2015 12:19:01 +0000 (04:19 -0800)]
Address feedback

9 years ago1.0.0-alpha release notes
Brian Anderson [Tue, 6 Jan 2015 07:41:12 +0000 (23:41 -0800)]
1.0.0-alpha release notes

9 years agoBump some version numbers
Brian Anderson [Tue, 6 Jan 2015 07:44:54 +0000 (23:44 -0800)]
Bump some version numbers

9 years agorollup merge of #20563: cmr/macro-input-future-proofing
Alex Crichton [Tue, 6 Jan 2015 23:49:15 +0000 (15:49 -0800)]
rollup merge of #20563: cmr/macro-input-future-proofing

9 years agoserialize macro fix
Corey Richardson [Tue, 6 Jan 2015 23:47:49 +0000 (18:47 -0500)]
serialize macro fix

9 years agoMinor fallout/update FOLLOW sets
Corey Richardson [Tue, 6 Jan 2015 23:46:37 +0000 (18:46 -0500)]
Minor fallout/update FOLLOW sets

9 years agorollup merge of #20656: japaric/at-clean
Alex Crichton [Tue, 6 Jan 2015 23:41:13 +0000 (15:41 -0800)]
rollup merge of #20656: japaric/at-clean

9 years agorollup merge of #20662: reem/unsized-typeid
Alex Crichton [Tue, 6 Jan 2015 23:39:09 +0000 (15:39 -0800)]
rollup merge of #20662: reem/unsized-typeid

This bound is probably unintentional and is unnecessarily
constricting.

9 years agorollup merge of #20650: klutzy/omg-windows-error-mode
Alex Crichton [Tue, 6 Jan 2015 23:38:56 +0000 (15:38 -0800)]
rollup merge of #20650: klutzy/omg-windows-error-mode

Believe or not, `CreateProcess()` is racy if several threads create
child processes: [0], [1], [2].

This caused some tests show crash dialogs during
`make check-stage#-rpass`.

More explanation:

On Windows, `SetErrorMode()` controls display of error dialogs: it
accepts new error mode and returns old error mode.
The error mode is process-global and automatically inherited to child
process when created.

MSYS2 bash shell internally sets it to not show error dialogs, therefore
`make check-stage#-rpass` should not show them either.

However, [1] says that `CreateProcess()` internally invokes
`SetErrorMode()` twice: at first it sets mode `0x8001` and saves
original mode, and at second it restores original mode.
So if two threads simultaneously call `CreateProcess()`, the first
thread sets error mode to `0x8001` then the second thread recognizes
that current error mode is `0x8001`. Therefore, The second thread will
create process with wrong error mode.

This really occurs inside `compiletest`: it creates several processes on
each thread, so some `run-pass` tests are invoked with wrong error mode
therefore show crash dialog.

This commit adds `StaticMutex` for `CreateProcess()` call. This seems
to fix the "dialog annoyance" issue.

[0]: http://support.microsoft.com/kb/315939
[1]: https://code.google.com/p/nativeclient/issues/detail?id=2968
[2]: https://ghc.haskell.org/trac/ghc/ticket/2650

9 years agorollup merge of #20615: aturon/stab-2-thread
Alex Crichton [Tue, 6 Jan 2015 23:38:38 +0000 (15:38 -0800)]
rollup merge of #20615: aturon/stab-2-thread

This commit takes a first pass at stabilizing `std::thread`:

* It removes the `detach` method in favor of two constructors -- `spawn`
  for detached threads, `scoped` for "scoped" (i.e., must-join)
  threads. This addresses some of the surprise/frustrating debug
  sessions with the previous API, in which `spawn` produced a guard that
  on destruction joined the thread (unless `detach` was called).

  The reason to have the division in part is that `Send` will soon not
  imply `'static`, which means that `scoped` thread creation can take a
  closure over *shared stack data* of the parent thread. On the other
  hand, this means that the parent must not pop the relevant stack
  frames while the child thread is running. The `JoinGuard` is used to
  prevent this from happening by joining on drop (if you have not
  already explicitly `join`ed.) The APIs around `scoped` are
  future-proofed for the `Send` changes by taking an additional lifetime
  parameter. With the current definition of `Send`, this is forced to be
  `'static`, but when `Send` changes these APIs will gain their full
  flexibility immediately.

  Threads that are `spawn`ed, on the other hand, are detached from the
  start and do not yield an RAII guard.

  The hope is that, by making `scoped` an explicit opt-in with a very
  suggestive name, it will be drastically less likely to be caught by a
  surprising deadlock due to an implicit join at the end of a scope.

* The module itself is marked stable.

* Existing methods other than `spawn` and `scoped` are marked stable.

The migration path is:

```rust
Thread::spawn(f).detached()
```

becomes

```rust
Thread::spawn(f)
```

while

```rust
let res = Thread::spawn(f);
res.join()
```

becomes

```rust
let res = Thread::scoped(f);
res.join()
```

[breaking-change]

9 years agorollup merge of #19430: pczarn/interp_tt-cleanup
Alex Crichton [Tue, 6 Jan 2015 23:38:10 +0000 (15:38 -0800)]
rollup merge of #19430: pczarn/interp_tt-cleanup

Conflicts:
src/libsyntax/parse/parser.rs

9 years agorollup merge of #20607: nrc/kinds
Alex Crichton [Tue, 6 Jan 2015 23:34:10 +0000 (15:34 -0800)]
rollup merge of #20607: nrc/kinds

Conflicts:
src/libcore/array.rs
src/libcore/cell.rs
src/libcore/prelude.rs
src/libstd/path/posix.rs
src/libstd/prelude/v1.rs
src/test/compile-fail/dst-sized-trait-param.rs

9 years agorollup merge of #20593: nikomatsakis/unused-tps-in-impl
Alex Crichton [Tue, 6 Jan 2015 23:31:39 +0000 (15:31 -0800)]
rollup merge of #20593: nikomatsakis/unused-tps-in-impl

Conflicts:
src/libcollections/lib.rs
src/librustc/lib.rs
src/libserialize/lib.rs
src/libstd/lib.rs

9 years agoFix type annotation in guide
Jakub Vrána [Tue, 6 Jan 2015 23:30:22 +0000 (15:30 -0800)]
Fix type annotation in guide

9 years agorollup merge of #20653: alexcrichton/entry-unstable
Alex Crichton [Tue, 6 Jan 2015 23:29:18 +0000 (15:29 -0800)]
rollup merge of #20653: alexcrichton/entry-unstable

There's been some debate over the precise form that these APIs should take, and
they've undergone some changes recently, so these APIs are going to be left
unstable for now to be fleshed out during the next release cycle.

9 years agorollup merge of #20652: vhbit/thread-key-type
Alex Crichton [Tue, 6 Jan 2015 23:29:17 +0000 (15:29 -0800)]
rollup merge of #20652: vhbit/thread-key-type

This is a manual merge of #20627 and #20634 to avoid conflicts in rollup and also avoid one roundtrip. I've leave copyright to original author.  If this one is moved to rollup original PR could be closed. cc @mneumann

@alexcrichton r?

Both FreeBSD and DragonFly define pthread_key_t as int, while Linux
defines it as uint. As pthread_key_t is used as an opaque type and
storage size of both int and uint are the same, this is rather a
cosmetic change.

iOS uses ulong (as OS X) so difference is critical on 64bit platforms.

9 years agorollup merge of #20647: aturon/stab-2-error
Alex Crichton [Tue, 6 Jan 2015 23:29:15 +0000 (15:29 -0800)]
rollup merge of #20647: aturon/stab-2-error

This commit is a first past stabilization of `std::error`:

* The module is stable.
* The `FromError` trait and impls are stable
* The `Error` trait itself is left unstable, pending current APIs and
  possible revisions during the alpha cycle.

9 years agorollup merge of #20645: nikomatsakis/rustbook-ice
Alex Crichton [Tue, 6 Jan 2015 23:29:09 +0000 (15:29 -0800)]
rollup merge of #20645: nikomatsakis/rustbook-ice

Conflicts:
src/librustc/middle/mem_categorization.rs
src/librustc/middle/ty.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/foreign.rs
src/librustc_typeck/check/mod.rs

9 years agorollup merge of #20643: scialex/update-zsh
Alex Crichton [Tue, 6 Jan 2015 23:25:02 +0000 (15:25 -0800)]
rollup merge of #20643: scialex/update-zsh

9 years agorollup merge of #20623: jroesch/reject-non-param-bounds
Alex Crichton [Tue, 6 Jan 2015 23:25:00 +0000 (15:25 -0800)]
rollup merge of #20623: jroesch/reject-non-param-bounds

This closes #20019, and should reject any where clauses placed on types not involving type parameters.

r? @nikomatsakis

9 years agorollup merge of #20612: retep998/winsize
Alex Crichton [Tue, 6 Jan 2015 23:24:58 +0000 (15:24 -0800)]
rollup merge of #20612: retep998/winsize

This calculates the width and height using the bounding box of the window in the buffer. Bounding box coordinates are inclusive so I have to add 1 to both dimensions.

9 years agorollup merge of #20570: sanxiyn/no-analysis
Alex Crichton [Tue, 6 Jan 2015 23:24:55 +0000 (15:24 -0800)]
rollup merge of #20570: sanxiyn/no-analysis

9 years agorollup merge of #20557: cactorium/prettyprinters
Alex Crichton [Tue, 6 Jan 2015 23:24:52 +0000 (15:24 -0800)]
rollup merge of #20557: cactorium/prettyprinters

As per https://github.com/rust-lang/rust/issues/20405. To be more precise, the changes just the processing of enums when the name is "RUST$ENCODED$ENUM$..." so it correctly parses when there is more than one number encoding the location of the field it's looking for to determine state of the enum

9 years agoCleanup and followup to PR #17830: parsing changes
Piotr Czarnecki [Fri, 2 Jan 2015 22:00:06 +0000 (23:00 +0100)]
Cleanup and followup to PR #17830: parsing changes

Prevents breaking down `$name` tokens into separate `$` and `name`.
Reports unknown macro variables.

Fixes #18775
Fixes #18839
Fixes #15640

9 years agoRegister new snapshots
Alex Crichton [Tue, 6 Jan 2015 17:24:46 +0000 (09:24 -0800)]
Register new snapshots

Conflicts:
src/librbml/lib.rs
src/libserialize/json_stage0.rs
src/libserialize/serialize_stage0.rs
src/libsyntax/ast.rs
src/libsyntax/ext/deriving/generic/mod.rs
src/libsyntax/parse/token.rs

9 years agorollup merge of #20481: seanmonstar/fmt-show-string
Alex Crichton [Tue, 6 Jan 2015 23:22:24 +0000 (15:22 -0800)]
rollup merge of #20481: seanmonstar/fmt-show-string

Conflicts:
src/compiletest/runtest.rs
src/libcore/fmt/mod.rs
src/libfmt_macros/lib.rs
src/libregex/parse.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/dataflow.rs
src/librustc/middle/infer/higher_ranked/mod.rs
src/librustc/middle/ty.rs
src/librustc_back/archive.rs
src/librustc_borrowck/borrowck/fragments.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_resolve/lib.rs
src/librustc_trans/back/link.rs
src/librustc_trans/save/mod.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/callee.rs
src/librustc_trans/trans/common.rs
src/librustc_trans/trans/consts.rs
src/librustc_trans/trans/controlflow.rs
src/librustc_trans/trans/debuginfo.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/monomorphize.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/method/mod.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/collect.rs
src/libsyntax/ext/format.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/token.rs
src/test/run-pass/issue-8898.rs

9 years agoUse a better word in the guide
Jakub Vrána [Tue, 6 Jan 2015 23:13:47 +0000 (15:13 -0800)]
Use a better word in the guide

9 years agomarkers -> marker
Nick Cameron [Tue, 6 Jan 2015 22:33:42 +0000 (11:33 +1300)]
markers -> marker

9 years agorollup merge of #20609: cmr/mem
Alex Crichton [Tue, 6 Jan 2015 23:07:48 +0000 (15:07 -0800)]
rollup merge of #20609: cmr/mem

9 years agorollup merge of #20562: nick29581/arrays-3
Alex Crichton [Tue, 6 Jan 2015 23:05:53 +0000 (15:05 -0800)]
rollup merge of #20562: nick29581/arrays-3

9 years agofallout
Nick Cameron [Sun, 4 Jan 2015 04:43:24 +0000 (17:43 +1300)]
fallout

9 years agoStricter rules surrounding adjacent nonterminals and sequences
Corey Richardson [Tue, 6 Jan 2015 23:02:00 +0000 (18:02 -0500)]
Stricter rules surrounding adjacent nonterminals and sequences

9 years agoFallout from stabilization
Aaron Turon [Tue, 6 Jan 2015 05:59:45 +0000 (21:59 -0800)]
Fallout from stabilization

9 years agocore: split into fmt::Show and fmt::String
Sean McArthur [Sat, 20 Dec 2014 08:09:35 +0000 (00:09 -0800)]
core: split into fmt::Show and fmt::String

fmt::Show is for debugging, and can and should be implemented for
all public types. This trait is used with `{:?}` syntax. There still
exists #[derive(Show)].

fmt::String is for types that faithfully be represented as a String.
Because of this, there is no way to derive fmt::String, all
implementations must be purposeful. It is used by the default format
syntax, `{}`.

This will break most instances of `{}`, since that now requires the type
to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the
correct fix. Types that were being printed specifically for users should
receive a fmt::String implementation to fix this.

Part of #20013

[breaking-change]

9 years agoAdd new tests covering various cases.
Niko Matsakis [Mon, 5 Jan 2015 21:21:45 +0000 (16:21 -0500)]
Add new tests covering various cases.

9 years agoFix fallout in tests.
Niko Matsakis [Mon, 5 Jan 2015 20:56:07 +0000 (15:56 -0500)]
Fix fallout in tests.

9 years agoImplement impl reachability rules. This is a [breaking-change]. Type
Niko Matsakis [Mon, 5 Jan 2015 11:17:42 +0000 (06:17 -0500)]
Implement impl reachability rules. This is a [breaking-change]. Type
parameters on impls must now also appear in the trait ref, self type,
or some associated type declared on the impl. This ensures that they
are constrianed in some way and that the semantics of the trait system
are well-defined (always a good thing).

There are three major ways to fix this error:

1. Convert the trait to use associated types; most often the type
   parameters are not constrained because they are in fact outputs of
   the impl.

2. Move the type parameters to methods.

3. Add an additional type parameter to the self type or trait so that
   the unused parameter can appear there.

In some cases, it is not possible to fix the impl because the trait
definition needs to be changed first (and that may be out of your
control). In that case, for the time being, you can opt out of these
rules by using `#[old_impl_check]` on the impl and adding a
`#![feature(old_impl_check)]` to your crate declaration.

9 years agoFix fallout in libs. For the most part I just tagged impls as `#[old_impl_check]`.
Niko Matsakis [Mon, 5 Jan 2015 19:01:31 +0000 (14:01 -0500)]
Fix fallout in libs. For the most part I just tagged impls as `#[old_impl_check]`.

9 years agoRemove the unneeded Sized bound on TypeId creation
Jonathan Reem [Tue, 6 Jan 2015 21:59:07 +0000 (22:59 +0100)]
Remove the unneeded Sized bound on TypeId creation

This bound is probably unintentional and is unnecessarily
constricting.

9 years agoPretty print empty structs properly
Nick Cameron [Sun, 4 Jan 2015 23:02:47 +0000 (12:02 +1300)]
Pretty print empty structs properly

9 years agoOnly use built-in indexing for uint indexes
Nick Cameron [Sun, 4 Jan 2015 03:08:18 +0000 (16:08 +1300)]
Only use built-in indexing for uint indexes

9 years agoTests
Nick Cameron [Sat, 3 Jan 2015 00:34:13 +0000 (13:34 +1300)]
Tests

9 years agoRemove old slicing hacks and make new slicing work
Nick Cameron [Sat, 3 Jan 2015 00:33:54 +0000 (13:33 +1300)]
Remove old slicing hacks and make new slicing work

9 years agotest fallout from isize/usize
Corey Richardson [Sat, 6 Dec 2014 02:12:25 +0000 (18:12 -0800)]
test fallout from isize/usize

9 years agoReplace full slice notation with index calls
Nick Cameron [Fri, 2 Jan 2015 00:56:28 +0000 (13:56 +1300)]
Replace full slice notation with index calls

9 years agoImpls using the new scheme for slicing
Nick Cameron [Wed, 31 Dec 2014 07:20:40 +0000 (20:20 +1300)]
Impls using the new scheme for slicing

9 years agoReview changes
Nick Cameron [Tue, 6 Jan 2015 03:06:23 +0000 (16:06 +1300)]
Review changes

9 years agostabilisation
Nick Cameron [Tue, 6 Jan 2015 02:21:06 +0000 (15:21 +1300)]
stabilisation

9 years agoChange `std::kinds` to `std::markers`; flatten `std::kinds::marker`
Nick Cameron [Tue, 6 Jan 2015 01:03:46 +0000 (14:03 +1300)]
Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`

[breaking-change]

9 years agosyntax/rustc: implement isize/usize
Corey Richardson [Sat, 6 Dec 2014 02:11:46 +0000 (18:11 -0800)]
syntax/rustc: implement isize/usize

9 years agostd: Revert stability of Entry-based APIs
Alex Crichton [Tue, 6 Jan 2015 18:25:12 +0000 (10:25 -0800)]
std: Revert stability of Entry-based APIs

There's been some debate over the precise form that these APIs should take, and
they've undergone some changes recently, so these APIs are going to be left
unstable for now to be fleshed out during the next release cycle.

9 years ago[breaking change] Revert Entry behaviour to take keys by value.
Dylan Ede [Tue, 6 Jan 2015 16:36:30 +0000 (16:36 +0000)]
[breaking change] Revert Entry behaviour to take keys by value.

9 years agoauto merge of #20633 : vhbit/rust/ios-cstring, r=brson
bors [Tue, 6 Jan 2015 19:47:08 +0000 (19:47 +0000)]
auto merge of #20633 : vhbit/rust/ios-cstring, r=brson

9 years agoFix ICE that @steveklabnik encountered in rust-ice. The problems turned out to be...
Niko Matsakis [Tue, 6 Jan 2015 10:03:42 +0000 (05:03 -0500)]
Fix ICE that @steveklabnik encountered in rust-ice. The problems turned out to be that were being very loose with bound regions in trans (we were basically just ignoring and flattening binders). Since binders are significant to subtyping and hence to trait selection, this can cause a lot of problems. So this patch makes us treat them more strictly -- for example, we propagate binders, and avoid skipping past the `Binder` by writing `foo.0`.

Fixes #20644.

9 years agoTuning pthread_key_t type
Michael Neumann [Tue, 6 Jan 2015 09:53:32 +0000 (10:53 +0100)]
Tuning pthread_key_t type

Both FreeBSD and DragonFly define pthread_key_t as int, while Linux
defines it as uint. As pthread_key_t is used as an opaque type and
storage size of both int and uint are the same, this is rather a
cosmetic change.

iOS uses ulong (as OS X) so difference is critical on 64bit platforms.

9 years agostd: prevent `CreateProcess()` race on Windows
klutzy [Tue, 6 Jan 2015 15:42:26 +0000 (00:42 +0900)]
std: prevent `CreateProcess()` race on Windows

Believe or not, `CreateProcess()` is racy if several threads create
child processes: [0], [1], [2].

This caused some tests show crash dialogs during
`make check-stage#-rpass`.

More explanation:

On Windows, `SetErrorMode()` controls display of error dialogs: it
accepts new error mode and returns old error mode.
The error mode is process-global and automatically inherited to child
process when created.

MSYS2 bash shell internally sets it to not show error dialogs, therefore
`make check-stage#-rpass` should not show them either.

However, [1] says that `CreateProcess()` internally invokes
`SetErrorMode()` twice: at first it sets mode `0x8001` and saves
original mode, and at second it restores original mode.
So if two threads simultaneously call `CreateProcess()`, the first
thread sets error mode to `0x8001` then the second thread recognizes
that current error mode is `0x8001`. Therefore, The second thread will
create process with wrong error mode.

This really occurs inside `compiletest`: it creates several processes on
each thread, so some `run-pass` tests are invoked with wrong error mode
therefore show crash dialog.

This commit adds `StaticMutex` for `CreateProcess()` call. This seems
to fix the "dialog annoyance" issue.

[0]: http://support.microsoft.com/kb/315939
[1]: https://code.google.com/p/nativeclient/issues/detail?id=2968
[2]: https://ghc.haskell.org/trac/ghc/ticket/2650

9 years agoStabilize std::error
Aaron Turon [Tue, 6 Jan 2015 17:20:40 +0000 (09:20 -0800)]
Stabilize std::error

This commit is a first past stabilization of `std::error`:

* The module is stable.
* The `FromError` trait and impls are stable
* The `Error` trait itself is left unstable, pending current APIs and
  possible revisions during the alpha cycle.

9 years agoupdate zsh rust completions
Alexander Light [Tue, 6 Jan 2015 17:15:41 +0000 (12:15 -0500)]
update zsh rust completions

9 years agoStabilize std::thread
Aaron Turon [Mon, 5 Jan 2015 23:45:18 +0000 (15:45 -0800)]
Stabilize std::thread

This commit takes a first pass at stabilizing `std::thread`:

* It removes the `detach` method in favor of two constructors -- `spawn`
  for detached threads, `scoped` for "scoped" (i.e., must-join)
  threads. This addresses some of the surprise/frustrating debug
  sessions with the previous API, in which `spawn` produced a guard that
  on destruction joined the thread (unless `detach` was called).

  The reason to have the division in part is that `Send` will soon not
  imply `'static`, which means that `scoped` thread creation can take a
  closure over *shared stack data* of the parent thread. On the other
  hand, this means that the parent must not pop the relevant stack
  frames while the child thread is running. The `JoinGuard` is used to
  prevent this from happening by joining on drop (if you have not
  already explicitly `join`ed.) The APIs around `scoped` are
  future-proofed for the `Send` changes by taking an additional lifetime
  parameter. With the current definition of `Send`, this is forced to be
  `'static`, but when `Send` changes these APIs will gain their full
  flexibility immediately.

  Threads that are `spawn`ed, on the other hand, are detached from the
  start and do not yield an RAII guard.

  The hope is that, by making `scoped` an explicit opt-in with a very
  suggestive name, it will be drastically less likely to be caught by a
  surprising deadlock due to an implicit join at the end of a scope.

* The module itself is marked stable.

* Existing methods other than `spawn` and `scoped` are marked stable.

The migration path is:

```rust
Thread::spawn(f).detached()
```

becomes

```rust
Thread::spawn(f)
```

while

```rust
let res = Thread::spawn(f);
res.join()
```

becomes

```rust
let res = Thread::scoped(f);
res.join()
```

[breaking-change]

9 years agoFix fallout
Corey Richardson [Mon, 5 Jan 2015 06:51:03 +0000 (01:51 -0500)]
Fix fallout

9 years agosyntax: implement 'macro input future proofing'
Corey Richardson [Fri, 2 Jan 2015 21:41:24 +0000 (16:41 -0500)]
syntax: implement 'macro input future proofing'

See RFC 550 (https://github.com/rust-lang/rfcs/pull/550) for the motivation
and details.

If this breaks your code, add one of the listed tokens after the relevant
non-terminal in your matcher.

[breaking-change]