]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAdjust coherence test to reflect that only the orphan rule prevents you from adding...
Aaron Turon [Wed, 30 Dec 2015 15:00:05 +0000 (07:00 -0800)]
Adjust coherence test to reflect that only the orphan rule prevents you from adding *generalizing* impls

8 years agoAdjust test for new overlap message on default trait impls
Aaron Turon [Wed, 30 Dec 2015 14:56:06 +0000 (06:56 -0800)]
Adjust test for new overlap message on default trait impls

8 years agoAdjust overlap-related tests to account for cosmetic changes to error reporting behavior
Aaron Turon [Wed, 30 Dec 2015 05:18:24 +0000 (21:18 -0800)]
Adjust overlap-related tests to account for cosmetic changes to error reporting behavior

8 years agoAdd tests for specialization on associated types
Aaron Turon [Tue, 29 Dec 2015 22:01:30 +0000 (14:01 -0800)]
Add tests for specialization on associated types

8 years agoImplement default associated type inheritance.
Aaron Turon [Tue, 29 Dec 2015 21:37:34 +0000 (13:37 -0800)]
Implement default associated type inheritance.

This commit leverages the specialization graph infrastructure to allow
specializing trait implementations to leave off associated types for
which their parents have provided defaults.

It also modifies the type projection code to avoid projecting associated
types unless either (1) all input types are fully known or (2) the
available associated type is "final", i.e. not marked `default`.
This restriction is required for soundness, due to examples like:

```rust
trait Foo {
    type Assoc;
}

impl<T> Foo for T {
    default type Assoc = ();
}

impl Foo for u8 {
    type Assoc = String;
}

fn generic<T>() -> <T as Foo>::Assoc {
    () //~ ERROR
}

fn main() {
    let s: String = generic::<u8>();
    println!("{}", s); // bad news
}
```

8 years agoCheck for proper use of `default` keyword in specializing impls.
Aaron Turon [Tue, 29 Dec 2015 18:55:34 +0000 (10:55 -0800)]
Check for proper use of `default` keyword in specializing impls.

8 years agoAdd basic specialization tests, including for default item
Aaron Turon [Mon, 28 Dec 2015 23:40:11 +0000 (15:40 -0800)]
Add basic specialization tests, including for default item
inheritance. Updates some of the coherence tests as well.

8 years agoImplement default method inheritance.
Aaron Turon [Mon, 28 Dec 2015 23:38:26 +0000 (15:38 -0800)]
Implement default method inheritance.

This commit leverages the specialization graph infrastructure to allow
specializing trait implementations to leave off methods for which their
parents have provided defaults.

It does not yet check that the `default` keyword is appropriately used
in such cases.

8 years agoAdd subst helper for inheriting FnSpace from another subst
Aaron Turon [Mon, 28 Dec 2015 21:34:01 +0000 (13:34 -0800)]
Add subst helper for inheriting FnSpace from another subst

8 years agoInitial incorporation of specialization:
Aaron Turon [Tue, 22 Dec 2015 18:20:47 +0000 (10:20 -0800)]
Initial incorporation of specialization:

- Rewrites the overlap checker to instead build up a specialization
  graph, checking for overlap errors in the process.

- Use the specialization order during impl selection.

This commit does not yet handle associated types correctly, and assumes
that all items are `default` and are overridden.

8 years agoAdd specialization module.
Aaron Turon [Tue, 22 Dec 2015 18:17:59 +0000 (10:17 -0800)]
Add specialization module.

The module contains a few important components:

- The `specialize` function, which determines whether one impl is a
  specialization of another.

- The `SpecializationGraph`, a per-trait graph recording the
  specialization tree. The main purpose of the graph is to allow
  traversals upwards (to less specialized impls) for discovering
  un-overridden defaults, and for ensuring that overridden items are
  allowed to be overridden.

8 years agoRefactor `impl_trait_ref_and_oblig`, making it generally available as a utility
Aaron Turon [Wed, 30 Dec 2015 21:47:23 +0000 (13:47 -0800)]
Refactor `impl_trait_ref_and_oblig`, making it generally available as a utility

8 years agoHook `default` keyword into metadata and carry data through to typeck
Aaron Turon [Tue, 29 Dec 2015 00:14:28 +0000 (16:14 -0800)]
Hook `default` keyword into metadata and carry data through to typeck

