]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoFix dead links in the guide and reorganize
Alex Crichton [Thu, 8 Jan 2015 18:27:03 +0000 (10:27 -0800)]
Fix dead links in the guide and reorganize

9 years agorollup merge of #20757: nikomatsakis/issue-20624-assoc-types-coherence
Alex Crichton [Thu, 8 Jan 2015 17:32:06 +0000 (09:32 -0800)]
rollup merge of #20757: nikomatsakis/issue-20624-assoc-types-coherence

9 years agoRemove silly long line.
Niko Matsakis [Thu, 8 Jan 2015 17:30:13 +0000 (12:30 -0500)]
Remove silly long line.

9 years agorollup merge of #20754: nikomatsakis/int-feature
Alex Crichton [Thu, 8 Jan 2015 17:24:08 +0000 (09:24 -0800)]
rollup merge of #20754: nikomatsakis/int-feature

Conflicts:
src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs
src/test/compile-fail/issue-2590.rs
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/slice-mut-2.rs
src/test/compile-fail/std-uncopyable-atomics.rs

9 years agorollup merge of #20751: nikomatsakis/issue-20232
Alex Crichton [Thu, 8 Jan 2015 17:22:10 +0000 (09:22 -0800)]
rollup merge of #20751: nikomatsakis/issue-20232

Issue #20232. Fun.

r? @eddyb you prob know this system best

9 years agorollup merge of #20746: dotdash/fix_indent
Alex Crichton [Thu, 8 Jan 2015 17:22:08 +0000 (09:22 -0800)]
rollup merge of #20746: dotdash/fix_indent

Most of the file lost one level of indentation in a recent rollup. Most
likely an accident during merge conflict resolution.

9 years agorollup merge of #20740: FlaPer87/remove-opt-out-copy
Alex Crichton [Thu, 8 Jan 2015 17:22:06 +0000 (09:22 -0800)]
rollup merge of #20740: FlaPer87/remove-opt-out-copy

[breaking-change] code using this feature will break.

9 years agorollup merge of #20738: brson/feature-staging2
Alex Crichton [Thu, 8 Jan 2015 17:22:03 +0000 (09:22 -0800)]
rollup merge of #20738: brson/feature-staging2

This gets rid of the 'experimental' level, removes the non-staged_api
case (i.e. stability levels for out-of-tree crates), and lets the
staged_api attributes use 'unstable' and 'deprecated' lints.

This makes the transition period to the full feature staging design
a bit nicer.

9 years agorollup merge of #20736: akiss77/pr-u8-c_char
Alex Crichton [Thu, 8 Jan 2015 17:21:59 +0000 (09:21 -0800)]
rollup merge of #20736: akiss77/pr-u8-c_char

9 years agorollup merge of #19897: steveklabnik/trpl
Alex Crichton [Thu, 8 Jan 2015 17:21:57 +0000 (09:21 -0800)]
rollup merge of #19897: steveklabnik/trpl

An updated version of https://github.com/rust-lang/rust/pull/19461

This version vendors aturon/rust-book@731f7bf and builds it when building the docs. This is almost great, except my `make`-foo is poor, so I have my own personal paths in `mk/docs.mk`. How should I best get around that?

/cc @brson

9 years agoAdd another test using projection types in impls.
Niko Matsakis [Thu, 8 Jan 2015 17:02:34 +0000 (12:02 -0500)]
Add another test using projection types in impls.

9 years agoNormalize types bottom up. Fixes #20666.
Niko Matsakis [Thu, 8 Jan 2015 17:02:15 +0000 (12:02 -0500)]
Normalize types bottom up. Fixes #20666.

9 years ago"The Rust Programming Language"
Steve Klabnik [Tue, 2 Dec 2014 14:20:48 +0000 (09:20 -0500)]
"The Rust Programming Language"

This pulls all of our long-form documentation into a single document,
nicknamed "the book" and formally titled "The Rust Programming
Language."

A few things motivated this change:

* People knew of The Guide, but not the individual Guides. This merges
  them together, helping discoverability.
* You can get all of Rust's longform documentation in one place, which
  is nice.
* We now have rustbook in-tree, which can generate this kind of
  documentation. While its style is basic, the general idea is much
  better: a table of contents on the left-hand side.