8 years agoAdd `default` as contextual keyword, and parse it for impl items.
Aaron Turon [Fri, 18 Dec 2015 22:38:28 +0000 (14:38 -0800)]
Add `default` as contextual keyword, and parse it for impl items.

8 years agoRemove useless vector accumulation in `type_vars_for_defs`
Aaron Turon [Tue, 8 Dec 2015 00:59:26 +0000 (16:59 -0800)]
Remove useless vector accumulation in `type_vars_for_defs`

8 years agoFix existing comment typo.
Aaron Turon [Fri, 4 Dec 2015 18:57:02 +0000 (10:57 -0800)]
Fix existing comment typo.

8 years agoAuto merge of #30587 - oli-obk:eager_const_eval2, r=nikomatsakis
bors [Mon, 14 Mar 2016 18:38:23 +0000 (11:38 -0700)]
Auto merge of #30587 - oli-obk:eager_const_eval2, r=nikomatsakis

typestrong const integers

~~It would be great if someone could run crater on this PR, as this has a high danger of breaking valid code~~ Crater ran. Good to go.

----

So this PR does a few things:

1. ~~const eval array values when const evaluating an array expression~~
2. ~~const eval repeat value when const evaluating a repeat expression~~
3. ~~const eval all struct and tuple fields when evaluating a struct/tuple expression~~
4. remove the `ConstVal::Int` and `ConstVal::Uint` variants and replace them with a single enum (`ConstInt`) which has variants for all integral types
  * `usize`/`isize` are also enums with variants for 32 and 64 bit. At creation and various usage steps there are assertions in place checking if the target bitwidth matches with the chosen enum variant
5. enum discriminants (`ty::Disr`) are now `ConstInt`
6. trans has its own `Disr` type now (newtype around `u64`)

This obviously can't be done without breaking changes (the ones that are noticable in stable)
We could probably write lints that find those situations and error on it for a cycle or two. But then again, those situations are rare and really bugs imo anyway:

```rust
let v10 = 10 as i8;
let v4 = 4 as isize;
assert_eq!(v10 << v4 as usize, 160 as i8);
 ```

stops compiling because 160 is not a valid i8

```rust
struct S<T, S> {
    a: T,
    b: u8,
    c: S
}
let s = S { a: 0xff_ff_ff_ffu32, b: 1, c: 0xaa_aa_aa_aa as i32 };
```

stops compiling because `0xaa_aa_aa_aa` is not a valid i32

----

cc @eddyb @pnkfelix

related: https://github.com/rust-lang/rfcs/issues/1071

8 years agoAuto merge of #32233 - Amanieu:volatile_store, r=eddyb
bors [Mon, 14 Mar 2016 15:32:45 +0000 (08:32 -0700)]
Auto merge of #32233 - Amanieu:volatile_store, r=eddyb

Fix LLVM assert with write_volatile

Fixes #29663

8 years agoAuto merge of #32232 - jonas-schievink:issue31511, r=eddyb
bors [Mon, 14 Mar 2016 12:44:24 +0000 (05:44 -0700)]
Auto merge of #32232 - jonas-schievink:issue31511, r=eddyb

Give a more accurate error on thin-to-fat ptr cast

Fixes #31511

8 years agorustbuild
Oliver Schneider [Mon, 14 Mar 2016 08:29:18 +0000 (09:29 +0100)]
rustbuild

8 years agoAuto merge of #32231 - ruud-v-a:avx-cmp-blend, r=alexcrichton
bors [Mon, 14 Mar 2016 07:30:53 +0000 (00:30 -0700)]
Auto merge of #32231 - ruud-v-a:avx-cmp-blend, r=alexcrichton

Define AVX compare and blend intrinsics

This defines the following intrinsics:

 * `_mm256_blendv_pd`
 * `_mm256_blendv_ps`
 * `_mm256_cmp_pd`
 * `_mm256_cmp_ps`

I verified these locally.

8 years agoAuto merge of #32226 - andoriyu:patch-2, r=alexcrichton
bors [Mon, 14 Mar 2016 01:46:59 +0000 (18:46 -0700)]
Auto merge of #32226 - andoriyu:patch-2, r=alexcrichton

Fix. FreeBSD snapshot

Previous snapshot was complied with avx2 instructions by accident.

Actual file: http://people.freebsd.org/~davide/rust/rust-stage0-2016-02-17-4d3eebf-freebsd-x86_64-f38991fbb81c1cd8d0bbda396f98f13a55b42804.tar.bz2

/cc @alexcrichton @dcci

8 years agoAuto merge of #32211 - achanda:ipv6-global, r=alexcrichton
bors [Sun, 13 Mar 2016 23:53:09 +0000 (16:53 -0700)]
Auto merge of #32211 - achanda:ipv6-global, r=alexcrichton

Reject unspecified IP from global

Also fixed the test

8 years agoFix test fallout
Jonas Schievink [Sun, 13 Mar 2016 19:35:04 +0000 (20:35 +0100)]
Fix test fallout

8 years agoAuto merge of #32227 - jseyfried:fix_import_resolution_bug, r=alexcrichton
bors [Sun, 13 Mar 2016 19:24:42 +0000 (12:24 -0700)]
Auto merge of #32227 - jseyfried:fix_import_resolution_bug, r=alexcrichton

Fix import resolution bug

This fixes #32222, which was introduced in #31726.

8 years agoFix LLVM assert with write_volatile
Amanieu d'Antras [Sun, 13 Mar 2016 16:40:06 +0000 (17:40 +0100)]
Fix LLVM assert with write_volatile

8 years agoAuto merge of #32184 - ollie27:win_stdout, r=alexcrichton
bors [Sun, 13 Mar 2016 16:27:17 +0000 (09:27 -0700)]
Auto merge of #32184 - ollie27:win_stdout, r=alexcrichton

Fixup stout/stderr on Windows

WriteConsoleW can fail if called with a large buffer so we need to slice
any stdout/stderr output.
However the current slicing has a few problems:
 1. It slices by byte but still expects valid UTF-8.
 2. The slicing happens even when not outputting to a console.
 3. panic! output is not sliced.

This fixes these issues by moving the slice to right before
WriteConsoleW and slicing on a char boundary.

8 years agoGive a more accurate error on thin-to-fat ptr cast
Jonas Schievink [Sun, 13 Mar 2016 16:01:10 +0000 (17:01 +0100)]
Give a more accurate error on thin-to-fat ptr cast

Fixes #31511

8 years agoAuto merge of #32229 - Manishearth:rollup, r=Manishearth
bors [Sun, 13 Mar 2016 14:30:14 +0000 (07:30 -0700)]
Auto merge of #32229 - Manishearth:rollup, r=Manishearth

Rollup of 4 pull requests

- Successful merges: #32164, #32179, #32212, #32218
- Failed merges:

8 years agoRegenerate x86 platform intrinsics
Ruud van Asseldonk [Sun, 13 Mar 2016 14:09:46 +0000 (15:09 +0100)]
Regenerate x86 platform intrinsics

The exact command used was:

    $ cd src/etc/platform-intrinsics/x86
    $ python2 ../generator.py --format compiler-defs -i info.json   \
      sse.json sse2.json sse3.json ssse3.json sse41.json sse42.json \
      avx.json avx2.json fma.json                                   \
      > ../../../librustc_platform_intrinsics/x86.rs

8 years agoDefine AVX blend intrinsics
Ruud van Asseldonk [Fri, 11 Mar 2016 15:22:11 +0000 (16:22 +0100)]
Define AVX blend intrinsics

This defines the `_mm256_blendv_pd` and `_mm256_blendv_ps` intrinsics.
The `_mm256_blend_pd` and `_mm256_blend_ps` intrinsics are not available
as LLVM intrinsics. In Clang they are implemented using the
shufflevector builtin.

Intel reference: https://software.intel.com/en-us/node/524070.

8 years agoDefine AVX comparison intrinsics
Ruud van Asseldonk [Wed, 9 Mar 2016 20:37:44 +0000 (21:37 +0100)]
Define AVX comparison intrinsics

This defines `_mm256_cmp_pd` and `_mm256_cmp_ps`.

Intel reference: https://software.intel.com/en-us/node/524075.

8 years agoRollup merge of #32218 - cantino:minor_book_typo_fixes, r=steveklabnik
Manish Goregaokar [Sun, 13 Mar 2016 14:03:27 +0000 (19:33 +0530)]
Rollup merge of #32218 - cantino:minor_book_typo_fixes, r=steveklabnik

Fix minor typos in doc.rust-lang.org/book

I've made a few typo and grammar fixes as I've been working through the book.