* Rather than a almost 10,000-line guide.md, there are now smaller files
  per section.

9 years agoAdjust tests to be clearer about the type that results from a shift expression.
Niko Matsakis [Thu, 8 Jan 2015 16:26:42 +0000 (11:26 -0500)]
Adjust tests to be clearer about the type that results from a shift expression.

9 years agoRename test to fit naming convention.
Niko Matsakis [Thu, 8 Jan 2015 15:49:05 +0000 (10:49 -0500)]
Rename test to fit naming convention.

9 years agoNormalize types in supertraits when checking that impls are valid during wf.
Niko Matsakis [Thu, 8 Jan 2015 15:45:56 +0000 (10:45 -0500)]
Normalize types in supertraits when checking that impls are valid during wf.
Fixes #20559.

9 years agoNormalize types in impls, add test for coherence failure.
Niko Matsakis [Thu, 8 Jan 2015 11:58:41 +0000 (06:58 -0500)]
Normalize types in impls, add test for coherence failure.

Fixes #20624.

9 years agoWrap long line
Niko Matsakis [Thu, 8 Jan 2015 15:59:40 +0000 (10:59 -0500)]
Wrap long line

9 years agoModify lifetime-infereence-give-expl-lifetime-param-3 to use a shorter
Niko Matsakis [Thu, 8 Jan 2015 15:56:56 +0000 (10:56 -0500)]
Modify lifetime-infereence-give-expl-lifetime-param-3 to use a shorter
type name so that messages do not wrap.

9 years agoAllow shift operator to take any integral type (and add a test).
Niko Matsakis [Thu, 8 Jan 2015 15:28:59 +0000 (10:28 -0500)]
Allow shift operator to take any integral type (and add a test).

9 years agoUpdate graphviz tests to accommodate new isize/usize types and is/us suffixes.
Felix S. Klock II [Thu, 8 Jan 2015 14:19:12 +0000 (15:19 +0100)]
Update graphviz tests to accommodate new isize/usize types and is/us suffixes.

9 years agoUpdate the compile-fail-fulldeps tests with new isize/usize literal suffixes.
Felix S. Klock II [Thu, 8 Jan 2015 14:09:03 +0000 (15:09 +0100)]
Update the compile-fail-fulldeps tests with new isize/usize literal suffixes.

9 years agoAccommodate the "int literal is too large" error message currently embedded in rustc.
Felix S. Klock II [Thu, 8 Jan 2015 14:05:17 +0000 (15:05 +0100)]
Accommodate the "int literal is too large" error message currently embedded in rustc.

9 years agoTest fixes.
Huon Wilson [Thu, 8 Jan 2015 12:36:24 +0000 (23:36 +1100)]
Test fixes.

9 years agoUpdate compile-fail tests to use is/us, not i/u.
Huon Wilson [Thu, 8 Jan 2015 11:05:56 +0000 (22:05 +1100)]
Update compile-fail tests to use is/us, not i/u.

9 years agoUpdate compile fail tests to use usize.
Huon Wilson [Thu, 8 Jan 2015 11:02:42 +0000 (22:02 +1100)]
Update compile fail tests to use usize.

9 years agoUpdate compile fail tests to use isize.
Huon Wilson [Thu, 8 Jan 2015 10:54:35 +0000 (21:54 +1100)]
Update compile fail tests to use isize.

9 years agoRemove warning from the libraries.
Huon Wilson [Thu, 8 Jan 2015 10:45:49 +0000 (21:45 +1100)]
Remove warning from the libraries.

This adds the int_uint feature to *every* library, whether or not it
needs it.

9 years agoAdd a warning feature gate for int/uint in types and i/u suffixes.
Huon Wilson [Thu, 8 Jan 2015 10:16:35 +0000 (21:16 +1100)]
Add a warning feature gate for int/uint in types and i/u suffixes.

9 years agoStore deprecated status of i/u-suffixed literals.
Huon Wilson [Thu, 8 Jan 2015 09:13:14 +0000 (20:13 +1100)]
Store deprecated status of i/u-suffixed literals.

9 years agoAdd new test for #20232.
Niko Matsakis [Thu, 8 Jan 2015 14:18:55 +0000 (09:18 -0500)]
Add new test for #20232.