8 years agoRollup merge of #32212 - Manishearth:ice-cu, r=eddyb
Manish Goregaokar [Sun, 13 Mar 2016 14:03:27 +0000 (19:33 +0530)]
Rollup merge of #32212 - Manishearth:ice-cu, r=eddyb

Don't allow values for codegen-units less than 1

r? @eddyb

fixes #32191

8 years agoRollup merge of #32179 - srinivasreddy:remove_int_suffix, r=steveklabnik
Manish Goregaokar [Sun, 13 Mar 2016 14:03:27 +0000 (19:33 +0530)]
Rollup merge of #32179 - srinivasreddy:remove_int_suffix, r=steveklabnik

Removed integer suffixes in libsyntax crate

8 years agoRollup merge of #32164 - nikomatsakis:fewer-errors, r=eddyb
Manish Goregaokar [Sun, 13 Mar 2016 14:03:27 +0000 (19:33 +0530)]
Rollup merge of #32164 - nikomatsakis:fewer-errors, r=eddyb

Do not report errors from regionck if other errors were already reported

Do not report errors from regionck if other errors were already reported during the lifetime of this inferencer. Fixes #30580.

r? @arielb1

8 years agoAuto merge of #31916 - nagisa:mir-passmgr-2, r=arielb1
bors [Sun, 13 Mar 2016 12:33:28 +0000 (05:33 -0700)]
Auto merge of #31916 - nagisa:mir-passmgr-2, r=arielb1

Add Pass manager for MIR

A new PR, since rebasing the original one (https://github.com/rust-lang/rust/pull/31448) properly was a pain. Since then there has been several changes most notable of which:

1. Removed the pretty-printing with `#[rustc_mir(graphviz/pretty)]`, mostly because we now have `--unpretty=mir`, IMHO that’s the direction we should expand this functionality into;
2. Reverted the infercx change done for typeck, because typeck can make an infercx for itself by being a `MirMapPass`

r? @nikomatsakis

8 years agoAdd regression test for #32222
Jeffrey Seyfried [Sun, 13 Mar 2016 10:41:21 +0000 (10:41 +0000)]
Add regression test for #32222

8 years agoFixes #32222
Jeffrey Seyfried [Sun, 13 Mar 2016 10:31:40 +0000 (10:31 +0000)]
Fixes #32222

8 years agoRefactor out methods `NameResolution::increment_outstanding_references` and
Jeffrey Seyfried [Sun, 13 Mar 2016 09:59:16 +0000 (09:59 +0000)]
Refactor out methods `NameResolution::increment_outstanding_references` and
`NameResolution::decrement_outstanding_references`.

8 years agoAuto merge of #32182 - bluss:string-from-is-str-owned, r=alexcrichton
bors [Sun, 13 Mar 2016 10:40:14 +0000 (03:40 -0700)]
Auto merge of #32182 - bluss:string-from-is-str-owned, r=alexcrichton

Call str::to_owned in String::from and uninline it

Call str::to_owned in String::from and uninline it

These methods were already effectively equal, but now one calls
the other, and neither is marked inline.
String::from does not need to be inlined, it can be without it just like
str::to_owned and String::clone are.

Fixes #32163

8 years agoCall str::to_owned in String::from and uninline it
Ulrik Sverdrup [Thu, 10 Mar 2016 20:15:29 +0000 (21:15 +0100)]
Call str::to_owned in String::from and uninline it

String::from does not need to be inlined, it can be without it just like
str::to_owned and String::clone are.

8 years agoFix. FreeBSD snapshot
Andrey Cherkashin [Sun, 13 Mar 2016 06:02:39 +0000 (22:02 -0800)]
Fix. FreeBSD snapshot

Previous snapshot was complied with avx2 instructions by accident.

Actual file: http://people.freebsd.org/~davide/rust/rust-stage0-2016-02-17-4d3eebf-freebsd-x86_64-f38991fbb81c1cd8d0bbda396f98f13a55b42804.tar.bz2

8 years agoAuto merge of #32141 - jseyfried:fix_resolution_in_lexical_scopes, r=nikomatsakis
bors [Sun, 13 Mar 2016 05:55:14 +0000 (21:55 -0800)]
Auto merge of #32141 - jseyfried:fix_resolution_in_lexical_scopes, r=nikomatsakis

Fix name resolution in lexical scopes

Currently, `resolve_item_in_lexical_scope` does not check the "ribs" (type parameters and local variables). This can allow items that should be shadowed by type parameters to be named.

For example,
```rust
struct T { i: i32 }
fn f<T>() {
    let t = T { i: 0 }; // This use of `T` resolves to the struct, not the type parameter
}

mod Foo {
    pub fn f() {}
}
fn g<Foo>() {
    Foo::f(); // This use of `Foo` resolves to the module, not the type parameter
}
```

This PR changes `resolve_item_in_lexical_scope` so that it fails when the item is shadowed by a rib (fixes #32120).
This is a [breaking-change], but it looks unlikely to cause breakage in practice.

r? @nikomatsakis

8 years agoAuto merge of #32217 - alexcrichton:fix-make-dist, r=brson
bors [Sun, 13 Mar 2016 02:58:15 +0000 (18:58 -0800)]
Auto merge of #32217 - alexcrichton:fix-make-dist, r=brson

mk: Fix `make dist`

With the movement of the erro-index-generator and rustbook, need to update the
rules in `make dist`.

8 years agoAuto merge of #32140 - ruud-v-a:avx-intrinsics, r=alexcrichton
bors [Sun, 13 Mar 2016 00:18:34 +0000 (16:18 -0800)]
Auto merge of #32140 - ruud-v-a:avx-intrinsics, r=alexcrichton

Add AVX broadcast and conversion intrinsics

This adds the following intrinsics:

 * `_mm256_broadcast_pd`
 * `_mm256_broadcast_ps`
 * `_mm256_cvtepi32_pd`
 * `_mm256_cvtepi32_ps`
 * `_mm256_cvtpd_epi32`
 * `_mm256_cvtpd_ps`
 * `_mm256_cvtps_epi32`
 * `_mm256_cvtps_pd`
 * `_mm256_cvttpd_epi32`
 * `_mm256_cvttps_epi32`

The "avx" codegen feature must be enabled to use these.

8 years agoReject unspecified and loopback IP from global
Abhishek Chanda [Sat, 12 Mar 2016 10:13:40 +0000 (02:13 -0800)]
Reject unspecified and loopback IP from global

8 years agoAuto merge of #32112 - alexcrichton:fix-issues, r=aturon
bors [Sat, 12 Mar 2016 21:21:06 +0000 (13:21 -0800)]
Auto merge of #32112 - alexcrichton:fix-issues, r=aturon

std: Fix tracking issues and clean deprecated APIs

This PR fixes up a number of discrepancies found with tracking issues (some closed, some needed new ones, etc), and also cleans out all pre-1.8 deprecated APIs. The big beast here was dealing with `std::dynamic_lib`, and via many applications of a large hammer it's now out of the standard library.

8 years agoFix minor typos in doc.rust-lang.org/book
Andrew Cantino [Sat, 12 Mar 2016 20:35:34 +0000 (12:35 -0800)]
Fix minor typos in doc.rust-lang.org/book

8 years agostd: Clean out deprecated APIs
Alex Crichton [Mon, 7 Mar 2016 23:42:29 +0000 (15:42 -0800)]
std: Clean out deprecated APIs

Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that
are deprecated in the 1.8 release are sticking around for the rest of this
cycle.

Some notable changes are:

* The `dynamic_lib` module was moved into `rustc_back` as the compiler still
  relies on a few bits and pieces.
* The `DebugTuple` formatter now special-cases an empty struct name with only
  one field to append a trailing comma.

8 years agomk: Fix `make dist`
Alex Crichton [Sat, 12 Mar 2016 20:22:40 +0000 (12:22 -0800)]
mk: Fix `make dist`

With the movement of the erro-index-generator and rustbook, need to update the
rules in `make dist`.

8 years agoAuto merge of #32193 - eddyb:stage1-is-useful-mkay, r=eddyb
bors [Sat, 12 Mar 2016 17:37:19 +0000 (09:37 -0800)]
Auto merge of #32193 - eddyb:stage1-is-useful-mkay, r=eddyb

Statically link run-pass/command-before-exec so it passes not just whenever we happen to bootstrap perfectly.

8 years agoImplement --unpretty mir-cfg for graphviz output
Simonas Kazlauskas [Sat, 12 Mar 2016 17:07:00 +0000 (19:07 +0200)]
Implement --unpretty mir-cfg for graphviz output

Also change output for --unpretty mir to output function names in a prettier way.

8 years agoAuto merge of #32142 - mitaa:rdoc-maybe-inline-local, r=alexcrichton
bors [Sat, 12 Mar 2016 15:31:11 +0000 (07:31 -0800)]
Auto merge of #32142 - mitaa:rdoc-maybe-inline-local, r=alexcrichton

rustdoc: improve crate-local inlining

fixes #28537

r? @alexcrichton

8 years agoStatically link run-pass/command-before-exec so it passes not just whenever we happen...
Eduard Burtescu [Sat, 12 Mar 2016 12:36:35 +0000 (14:36 +0200)]
Statically link run-pass/command-before-exec so it passes not just whenever we happen to bootstrap perfectly.

8 years agoDon't allow values for codegen-units less than 1 (fixes #32191)
Manish Goregaokar [Sat, 12 Mar 2016 10:31:34 +0000 (16:01 +0530)]
Don't allow values for codegen-units less than 1 (fixes #32191)

8 years agostd: Add a tracking issue for Peekable::is_empty
Alex Crichton [Tue, 8 Mar 2016 00:35:09 +0000 (16:35 -0800)]
std: Add a tracking issue for Peekable::is_empty

The listed tracking issue was hooked up to the wrong location by accident.

8 years agocore: Make a new tracking issue for prelude traits
Alex Crichton [Tue, 8 Mar 2016 00:34:35 +0000 (16:34 -0800)]
core: Make a new tracking issue for prelude traits

The referenced issues here were both closed, so hook up a new issue which tracks
specifically the prelude traits being unstable.

8 years agocore: Mark Wrapping impls as stable
Alex Crichton [Tue, 8 Mar 2016 00:29:39 +0000 (16:29 -0800)]
core: Mark Wrapping impls as stable

These are all insta-stable anyway, so just properly tag them.

8 years agostd: Remove unstable from ReentrantMutex
Alex Crichton [Mon, 7 Mar 2016 23:02:43 +0000 (15:02 -0800)]
std: Remove unstable from ReentrantMutex

This isn't exported so it doesn't need a tag.

8 years agotest: Move some test outputs into $(TMPDIR)
Alex Crichton [Mon, 7 Mar 2016 22:39:37 +0000 (14:39 -0800)]
test: Move some test outputs into $(TMPDIR)

Don't want to pollute the source tree!

8 years agoalloc: Add unstable issue for FnBox APIs
Alex Crichton [Mon, 7 Mar 2016 22:38:36 +0000 (14:38 -0800)]
alloc: Add unstable issue for FnBox APIs

8 years agoAuto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis
bors [Sat, 12 Mar 2016 04:57:39 +0000 (20:57 -0800)]
Auto merge of #31925 - aturon:inherent-overlap, r=nikomatsakis

Forbid items with the same name from appearing in overlapping inherent impl blocks

For example, the following is now correctly illegal:

```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}
```

"Overlapping" here is determined the same way it is for traits (and in fact shares the same code path): roughly, there must be some way of substituting any generic types to unify the impls, such that none of the `where` clauses are provably unsatisfiable under such a unification.

Along the way, this PR also introduces an `ImplHeader` abstraction (the first commit) that makes it easier to work with impls abstractly (without caring whether they are trait or inherent impl blocks); see the first commit.

Closes #22889
r? @nikomatsakis

8 years agoFurther simplify Windows stdout/stderr
Oliver Middleton [Sat, 12 Mar 2016 04:18:17 +0000 (04:18 +0000)]
Further simplify Windows stdout/stderr

This makes it output as much valid UTF-8 as it can then return failure.

8 years agoRemoved integer suffixes in libsyntax crate
srinivasreddy [Thu, 10 Mar 2016 18:35:53 +0000 (00:05 +0530)]
Removed integer suffixes in libsyntax crate

8 years agoAuto merge of #32200 - Manishearth:rollup, r=Manishearth
bors [Sat, 12 Mar 2016 01:50:45 +0000 (17:50 -0800)]
Auto merge of #32200 - Manishearth:rollup, r=Manishearth

Rollup of 11 pull requests

- Successful merges: #32137, #32158, #32171, #32174, #32178, #32179, #32180, #32181, #32183, #32186, #32197
- Failed merges:

8 years agoRollup merge of #32197 - andoriyu:patch-1, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32197 - andoriyu:patch-1, r=alexcrichton

Add FreeBSD amd64 snapshot

Snapshot itself: https://github.com/dhuseby/rust-manual-snapshots/pull/3

8 years agoRollup merge of #32186 - srinivasreddy:libcoretest, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32186 - srinivasreddy:libcoretest, r=steveklabnik

cleanup int suffixes in libcoretest

8 years agoRollup merge of #32183 - bluss:doc-index, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32183 - bluss:doc-index, r=alexcrichton

Clarify doc for slice slicing (Index impls)

Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoRollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik

removed suffixes for librustc_front

8 years agoRollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik

removed integer suffixes in librustc_typeck crate

8 years agoComment `resolve_item_in_lexical_scope`
Jeffrey Seyfried [Fri, 11 Mar 2016 23:28:22 +0000 (23:28 +0000)]
Comment `resolve_item_in_lexical_scope`

8 years agoAuto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichton
bors [Fri, 11 Mar 2016 23:25:03 +0000 (15:25 -0800)]
Auto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichton

cover more linux targets in libstd cargobuild

libstd/build.rs checked the target name against `"unknown-linux"`... That doesn't necessarily apply to all Linux targets as some toolchains for embedded targets will change that `unknown` field to some vendor name. Some shifting around was needed since Android is also a Linux target.

r? @alexcrichton

8 years agoAdjust rustdoc test for new restriction
Aaron Turon [Fri, 11 Mar 2016 23:22:07 +0000 (15:22 -0800)]
Adjust rustdoc test for new restriction

8 years agoRollup merge of #32178 - naltun:patch-1, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32178 - naltun:patch-1, r=steveklabnik

Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoRollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik

Spell fixes for std::ffi doc comments

8 years agoRollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton

Fix a couple compiletest nits.

8 years agoRollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton

lint: mark associated types as live for the dead_code pass

Associated types of trait impls were being excluded from the live list. So types that only appeared in trait impls were being marked as dead code.

8 years agoRollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik

Add missing documentation examples for BinaryHeap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.

r? @steveklabnik

8 years agoAdjust tests to new error message
Aaron Turon [Wed, 9 Mar 2016 16:57:53 +0000 (08:57 -0800)]
Adjust tests to new error message

8 years agoAdd regression test for duplicate items in overlapping impls. Note that a regression...
Aaron Turon [Fri, 26 Feb 2016 22:01:16 +0000 (14:01 -0800)]
Add regression test for duplicate items in overlapping impls. Note that a regression test already exists for *non*overlapping impls.

8 years agoForbid items with the same name being defined in overlapping inherent
Aaron Turon [Fri, 26 Feb 2016 21:21:44 +0000 (13:21 -0800)]
Forbid items with the same name being defined in overlapping inherent
impl blocks.

For example, the following is now correctly illegal:

```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}
```

"Overlapping" here is determined the same way it is for traits (and in
fact shares the same code path): roughly, there must be some way of
substituting any generic types to unify the impls, such that none of the
`where` clauses are provably unsatisfiable under such a unification.

Closes #22889

8 years agoIntroduce `ImplHeader`
Aaron Turon [Fri, 26 Feb 2016 18:51:10 +0000 (10:51 -0800)]
Introduce `ImplHeader`

This commit introduces the idea of an "impl header", which consists of
everything outside the impl body: the Self type, the trait
reference (when applicable), and predicates from `where` clauses. This
type is usable with the type folding machinery, making it possible to
work with impl headers at a higher and more generic level.

8 years agoAdd FreeBSD amd64 snapshot
Andrey Cherkashin [Fri, 11 Mar 2016 18:12:42 +0000 (10:12 -0800)]
Add FreeBSD amd64 snapshot

Snapshot itself: https://github.com/dhuseby/rust-manual-snapshots/pull/3

8 years agoAuto merge of #32134 - jseyfried:forbid_type_alias_as_module, r=nikomatsakis
bors [Fri, 11 Mar 2016 17:26:47 +0000 (09:26 -0800)]
Auto merge of #32134 - jseyfried:forbid_type_alias_as_module, r=nikomatsakis

Forbid glob-importing from a type alias

This PR forbids glob-importing from a type alias or trait (fixes #30560):
```rust
type Alias = ();
use Alias::*; // This is currently allowed but shouldn't be
```

This is a [breaking-change]. Since the disallowed glob imports don't actually import anything, any breakage can be fixed by removing the offending glob import.

r? @alexcrichton

8 years agoAuto merge of #32133 - alexcrichton:linkchecker, r=brson
bors [Fri, 11 Mar 2016 12:38:04 +0000 (04:38 -0800)]
Auto merge of #32133 - alexcrichton:linkchecker, r=brson

Add a link validator to rustbuild

This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.

There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.

The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:

1. New steps are defined for building the tool and running the tool
2. The dependencies are configured
3. The steps are implemented

In terms of the link checker, these commits do a few things:

* A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).
* A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed.
* A few rustdoc bugs here and there were fixed

8 years agoundo changes to run-pass tests that aren't errors anymore
Oliver Schneider [Fri, 11 Mar 2016 08:44:11 +0000 (09:44 +0100)]
undo changes to run-pass tests that aren't errors anymore

8 years agoAuto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon
bors [Fri, 11 Mar 2016 06:47:49 +0000 (22:47 -0800)]
Auto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon

rustc: Add an i586-pc-windows-msvc target

Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202

8 years agoAuto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr
bors [Fri, 11 Mar 2016 04:37:04 +0000 (20:37 -0800)]
Auto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr

Add help for E0514

I fixed #30622.

r? @arielb1

8 years agocleanup int suffixes in libcoretest
srinivasreddy [Fri, 11 Mar 2016 03:06:36 +0000 (08:36 +0530)]
cleanup int suffixes in libcoretest

8 years agoAuto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon
bors [Fri, 11 Mar 2016 01:52:12 +0000 (17:52 -0800)]
Auto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon

std: Add impl of FnOnce to AssertRecoverSafe

This was originally intended, but forgot to land by accident!

cc #27719

8 years agoSimplify Windows stdout/stderr
Oliver Middleton [Thu, 10 Mar 2016 23:59:28 +0000 (23:59 +0000)]
Simplify Windows stdout/stderr

8 years agoAuto merge of #32117 - mitaa:patch-3, r=alexcrichton
bors [Thu, 10 Mar 2016 22:57:31 +0000 (14:57 -0800)]
Auto merge of #32117 - mitaa:patch-3, r=alexcrichton

rustdoc: correct src-link url

It would have been nice for htmldocck to catch this, especially since there are rustdoc tests specifically for checking src-links.

fixes #32113

8 years agoFixup stout/stderr on Windows
Oliver Middleton [Thu, 10 Mar 2016 19:09:02 +0000 (19:09 +0000)]
Fixup stout/stderr on Windows

WriteConsoleW can fail if called with a large buffer so we need to slice
any stdout/stderr output.
However the current slicing has a few problems:
 1. It slices by byte but still expects valid UTF-8.
 2. The slicing happens even when not outputting to a console.
 3. panic! output is not sliced.

This fixes these issues by moving the slice to right before
WriteConsoleW and slicing on a char boundary.

8 years agoClarify doc for slice slicing (Index impls)
Ulrik Sverdrup [Thu, 10 Mar 2016 20:36:43 +0000 (21:36 +0100)]
Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoremoved suffixes for librustc_front
srinivasreddy [Thu, 10 Mar 2016 20:02:03 +0000 (01:32 +0530)]
removed suffixes for librustc_front

8 years agoAuto merge of #32107 - Stebalien:partial-write, r=alexcrichton
bors [Thu, 10 Mar 2016 19:56:29 +0000 (11:56 -0800)]
Auto merge of #32107 - Stebalien:partial-write, r=alexcrichton

Never return an error after a partial write

If LineWriter fails to flush, return the number of bytes written instead
of an error.

Fixes #32085

8 years agoremoved integer constants in librustc_typeck
srinivasreddy [Thu, 10 Mar 2016 19:11:25 +0000 (00:41 +0530)]
removed integer constants in librustc_typeck

8 years agoUpdate getting-started.md
Noah [Thu, 10 Mar 2016 17:34:42 +0000 (11:34 -0600)]
Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoAuto merge of #32101 - SimonSapin:patch-11, r=alexcrichton
bors [Thu, 10 Mar 2016 15:05:05 +0000 (07:05 -0800)]
Auto merge of #32101 - SimonSapin:patch-11, r=alexcrichton

Add info in `rustdoc --passes list`

CC @mitaa, https://github.com/rust-lang/rust/pull/32055/files#r55205006