9 years agoUpdate regionck to discharge the binder safely (using
Niko Matsakis [Thu, 8 Jan 2015 14:13:40 +0000 (09:13 -0500)]
Update regionck to discharge the binder safely (using
`assert_no_late_bound_regions`) and to give more helpful debug output.

9 years agoFix the actual bug for #20232: when creating the cmt for the implicit
Niko Matsakis [Thu, 8 Jan 2015 14:13:08 +0000 (09:13 -0500)]
Fix the actual bug for #20232: when creating the cmt for the implicit
deref that is associated with an overloaded index, we should not
consult the method lookup table. This deref is *always* a deref of an
`&T` and hence is never overloaded (and is also not present in the
tables; it has no "id" or other associated key).

9 years agoUpdate the "English-language" to-string function of a `cmt` to use
Niko Matsakis [Thu, 8 Jan 2015 14:12:06 +0000 (09:12 -0500)]
Update the "English-language" to-string function of a `cmt` to use
more modern terminology and update tests accordingly.

9 years agoAdd comments to autoderef() helper and refactor it to take
Niko Matsakis [Wed, 7 Jan 2015 15:53:09 +0000 (10:53 -0500)]
Add comments to autoderef() helper and refactor it to take
an `Option<&Expr>` like everything else.

9 years agoauto merge of #20744 : huonw/rust/fix-string-slicing, r=pnkfelix
bors [Thu, 8 Jan 2015 12:39:56 +0000 (12:39 +0000)]
auto merge of #20744 : huonw/rust/fix-string-slicing, r=pnkfelix

9 years agoRemove the deprecated opt_out_copy feature
Flavio Percoco [Thu, 8 Jan 2015 11:01:48 +0000 (12:01 +0100)]
Remove the deprecated opt_out_copy feature

9 years agoRestore indentation in common.rs
Björn Steinbrink [Thu, 8 Jan 2015 12:14:07 +0000 (13:14 +0100)]
Restore indentation in common.rs

Most of the file lost one level of indentation in a recent rollup. Most
likely an accident during merge conflict resolution.

9 years agoLet ToString work with unsized types, importantly, `str`.
Huon Wilson [Thu, 8 Jan 2015 11:48:32 +0000 (22:48 +1100)]
Let ToString work with unsized types, importantly, `str`.

9 years agoImprovements to feature staging
Brian Anderson [Wed, 7 Jan 2015 23:48:16 +0000 (15:48 -0800)]
Improvements to feature staging

This gets rid of the 'experimental' level, removes the non-staged_api
case (i.e. stability levels for out-of-tree crates), and lets the
staged_api attributes use 'unstable' and 'deprecated' lints.

This makes the transition period to the full feature staging design
a bit nicer.

9 years agoauto merge of #20737 : aturon/rust/stab-stragglers, r=alexcrichton
bors [Thu, 8 Jan 2015 09:04:49 +0000 (09:04 +0000)]
auto merge of #20737 : aturon/rust/stab-stragglers, r=alexcrichton

Marks `vec`, `char` and `fmt` as stable module names.

9 years agoAdd missing module stability attributes
Aaron Turon [Thu, 8 Jan 2015 08:26:21 +0000 (00:26 -0800)]
Add missing module stability attributes

9 years agoFix: `libc::c_char` is not always `i8`
Akos Kiss [Thu, 8 Jan 2015 07:03:00 +0000 (08:03 +0100)]
Fix: `libc::c_char` is not always `i8`

9 years agoauto merge of #20733 : alexcrichton/rust/rollup, r=alexcrichton
bors [Thu, 8 Jan 2015 05:35:51 +0000 (05:35 +0000)]
auto merge of #20733 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoMore test fixes and rebase conflicts
Alex Crichton [Thu, 8 Jan 2015 04:06:37 +0000 (20:06 -0800)]
More test fixes and rebase conflicts

9 years agorollup merge of #20731: nick29581/assoc-inherant
Alex Crichton [Thu, 8 Jan 2015 03:30:20 +0000 (19:30 -0800)]
rollup merge of #20731: nick29581/assoc-inherant

9 years agoTest fixes and rebase conflicts
Alex Crichton [Thu, 8 Jan 2015 02:53:58 +0000 (18:53 -0800)]
Test fixes and rebase conflicts

9 years agoForbid associated items in inherent impls
Nick Cameron [Thu, 8 Jan 2015 02:07:15 +0000 (15:07 +1300)]
Forbid associated items in inherent impls

Closes #20359

9 years agorollup merge of #20707: nikomatsakis/issue-20582
Alex Crichton [Thu, 8 Jan 2015 01:44:24 +0000 (17:44 -0800)]
rollup merge of #20707: nikomatsakis/issue-20582

9 years agorollup merge of #20723: pnkfelix/feature-gate-box-syntax
Alex Crichton [Thu, 8 Jan 2015 01:42:47 +0000 (17:42 -0800)]
rollup merge of #20723: pnkfelix/feature-gate-box-syntax

Conflicts:
src/compiletest/compiletest.rs
src/libcollections/lib.rs
src/libserialize/lib.rs
src/libsyntax/feature_gate.rs

9 years agofallout: part of changes to compile-fail tests. (follows same pattern as prior two...
Felix S. Klock II [Thu, 8 Jan 2015 01:41:23 +0000 (02:41 +0100)]
fallout: part of changes to compile-fail tests.  (follows same pattern as prior two commits.)

9 years agorollup merge of #20720: nick29581/assoc-ice-missing
Alex Crichton [Thu, 8 Jan 2015 01:38:03 +0000 (17:38 -0800)]
rollup merge of #20720: nick29581/assoc-ice-missing

9 years agofallout: run-fail tests that use box. (many/all could be ported to `Box::new` instead.)
Felix S. Klock II [Thu, 8 Jan 2015 01:37:58 +0000 (02:37 +0100)]
fallout: run-fail tests that use box. (many/all could be ported to `Box::new` instead.)

9 years agorollup merge of #20657: alexcrichton/stabilize-macros
Alex Crichton [Thu, 8 Jan 2015 01:36:16 +0000 (17:36 -0800)]
rollup merge of #20657: alexcrichton/stabilize-macros

9 years agoRemove String impls and fix for make tidy
Nick Cameron [Thu, 8 Jan 2015 01:33:57 +0000 (14:33 +1300)]
Remove String impls and fix for make tidy

9 years agorollup merge of #20706: nikomatsakis/assoc-types-projections-in-structs-issue-20470
Alex Crichton [Thu, 8 Jan 2015 01:35:00 +0000 (17:35 -0800)]
rollup merge of #20706: nikomatsakis/assoc-types-projections-in-structs-issue-20470

Conflicts:
src/librustc_trans/trans/expr.rs

9 years agorollup merge of #20665: nikomatsakis/assoc-types-method-dispatch-projection
Alex Crichton [Thu, 8 Jan 2015 01:33:41 +0000 (17:33 -0800)]
rollup merge of #20665: nikomatsakis/assoc-types-method-dispatch-projection

Conflicts:
src/librustc/middle/ty.rs

9 years agofallout: run-pass tests that use box. (many could be ported to `Box::new` instead...
Felix S. Klock II [Thu, 8 Jan 2015 01:25:56 +0000 (02:25 +0100)]
fallout: run-pass tests that use box.  (many could be ported to `Box::new` instead in the future.)

9 years agorollup merge of #20728: huonw/type-param-shadowing
Alex Crichton [Thu, 8 Jan 2015 01:30:15 +0000 (17:30 -0800)]
rollup merge of #20728: huonw/type-param-shadowing

Conflicts:
src/librustc_typeck/check/wf.rs

9 years agorollup merge of #20631: huon/no-drop-and-copy
Alex Crichton [Thu, 8 Jan 2015 01:28:38 +0000 (17:28 -0800)]
rollup merge of #20631: huon/no-drop-and-copy

9 years agoProhibit type parameter shadowing with a clunky hammer.
Huon Wilson [Thu, 8 Jan 2015 00:39:45 +0000 (11:39 +1100)]
Prohibit type parameter shadowing with a clunky hammer.

This is a [breaking-change].

Change

    impl<T> Foo<T> {
        fn bar<T>(...

to (for example)

    impl<T> Foo<T> {
        fn bar<U>(...

Per RFC 459.

Closes #19390.

9 years agorollup merge of #20721: japaric/snap
Alex Crichton [Thu, 8 Jan 2015 01:26:58 +0000 (17:26 -0800)]
rollup merge of #20721: japaric/snap

Conflicts:
src/libcollections/vec.rs
src/libcore/fmt/mod.rs
src/librustc/lint/builtin.rs
src/librustc/session/config.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/context.rs
src/librustc_trans/trans/type_.rs
src/librustc_typeck/check/_match.rs
src/librustdoc/html/format.rs
src/libsyntax/std_inject.rs
src/libsyntax/util/interner.rs
src/test/compile-fail/mut-pattern-mismatched.rs

9 years agoNormalize types of fields in struct literals during type-checking.
Niko Matsakis [Wed, 7 Jan 2015 23:45:36 +0000 (18:45 -0500)]
Normalize types of fields in struct literals during type-checking.
Fixes #20535.

9 years agoUpdate compile-fail test with new message that is generated as a
Niko Matsakis [Wed, 7 Jan 2015 20:32:36 +0000 (15:32 -0500)]
Update compile-fail test with new message that is generated as a
result of using `ty::type_is_sized`

9 years agoAdd rather involved run-pass test case.
Niko Matsakis [Wed, 7 Jan 2015 18:57:42 +0000 (13:57 -0500)]
Add rather involved run-pass test case.

9 years agoNormalize associated types in `with_field_tys`
Niko Matsakis [Wed, 7 Jan 2015 18:53:54 +0000 (13:53 -0500)]
Normalize associated types in `with_field_tys`

9 years agoUse ty::type_is_sized() so that we handle projection types properly.
Niko Matsakis [Wed, 7 Jan 2015 17:49:52 +0000 (12:49 -0500)]
Use ty::type_is_sized() so that we handle projection types properly.

9 years agorollup merge of #20726: dgrunwald/require-parens-for-chained-comparison
Alex Crichton [Thu, 8 Jan 2015 01:19:55 +0000 (17:19 -0800)]
rollup merge of #20726: dgrunwald/require-parens-for-chained-comparison

[Rendered RFC](https://github.com/rust-lang/rfcs/blob/master/text/0558-require-parentheses-for-chained-comparisons.md)

9 years agorollup merge of #20725: tomjakubowski/rustdoc-misc
Alex Crichton [Thu, 8 Jan 2015 01:19:51 +0000 (17:19 -0800)]
rollup merge of #20725: tomjakubowski/rustdoc-misc

Conflicts:
src/librustdoc/html/format.rs

9 years agorollup merge of #20722: alexcrichton/audit-show
Alex Crichton [Thu, 8 Jan 2015 01:18:59 +0000 (17:18 -0800)]
rollup merge of #20722: alexcrichton/audit-show

Conflicts:
src/libcollections/vec.rs
src/libcore/fmt/mod.rs
src/librustdoc/html/format.rs

9 years agorollup merge of #20716: brson/RUST_DEBUG
Alex Crichton [Thu, 8 Jan 2015 01:18:08 +0000 (17:18 -0800)]
rollup merge of #20716: brson/RUST_DEBUG

9 years agorollup merge of #20710: daboross/fix-stable-before-bracket
Alex Crichton [Thu, 8 Jan 2015 01:18:06 +0000 (17:18 -0800)]
rollup merge of #20710: daboross/fix-stable-before-bracket

This changes a line that has `\n#[stable]}` to instead have `}\n#[stable]`.

The #[stable] has been before the bracket since https://github.com/rust-lang/rust/commit/b94bcbf56eab163517e8ffc93888284b8dbb6238.

This is a (very) minor change, and I have not built this locally because of my not-so-powerful machine.

9 years agorollup merge of #20709: thiagopnts/ownership-guide-typo
Alex Crichton [Thu, 8 Jan 2015 01:18:05 +0000 (17:18 -0800)]
rollup merge of #20709: thiagopnts/ownership-guide-typo

I was reading the ownership guide and found this small typo :bowtie:

9 years agorollup merge of #20708: aturon/new-int-modules
Alex Crichton [Thu, 8 Jan 2015 01:18:01 +0000 (17:18 -0800)]
rollup merge of #20708: aturon/new-int-modules

Conflicts:
src/libserialize/lib.rs

9 years agorollup merge of #20704: alexcrichton/hopefully-make-tests-less-spurious
Alex Crichton [Thu, 8 Jan 2015 01:17:34 +0000 (17:17 -0800)]
rollup merge of #20704: alexcrichton/hopefully-make-tests-less-spurious

These tests have all been failing spuroiusly on Windows from time to time, and
one suspicion is that the shilc thread outliving the main thread somehow causes
the problem. Switch all the tests over to using Thread::scoped instead of
Thread::spawn to see if it helps the issue.

cc #19120

9 years agorollup merge of #20703: barosl/rustdoc-z-index-fallout
Alex Crichton [Thu, 8 Jan 2015 01:17:32 +0000 (17:17 -0800)]
rollup merge of #20703: barosl/rustdoc-z-index-fallout

Due to the CSS changes done by the previous patch to make the line numbers clickable (#20092), the sidebar became unclickable. This PR reverts the changes and adopts an alternative approach.

I'm very sorry for having broken things.

9 years agorollup merge of #20696: reem/unsized-typeid
Alex Crichton [Thu, 8 Jan 2015 01:17:31 +0000 (17:17 -0800)]
rollup merge of #20696: reem/unsized-typeid

This removes the needlessly constricting bound on `intrinsics::type_Id` and `TypeId::of`. Also fixes an ICE where using bounds on type parameters in extern blocks fails to resolve the used traits.

9 years agorollup merge of #20695: frewsxcv/patch-2
Alex Crichton [Thu, 8 Jan 2015 01:17:29 +0000 (17:17 -0800)]
rollup merge of #20695: frewsxcv/patch-2

This should be rollup

9 years agorollup merge of #20693: EchoAce/intro-oboe
Alex Crichton [Thu, 8 Jan 2015 01:17:27 +0000 (17:17 -0800)]
rollup merge of #20693: EchoAce/intro-oboe

Issue #20686, proposed by nstoddard.

9 years agorollup merge of #20688: jroesch/reject-non-param-bounds-followup
Alex Crichton [Thu, 8 Jan 2015 01:17:25 +0000 (17:17 -0800)]
rollup merge of #20688: jroesch/reject-non-param-bounds-followup

This is a follow up to my recent PR. r? @nikomatsakis

9 years agorollup merge of #20680: nick29581/target-word
Alex Crichton [Thu, 8 Jan 2015 01:17:23 +0000 (17:17 -0800)]
rollup merge of #20680: nick29581/target-word

Closes #20421

[breaking-change]

r? @brson

9 years agorollup merge of #20663: brson/feature-staging
Alex Crichton [Thu, 8 Jan 2015 01:17:22 +0000 (17:17 -0800)]
rollup merge of #20663: brson/feature-staging

This partially implements the feature staging described in the
[release channel RFC][rc]. It does not yet fully conform to the RFC as
written, but does accomplish its goals sufficiently for the 1.0 alpha
release.

It has three primary user-visible effects:

* On the nightly channel, use of unstable APIs generates a warning.
* On the beta channel, use of unstable APIs generates a warning.
* On the beta channel, use of feature gates generates a warning.

Code that does not trigger these warnings is considered 'stable',
modulo pre-1.0 bugs.

Disabling the warnings for unstable APIs continues to be done in the
existing (i.e. old) style, via `#[allow(...)]`, not that specified in
the RFC. I deem this marginally acceptable since any code that must do
this is not using the stable dialect of Rust.

Use of feature gates is itself gated with the new 'unstable_features'
lint, on nightly set to 'allow', and on beta 'warn'.

The attribute scheme used here corresponds to an older version of the
RFC, with the `#[staged_api]` crate attribute toggling the staging
behavior of the stability attributes, but the user impact is only
in-tree so I'm not concerned about having to make design changes later
(and I may ultimately prefer the scheme here after all, with the
`#[staged_api]` crate attribute).

Since the Rust codebase itself makes use of unstable features the
compiler and build system do a midly elaborate dance to allow it to
bootstrap while disobeying these lints (which would otherwise be
errors because Rust builds with `-D warnings`).

This patch includes one significant hack that causes a
regression. Because the `format_args!` macro emits calls to unstable
APIs it would trigger the lint.  I added a hack to the lint to make it
not trigger, but this in turn causes arguments to `println!` not to be
checked for feature gates. I don't presently understand macro
expansion well enough to fix. This is bug #20661.

Closes #16678

[rc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md

Next steps are to disable the existing out-of-tree behavior for stability attributes, and convert the remaining system to be feature-based per the RFC. During the first beta cycle we will set these lints to 'forbid'.

9 years agorollup merge of #20654: alexcrichton/stabilize-hash
Alex Crichton [Thu, 8 Jan 2015 01:17:19 +0000 (17:17 -0800)]
rollup merge of #20654: alexcrichton/stabilize-hash

This commit aims to prepare the `std::hash` module for alpha by formalizing its
current interface whileholding off on adding `#[stable]` to the new APIs.  The
current usage with the `HashMap` and `HashSet` types is also reconciled by
separating out composable parts of the design. The primary goal of this slight
redesign is to separate the concepts of a hasher's state from a hashing
algorithm itself.

The primary change of this commit is to separate the `Hasher` trait into a
`Hasher` and a `HashState` trait. Conceptually the old `Hasher` trait was
actually just a factory for various states, but hashing had very little control
over how these states were used. Additionally the old `Hasher` trait was
actually fairly unrelated to hashing.

This commit redesigns the existing `Hasher` trait to match what the notion of a
`Hasher` normally implies with the following definition:

    trait Hasher {
        type Output;
        fn reset(&mut self);
        fn finish(&self) -> Output;
    }

This `Hasher` trait emphasizes that hashing algorithms may produce outputs other
than a `u64`, so the output type is made generic. Other than that, however, very
little is assumed about a particular hasher. It is left up to implementors to
provide specific methods or trait implementations to feed data into a hasher.

The corresponding `Hash` trait becomes:

    trait Hash<H: Hasher> {
        fn hash(&self, &mut H);
    }

The old default of `SipState` was removed from this trait as it's not something
that we're willing to stabilize until the end of time, but the type parameter is
always required to implement `Hasher`. Note that the type parameter `H` remains
on the trait to enable multidispatch for specialization of hashing for
particular hashers.

Note that `Writer` is not mentioned in either of `Hash` or `Hasher`, it is
simply used as part `derive` and the implementations for all primitive types.

With these definitions, the old `Hasher` trait is realized as a new `HashState`
trait in the `collections::hash_state` module as an unstable addition for
now. The current definition looks like:

    trait HashState {
        type Hasher: Hasher;
        fn hasher(&self) -> Hasher;
    }

The purpose of this trait is to emphasize that the one piece of functionality
for implementors is that new instances of `Hasher` can be created.  This
conceptually represents the two keys from which more instances of a
`SipHasher` can be created, and a `HashState` is what's stored in a
`HashMap`, not a `Hasher`.

Implementors of custom hash algorithms should implement the `Hasher` trait, and
only hash algorithms intended for use in hash maps need to implement or worry
about the `HashState` trait.

The entire module and `HashState` infrastructure remains `#[unstable]` due to it
being recently redesigned, but some other stability decision made for the
`std::hash` module are:

* The `Writer` trait remains `#[experimental]` as it's intended to be replaced
  with an `io::Writer` (more details soon).
* The top-level `hash` function is `#[unstable]` as it is intended to be generic
  over the hashing algorithm instead of hardwired to `SipHasher`
* The inner `sip` module is now private as its one export, `SipHasher` is
  reexported in the `hash` module.

And finally, a few changes were made to the default parameters on `HashMap`.

* The `RandomSipHasher` default type parameter was renamed to `RandomState`.
  This renaming emphasizes that it is not a hasher, but rather just state to
  generate hashers. It also moves away from the name "sip" as it may not always
  be implemented as `SipHasher`. This type lives in the
  `std::collections::hash_map` module as `#[unstable]`

* The associated `Hasher` type of `RandomState` is creatively called...
  `Hasher`! This concrete structure lives next to `RandomState` as an
  implemenation of the "default hashing algorithm" used for a `HashMap`. Under
  the hood this is currently implemented as `SipHasher`, but it draws an
  explicit interface for now and allows us to modify the implementation over
  time if necessary.

There are many breaking changes outlined above, and as a result this commit is
a:

[breaking-change]

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 agoRFC 558: Require parentheses for chained comparisons
Daniel Grunwald [Thu, 8 Jan 2015 00:44:01 +0000 (01:44 +0100)]
RFC 558: Require parentheses for chained comparisons

Fixes #20724.

9 years agoallow box_syntax and unknown features in compiletest driver.
Felix S. Klock II [Thu, 8 Jan 2015 00:43:32 +0000 (01:43 +0100)]
allow box_syntax and unknown features in compiletest driver.

9 years agofix the `&mut _` patterns
Jorge Aparicio [Thu, 8 Jan 2015 00:26:00 +0000 (19:26 -0500)]
fix the `&mut _` patterns

9 years agorustdoc: Render associated type bindings
Tom Jakubowski [Thu, 8 Jan 2015 00:10:40 +0000 (16:10 -0800)]
rustdoc: Render associated type bindings

e.g. `Foo<Output=A>`

This does not work cross-crate unfortunately.

Part of #20646

9 years agoallow box_syntax and unknown features in the rustc_driver crate.
Felix S. Klock II [Thu, 8 Jan 2015 00:17:21 +0000 (01:17 +0100)]
allow box_syntax and unknown features in the rustc_driver crate.

9 years agoallow box_syntax and unknown features in the rustc_llvm crate.
Felix S. Klock II [Thu, 8 Jan 2015 00:03:46 +0000 (01:03 +0100)]
allow box_syntax and unknown features in the rustc_llvm crate.

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.

To facilitate this change, it was also necessary to modify
resolve to recurse on and resolve type parameters in extern { }
blocks. This fixes an ICE when using bounds on type parameters
during the declaration of intrinsics.

This also adds tests for TypeId on both Sized and Unsized
tests as well as a test for using type parameters and bounds
in extern { } blocks.

9 years agoallow unknown features in the log crate.
Felix S. Klock II [Wed, 7 Jan 2015 23:38:47 +0000 (00:38 +0100)]
allow unknown features in the log crate.

9 years agoSwitch to using `Box::new` in the tests in `alloc::boxed`.
Felix S. Klock II [Wed, 7 Jan 2015 22:04:12 +0000 (23:04 +0100)]
Switch to using `Box::new` in the tests in  `alloc::boxed`.

9 years agoTest that box syntax, both in expressions and patterns, is caught by
Felix S. Klock II [Wed, 7 Jan 2015 22:03:22 +0000 (23:03 +0100)]
Test that box syntax, both in expressions and patterns, is caught by
feature gate net.

fix typo in my feature-gate-box-expr.rs test.

9 years agoalternate version of coerce-match test that avoids box syntax.
Felix S. Klock II [Wed, 7 Jan 2015 21:22:11 +0000 (22:22 +0100)]
alternate version of coerce-match test that avoids box syntax.

9 years agocompile-fail tests: Add feature attributes to enable box pat/expr syntax in various...
Felix S. Klock II [Wed, 7 Jan 2015 21:35:56 +0000 (22:35 +0100)]
compile-fail tests: Add feature attributes to enable box pat/expr syntax in various tests.

9 years agorun-pass tests: Add feature attributes to enable box pat/expr syntax in various tests.
Felix S. Klock II [Wed, 7 Jan 2015 19:32:25 +0000 (20:32 +0100)]
run-pass tests: Add feature attributes to enable box pat/expr syntax in various tests.

9 years agoAllow unknown features to bootstrap rustc with box_syntax feature.
Felix S. Klock II [Wed, 7 Jan 2015 17:25:18 +0000 (18:25 +0100)]
Allow unknown features to bootstrap rustc with box_syntax feature.

Specifically added to the test, librustc_trans, librustc_typeck crates.

9 years agoAdded `box_syntax` feature gate; added to std and rustc crates for bootstrap.
Felix S. Klock II [Wed, 7 Jan 2015 14:15:34 +0000 (15:15 +0100)]
Added `box_syntax` feature gate; added to std and rustc crates for bootstrap.

To avoid using the feauture, change uses of `box <expr>` to
`Box::new(<expr>)` alternative, as noted by the feature gate message.

(Note that box patterns have no analogous trivial replacement, at
least not in general; you need to revise the code to do a partial
match, deref, and then the rest of the match.)

[breaking-change]