]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agohir, mir: Separate HIR expressions / MIR operands from InlineAsm.
Eduard Burtescu [Wed, 9 Mar 2016 20:17:02 +0000 (22:17 +0200)]
hir, mir: Separate HIR expressions / MIR operands from InlineAsm.

8 years agomir: Translate Rvalue::Slice without relying on tvec.
Eduard Burtescu [Wed, 9 Mar 2016 19:49:23 +0000 (21:49 +0200)]
mir: Translate Rvalue::Slice without relying on tvec.

8 years agomir: Get the right non-reference type for binding patterns.
Eduard Burtescu [Wed, 9 Mar 2016 21:32:52 +0000 (23:32 +0200)]
mir: Get the right non-reference type for binding patterns.

8 years agomir: Don't lose sub-patterns inside slice patterns.
Eduard Burtescu [Wed, 9 Mar 2016 12:21:31 +0000 (14:21 +0200)]
mir: Don't lose sub-patterns inside slice patterns.

8 years agomir: Match against slices by calling PartialEq::eq.
Eduard Burtescu [Wed, 9 Mar 2016 12:20:50 +0000 (14:20 +0200)]
mir: Match against slices by calling PartialEq::eq.

8 years agotrans: Make everything used from within at_start Builder-friendly.
Eduard Burtescu [Wed, 9 Mar 2016 12:20:22 +0000 (14:20 +0200)]
trans: Make everything used from within at_start Builder-friendly.

8 years agomir: Call set_operand_dropped in more places, specifically Unsize casts.
Eduard Burtescu [Tue, 8 Mar 2016 13:03:02 +0000 (15:03 +0200)]
mir: Call set_operand_dropped in more places, specifically Unsize casts.

8 years agomir: Translate intrinsics, via old trans where possible.
Eduard Burtescu [Tue, 8 Mar 2016 12:40:37 +0000 (14:40 +0200)]
mir: Translate intrinsics, via old trans where possible.

8 years agomir: Reintroduce the temporary block after invokes, to handle critical edges.
Eduard Burtescu [Tue, 8 Mar 2016 12:40:04 +0000 (14:40 +0200)]
mir: Reintroduce the temporary block after invokes, to handle critical edges.

8 years agomir: Trigger closure instantiations when the closure value is created.
Eduard Burtescu [Tue, 8 Mar 2016 12:38:44 +0000 (14:38 +0200)]
mir: Trigger closure instantiations when the closure value is created.

8 years agotrans: Load and cache cross-crate Mir instances in the shared context.
Eduard Burtescu [Tue, 8 Mar 2016 12:38:13 +0000 (14:38 +0200)]
trans: Load and cache cross-crate Mir instances in the shared context.

8 years agomir: Don't shadow the "args" variable in Call translation.
Eduard Burtescu [Tue, 8 Mar 2016 12:31:48 +0000 (14:31 +0200)]
mir: Don't shadow the "args" variable in Call translation.

8 years agomir: Truncate bool to i1 for SwitchInt.
Eduard Burtescu [Tue, 8 Mar 2016 12:31:23 +0000 (14:31 +0200)]
mir: Truncate bool to i1 for SwitchInt.

8 years agotrans: Take a &Builder in call_memcpy, like call_memset.
Eduard Burtescu [Tue, 8 Mar 2016 12:29:46 +0000 (14:29 +0200)]
trans: Take a &Builder in call_memcpy, like call_memset.

8 years agomir: Support RustCall ABI functions.
Eduard Burtescu [Tue, 8 Mar 2016 12:24:44 +0000 (14:24 +0200)]
mir: Support RustCall ABI functions.

8 years agomir: Load FatPtr constants instead of keeping them indirect.
Eduard Burtescu [Tue, 8 Mar 2016 12:23:23 +0000 (14:23 +0200)]
mir: Load FatPtr constants instead of keeping them indirect.

8 years agomir: Don't load the discriminant, it's already in immediate form.
Eduard Burtescu [Tue, 8 Mar 2016 12:21:11 +0000 (14:21 +0200)]
mir: Don't load the discriminant, it's already in immediate form.

8 years agomir: Don't use ConstVal when adjustments are involved, as they would be lost.
Eduard Burtescu [Tue, 8 Mar 2016 12:20:06 +0000 (14:20 +0200)]
mir: Don't use ConstVal when adjustments are involved, as they would be lost.

8 years agomir: Unsize ConstVal::ByteStr before comparing &[u8] against it.
Eduard Burtescu [Tue, 8 Mar 2016 12:17:35 +0000 (14:17 +0200)]
mir: Unsize ConstVal::ByteStr before comparing &[u8] against it.

8 years agomir: Ignore noop casts (e.g. when `as` used for coercion).
Eduard Burtescu [Tue, 8 Mar 2016 12:16:26 +0000 (14:16 +0200)]
mir: Ignore noop casts (e.g. when `as` used for coercion).

8 years agomir: Don't use ConstVal kinds that contain local NodeId's.
Eduard Burtescu [Tue, 8 Mar 2016 12:15:23 +0000 (14:15 +0200)]
mir: Don't use ConstVal kinds that contain local NodeId's.

8 years agomir: Use the right form of GEPi for indexing slices vs arrays.
Eduard Burtescu [Tue, 8 Mar 2016 12:13:56 +0000 (14:13 +0200)]
mir: Use the right form of GEPi for indexing slices vs arrays.

8 years agomir: Monomorphize LvalueTy's of projections.
Eduard Burtescu [Tue, 8 Mar 2016 12:11:45 +0000 (14:11 +0200)]
mir: Monomorphize LvalueTy's of projections.

8 years agotrans: Simplify "try" intrinsic.
Eduard Burtescu [Sun, 6 Mar 2016 12:29:31 +0000 (14:29 +0200)]
trans: Simplify "try" intrinsic.

8 years agotests: Use arguments in codegen/stores.rs to turn aggregates into immediates.
Eduard Burtescu [Sun, 6 Mar 2016 12:28:11 +0000 (14:28 +0200)]
tests: Use arguments in codegen/stores.rs to turn aggregates into immediates.

8 years agotrans: Remove the foreign module.
Eduard Burtescu [Sun, 6 Mar 2016 12:17:53 +0000 (14:17 +0200)]
trans: Remove the foreign module.

8 years agotrans: Handle all function setup for all ABIs via FnType.
Eduard Burtescu [Sun, 6 Mar 2016 14:30:21 +0000 (16:30 +0200)]
trans: Handle all function setup for all ABIs via FnType.

8 years agotrans: datum::lvalue_scratch_datum doesn't need a move-into-closure trick.
Eduard Burtescu [Sun, 6 Mar 2016 11:23:43 +0000 (13:23 +0200)]
trans: datum::lvalue_scratch_datum doesn't need a move-into-closure trick.

8 years agotrans: Handle calls for all ABIs through FnType.
Eduard Burtescu [Sun, 6 Mar 2016 11:23:20 +0000 (13:23 +0200)]
trans: Handle calls for all ABIs through FnType.

8 years agotrans: Provide the FnType for a direct call via Callee::direct_fn_type.
Eduard Burtescu [Sun, 6 Mar 2016 10:38:46 +0000 (12:38 +0200)]
trans: Provide the FnType for a direct call via Callee::direct_fn_type.

8 years agotrans: Handle ignored arguments/returns uniformly.
Eduard Burtescu [Sun, 6 Mar 2016 10:36:39 +0000 (12:36 +0200)]
trans: Handle ignored arguments/returns uniformly.

8 years agotrans: Set the calling convention in apply_attrs_callsite.
Eduard Burtescu [Sun, 6 Mar 2016 10:34:31 +0000 (12:34 +0200)]
trans: Set the calling convention in apply_attrs_callsite.

8 years agotrans: Apply all attributes through FnType.
Eduard Burtescu [Thu, 25 Feb 2016 23:10:40 +0000 (01:10 +0200)]
trans: Apply all attributes through FnType.

8 years agotrans: Use llvm::Attributes directly in ArgTy.
Eduard Burtescu [Thu, 25 Feb 2016 17:35:40 +0000 (19:35 +0200)]
trans: Use llvm::Attributes directly in ArgTy.

8 years agorustc_llvm: An AttrBuilder that's not completely wasteful.
Eduard Burtescu [Thu, 25 Feb 2016 17:08:10 +0000 (19:08 +0200)]
rustc_llvm: An AttrBuilder that's not completely wasteful.

8 years agorustc_llvm: Update the Attribute bitflags and remove OtherAttribute.
Eduard Burtescu [Thu, 25 Feb 2016 13:35:56 +0000 (15:35 +0200)]
rustc_llvm: Update the Attribute bitflags and remove OtherAttribute.

8 years agotrans: use sizing_type_of for interacting with potentially incomplete types.
Eduard Burtescu [Thu, 25 Feb 2016 13:35:47 +0000 (15:35 +0200)]
trans: use sizing_type_of for interacting with potentially incomplete types.

8 years agotrans: Apply ZExt and StructRet attributes uniformly.
Eduard Burtescu [Thu, 25 Feb 2016 10:11:02 +0000 (12:11 +0200)]
trans: Apply ZExt and StructRet attributes uniformly.

8 years agotrans: Only mutate ArgTy's in C ABI handling, don't create them.
Eduard Burtescu [Thu, 25 Feb 2016 08:49:58 +0000 (10:49 +0200)]
trans: Only mutate ArgTy's in C ABI handling, don't create them.

8 years agotrans: Handle type_of for Rust fn's via abi::FnType.
Eduard Burtescu [Wed, 24 Feb 2016 17:37:22 +0000 (19:37 +0200)]
trans: Handle type_of for Rust fn's via abi::FnType.

8 years agotrans: Remove dropflag-unaware type_is_newtype_immediate shortcut.
Eduard Burtescu [Wed, 24 Feb 2016 17:00:54 +0000 (19:00 +0200)]
trans: Remove dropflag-unaware type_is_newtype_immediate shortcut.

8 years agotests: Force instantiation of extern fns.
Eduard Burtescu [Wed, 24 Feb 2016 09:42:16 +0000 (11:42 +0200)]
tests: Force instantiation of extern fns.

8 years agotrans: Pass fat pointers as two arguments even for FFI.
Eduard Burtescu [Wed, 24 Feb 2016 09:09:25 +0000 (11:09 +0200)]
trans: Pass fat pointers as two arguments even for FFI.

8 years agotrans: Don't treat closure types like function types in declare.
Eduard Burtescu [Tue, 23 Feb 2016 23:16:27 +0000 (01:16 +0200)]
trans: Don't treat closure types like function types in declare.

8 years agotrans: Combine cabi and back::abi into abi.
Eduard Burtescu [Tue, 23 Feb 2016 20:43:04 +0000 (22:43 +0200)]
trans: Combine cabi and back::abi into abi.

8 years agotrans: Condense the fn instantiation logic into callee.
Eduard Burtescu [Tue, 23 Feb 2016 20:04:51 +0000 (22:04 +0200)]
trans: Condense the fn instantiation logic into callee.

8 years agotrans: Rename MonoId to Instance and start using it in more places.
Eduard Burtescu [Tue, 23 Feb 2016 20:04:27 +0000 (22:04 +0200)]
trans: Rename MonoId to Instance and start using it in more places.

8 years agotrans: Don't store extra copies of intrinsics ID/substs.
Eduard Burtescu [Tue, 23 Feb 2016 20:00:59 +0000 (22:00 +0200)]
trans: Don't store extra copies of intrinsics ID/substs.

8 years agotrans: use Cell instead of RefCell where it suffices.
Eduard Burtescu [Tue, 23 Feb 2016 19:59:23 +0000 (21:59 +0200)]
trans: use Cell instead of RefCell where it suffices.

8 years agotrans: simplify the declare interface.
Eduard Burtescu [Tue, 23 Feb 2016 19:57:22 +0000 (21:57 +0200)]
trans: simplify the declare interface.

8 years agotrans: Revamp and empower cabi::FnType.
Eduard Burtescu [Tue, 23 Feb 2016 19:55:19 +0000 (21:55 +0200)]
trans: Revamp and empower cabi::FnType.

8 years agotrans: Pass the Rust type for the closure env in type_of_rust_fn.
Eduard Burtescu [Tue, 23 Feb 2016 19:49:35 +0000 (21:49 +0200)]
trans: Pass the Rust type for the closure env in type_of_rust_fn.

8 years agotrans: Remove the old ExprOrMethodCall.
Eduard Burtescu [Tue, 23 Feb 2016 19:48:33 +0000 (21:48 +0200)]
trans: Remove the old ExprOrMethodCall.

8 years agotrans: Remove unused return type argument from declare_cfn.
Eduard Burtescu [Tue, 23 Feb 2016 19:46:08 +0000 (21:46 +0200)]
trans: Remove unused return type argument from declare_cfn.

8 years agotrans: Move static item handling to consts.
Eduard Burtescu [Tue, 23 Feb 2016 19:39:35 +0000 (21:39 +0200)]
trans: Move static item handling to consts.

8 years agotrans: Remove dead code for variants and structs from get_item_val.
Eduard Burtescu [Tue, 23 Feb 2016 19:34:48 +0000 (21:34 +0200)]
trans: Remove dead code for variants and structs from get_item_val.

8 years agotrans: Move trans_foreign_mod and trans_impl to trans_item.
Eduard Burtescu [Tue, 23 Feb 2016 19:32:44 +0000 (21:32 +0200)]
trans: Move trans_foreign_mod and trans_impl to trans_item.

8 years agotrans: Get functions and do calls only through Callee.
Eduard Burtescu [Tue, 23 Feb 2016 19:21:50 +0000 (21:21 +0200)]
trans: Get functions and do calls only through Callee.

8 years agometadata: Constrain FoundAst::FoundParent to an Item.
Eduard Burtescu [Tue, 23 Feb 2016 19:10:29 +0000 (21:10 +0200)]
metadata: Constrain FoundAst::FoundParent to an Item.

8 years agometedata: Remove the unnecessary indirection to astencode.
Eduard Burtescu [Tue, 23 Feb 2016 19:08:12 +0000 (21:08 +0200)]
metedata: Remove the unnecessary indirection to astencode.

8 years agoMove simd_ffi gating from trans to typeck.
Eduard Burtescu [Tue, 23 Feb 2016 19:06:32 +0000 (21:06 +0200)]
Move simd_ffi gating from trans to typeck.

8 years agotrans: Use fmt::Debug for debugging instead of ad-hoc methods.
Eduard Burtescu [Thu, 18 Feb 2016 17:49:45 +0000 (19:49 +0200)]
trans: Use fmt::Debug for debugging instead of ad-hoc methods.

8 years agoAuto merge of #32237 - alexcrichton:rustbuild-make-dist, r=brson
bors [Thu, 17 Mar 2016 09:35:32 +0000 (02:35 -0700)]
Auto merge of #32237 - alexcrichton:rustbuild-make-dist, r=brson

rustbuild: Implement `make dist`

This commit implements the `make dist` command in the new rustbuild build
system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount
of complexity between those two files, not all of which is likely justified, so
the Rust implementation is *much* smaller.

Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.

8 years agoAuto merge of #32285 - oli-obk:fix/const_bitshift, r=eddyb
bors [Thu, 17 Mar 2016 02:44:30 +0000 (19:44 -0700)]
Auto merge of #32285 - oli-obk:fix/const_bitshift, r=eddyb

const eval: don't assume the rhs of a bitshift is of any particular type

[regression found](https://internals.rust-lang.org/t/regression-report-stable-2016-03-03-vs-nightly-2016-03-15/3250) in jpeg-decoder

8 years agorustbuild: Implement `make dist`
Alex Crichton [Sun, 13 Mar 2016 23:52:19 +0000 (16:52 -0700)]
rustbuild: Implement `make dist`

This commit implements the `make dist` command in the new rustbuild build
system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount
of complexity between those two files, not all of which is likely justified, so
the Rust implementation is *much* smaller.

Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.

8 years agoAuto merge of #32284 - jseyfried:name_conflict_diagnostics, r=eddyb
bors [Wed, 16 Mar 2016 23:18:12 +0000 (16:18 -0700)]
Auto merge of #32284 - jseyfried:name_conflict_diagnostics, r=eddyb

Resolve: improve diagnostics for duplicate definitions and imports

This PR improves and regularizes the diagnostics for duplicate definitions and imports.

After this PR, the second of two duplicate definitions/imports will have the following form:
> a(n) [value|type|module|trait|extern crate] named \`*name*\` has already been [defined|imported] in this [module|block|trait|enum]

with a note referencing this first of the two duplicate definitions/imports:
> previous [definition|import] of \`*name*\` here

The error indices remain unchanged.

r? @eddyb

8 years agoAuto merge of #31746 - erickt:newline, r=sfackler
bors [Wed, 16 Mar 2016 21:20:36 +0000 (14:20 -0700)]
Auto merge of #31746 - erickt:newline, r=sfackler

syntax: Always pretty print a newline after doc comments

Before this patch, code that had a doc comment as the first
line, as in:

```rust
/// Foo
struct Foo;
```

Was pretty printed into:

```rust
///Foostruct Foo;
```

This makes sure that that there is always a trailing newline
after a doc comment.

Closes #31722

8 years agoAuto merge of #32228 - jonas-schievink:diag1, r=sanxiyn
bors [Wed, 16 Mar 2016 15:02:15 +0000 (08:02 -0700)]
Auto merge of #32228 - jonas-schievink:diag1, r=sanxiyn

Normalize return type when checking for E0269

Fixes #31597

First time dealing with normalization. Maybe `normalize_associated_type` would be better here, but it seems to imply it's only used during trans.

8 years agoAuto merge of #32280 - japaric:rt, r=alexcrichton
bors [Wed, 16 Mar 2016 12:26:06 +0000 (05:26 -0700)]
Auto merge of #32280 - japaric:rt, r=alexcrichton

update compiler-rt submodule

fixes #32194

also see rust-lang/compiler-rt#17

r? @alexcrichton

8 years agoResolve conflicts and extend the test
Jonas Schievink [Wed, 16 Mar 2016 12:22:35 +0000 (13:22 +0100)]
Resolve conflicts and extend the test

8 years agoUse `fully_normalize`, unwrapping its result
Jonas Schievink [Sun, 13 Mar 2016 13:42:13 +0000 (14:42 +0100)]
Use `fully_normalize`, unwrapping its result

8 years agoNormalize return type when checking for E0269
Jonas Schievink [Sun, 13 Mar 2016 11:11:16 +0000 (12:11 +0100)]
Normalize return type when checking for E0269

Fixes #31597

8 years agoAuto merge of #32273 - alexcrichton:fix-time-sub, r=aturon
bors [Wed, 16 Mar 2016 09:58:35 +0000 (02:58 -0700)]
Auto merge of #32273 - alexcrichton:fix-time-sub, r=aturon

std: Fix overflow when subtracting Instant

This code was currently only exercised on OSX, but this applies the same method
of subtraction used on Linux which doesn't have the same overflow issues.

Note that this currently includes no tests, but that's because this is only
visible with debug assertions enabled. Soon, however, I'll enable debug
assertions on all auto builds on the bots so we should get testing for this.

Closes #32268

8 years agodon't assume the rhs of a bitshift is of any particular type
Oliver Schneider [Wed, 16 Mar 2016 09:54:00 +0000 (10:54 +0100)]
don't assume the rhs of a bitshift is of any particular type

8 years agoFix fallout in tests
Jeffrey Seyfried [Wed, 16 Mar 2016 06:06:25 +0000 (06:06 +0000)]
Fix fallout in tests

8 years agoImprove diagnostics for duplicate names
Jeffrey Seyfried [Wed, 16 Mar 2016 05:20:58 +0000 (05:20 +0000)]
Improve diagnostics for duplicate names

8 years agoAuto merge of #32266 - alexcrichton:fix-mingw-rustbuild-again, r=brson
bors [Wed, 16 Mar 2016 06:49:06 +0000 (23:49 -0700)]
Auto merge of #32266 - alexcrichton:fix-mingw-rustbuild-again, r=brson

rustbuild: Fix LLVM compile on MinGW

The LLVM change [1] in #32239 unfortunately broke the LLVM build on MinGW, so
this LLVM submodule update brings in one more fix [2] which should hopefully
remedy that.

Once this lands we should be able to immediately start gating on this to prevent
it from happening again.

[1]: https://github.com/rust-lang/llvm/commit/be89e4b5
[2]: https://github.com/rust-lang/llvm/commit/3dcd2c84

8 years agoupdate compiler-rt submodule
Jorge Aparicio [Wed, 16 Mar 2016 03:32:38 +0000 (22:32 -0500)]
update compiler-rt submodule

fixes #32194

8 years agoAuto merge of #32236 - alexcrichton:better-compile-intrinsics, r=arielb1
bors [Wed, 16 Mar 2016 02:41:01 +0000 (19:41 -0700)]
Auto merge of #32236 - alexcrichton:better-compile-intrinsics, r=arielb1

rustc: Improve compile time of platform intrinsics

This commit improves the compile time of `rustc_platform_intrinsics` from 23s to
3.6s if compiling with `-O` and from 77s to 17s if compiling with `-O -g`. The
compiled rlib size also drops from 3.1M to 1.2M.

The wins here were gained by removing the destructors associated with `Type` by
removing the internal `Box` and `Vec` indirections. These destructors meant that
a lot of landing pads and extra code were generated to manage the runtime
representations. Instead everything can basically be statically computed and
shoved into rodata, so all we need is a giant string compare to lookup what's
what.

Closes #28273

8 years agorustc: Improve compile time of platform intrinsics
Alex Crichton [Sun, 13 Mar 2016 22:01:37 +0000 (15:01 -0700)]
rustc: Improve compile time of platform intrinsics

This commit improves the compile time of `rustc_platform_intrinsics` from 23s to
3.6s if compiling with `-O` and from 77s to 17s if compiling with `-O -g`. The
compiled rlib size also drops from 3.1M to 1.2M.

The wins here were gained by removing the destructors associated with `Type` by
removing the internal `Box` and `Vec` indirections. These destructors meant that
a lot of landing pads and extra code were generated to manage the runtime
representations. Instead everything can basically be statically computed and
shoved into rodata, so all we need is a giant string compare to lookup what's
what.

Closes #28273

8 years agostd: Fix overflow when subtracting Instant
Alex Crichton [Tue, 15 Mar 2016 22:19:11 +0000 (15:19 -0700)]
std: Fix overflow when subtracting Instant

This code was currently only exercised on OSX, but this applies the same method
of subtraction used on Linux which doesn't have the same overflow issues.

Note that this currently includes no tests, but that's because this is only
visible with debug assertions enabled. Soon, however, I'll enable debug
assertions on all auto builds on the bots so we should get testing for this.

Closes #32268

8 years agoAuto merge of #31838 - aochagavia:trans, r=nrc
bors [Tue, 15 Mar 2016 22:03:00 +0000 (15:03 -0700)]
Auto merge of #31838 - aochagavia:trans, r=nrc

Refactor rustc_trans::save to allow other backends than CSV

r? @nrc

Things done:
* Moved `(.*)Data` structs to an own module, so they can be imported easily (`use data::*`).
* Created a `Dump` trait with callbacks for dumping items.
* Refactored `DumpCsvVisitor` to use an implementor of `Dump` instead of dumping as CSV. Renamed it to `DumpVisitor`.
* Created a `DumpCsv` struct that implements `Dump` and serializes items as CSV.

I tried to extract some of the logic contained in `FmtStr` and `Recorder`, such as normalization of ids (I put it in `DumpVisitor`). I think it makes sense to provide the same information to other implementors of `Dump`, instead of normalizing only for `DumpCsv`. However, there is still some logic related to spans implemented only for `DumpCsv`. I just thought it would be better to merge this as soon as possible, since there are so much changes, and fix this afterwards.

8 years agoRefactor rustc_trans::save
Adolfo OchagavĂ­a [Mon, 29 Feb 2016 10:51:05 +0000 (11:51 +0100)]
Refactor rustc_trans::save

Move rustc_trans::*Data to own module
Add new data to rustc_trans::save
Create a Dump trait implemented by structs that dump save analysis data
Split dump_csv into a DumpVisitor and a CsvDumper

8 years agorustbuild: Fix LLVM compile on MinGW
Alex Crichton [Tue, 15 Mar 2016 17:06:48 +0000 (10:06 -0700)]
rustbuild: Fix LLVM compile on MinGW

The LLVM change [1] in #32239 unfortunately broke the LLVM build on MinGW, so
this LLVM submodule update brings in one more fix [2] which should hopefully
remedy that.

Once this lands we should be able to immediately start gating on this to prevent
it from happening again.

[1]: https://github.com/rust-lang/llvm/commit/be89e4b5
[2]: https://github.com/rust-lang/llvm/commit/3dcd2c84

8 years agoAuto merge of #31887 - SimonSapin:quiet-test, r=alexcrichton
bors [Tue, 15 Mar 2016 19:58:49 +0000 (12:58 -0700)]
Auto merge of #31887 - SimonSapin:quiet-test, r=alexcrichton

Shorter output for `rustc --test` binaries.

Until now, a program created with `rustc --test` prints at least one line per test. This can be very verbose, especially with [data-driven tests](https://internals.rust-lang.org/t/test-and-external-test-harnesses/3145) when hundreds or thousands of tests is not rare.

This changes the default output to one character per test (except metrics and benchmarks results which have additional data to show):

```
     Running target/debug/wpt-75c594dc1e6e6187

running 314 tests
..............................................................................
..............................................................................
..............................................................................
..............................................................................
..
test result: ok. 314 passed; 0 failed; 0 ignored; 0 measured
```

<s>The previous behavior is available by passing `--verbose` to the test program. Maybe `cargo test --verbose` could be changed to do that?</s> **Edit:** the default is now unchanged, `-q` or `--quiet` enables the new output.

8 years agoAdd a test for --quiet in test harness.
Simon Sapin [Tue, 15 Mar 2016 16:56:52 +0000 (17:56 +0100)]
Add a test for --quiet in test harness.

8 years agoShorter output for `rustc --test` binaries.
Simon Sapin [Thu, 25 Feb 2016 15:14:05 +0000 (16:14 +0100)]
Shorter output for `rustc --test` binaries.

A program created with `rustc --test` prints at least one line per test.
This can be very verbose, especially with [data-driven tests](
https://internals.rust-lang.org/t/test-and-external-test-harnesses/3145)
when hundreds or thousands of tests is not rare.

This adds a `-q` or `--quiet` option that changes the output
to one character instead of one line per test
(except metrics and benchmarks results which have additional data to
show):

```
     Running target/debug/wpt-75c594dc1e6e6187

running 314 tests
..............................................................................
..............................................................................
..............................................................................
..............................................................................
..
test result: ok. 314 passed; 0 failed; 0 ignored; 0 measured
```

This is a breaking change since the `test::TestOpts` struct
now has one more field.

8 years agoAuto merge of #32251 - durka:derive-2810, r=alexcrichton
bors [Tue, 15 Mar 2016 16:45:57 +0000 (09:45 -0700)]
Auto merge of #32251 - durka:derive-2810, r=alexcrichton

derive: clean up hygiene

derive: clean up hygiene

Fixes #2810.

Spawned from #32139.

r? @alexcrichton

8 years agoAuto merge of #32250 - durka:derive-31574, r=alexcrichton
bors [Tue, 15 Mar 2016 13:51:30 +0000 (06:51 -0700)]
Auto merge of #32250 - durka:derive-31574, r=alexcrichton

derive: use intrinsics::unreachable over unreachable!()

derive: use intrinsics::unreachable over unreachable!()

Fixes #31574.

Spawned from #32139.

r? @alexcrichton

8 years agoAuto merge of #32239 - alexcrichton:fix-cross-to-freebsd, r=brson
bors [Tue, 15 Mar 2016 10:21:40 +0000 (03:21 -0700)]
Auto merge of #32239 - alexcrichton:fix-cross-to-freebsd, r=brson

rustbuild: Fix cross compiling to FreeBSD

This commit fixes our support for cross compiling a compiler to run on FreeBSD.
Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1]
which I hope to soon use to start producing FreeBSD nightly compilers. With the
`make dist` support added in #32237 we should be able to produce standard
rustc/rust-std packages for FreeBSD through a new slave with this cross compiler.

Currently, however, we don't "Just Work" when cross compiling FreeBSD and a
number of changes were required (part of this PR). They include:

* A few build fixes were needed in LLVM. Our own branch has been rebased on the
  actual 3.8 release and I applied one extra commit [2] which contains two fixes:

  1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many
     platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately
     this doesn't take into account when we're cross compiling, and as predicted
     the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To
     fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which
     is what we're compiling for which fixes the problem.
  2. The `PATH_MAX` constant is apparently defined in a different location than
     many other Unix systems, so a file which required this just needed some
     help to keep compiling.

* Support for compiling compiler-rt with CMake has been added to rustbuild. It
  looks like it just emulates Linux in what it compiles as it didn't seem to
  naturally produce anything else... At least the architecture is right, so
  seems good for now at least!

[1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile
[2]: https://github.com/rust-lang/llvm/commit/be89e4b5
[3]: https://bugs.webkit.org/show_bug.cgi?id=138420

8 years agoAuto merge of #32238 - frewsxcv:compiletest, r=alexcrichton
bors [Tue, 15 Mar 2016 07:10:29 +0000 (00:10 -0700)]
Auto merge of #32238 - frewsxcv:compiletest, r=alexcrichton

Utilize `Option::cloned` over explicit `clone` usage.

8 years agoAuto merge of #32206 - alexcrichton:fix-windows-rustbuild, r=brson
bors [Tue, 15 Mar 2016 04:09:37 +0000 (21:09 -0700)]
Auto merge of #32206 - alexcrichton:fix-windows-rustbuild, r=brson

Fix Windows rustbuild

These commits fix the rustbuild Windows bots, namely:

* The 32-bit build of LLVM was failing because libraries weren't being linked. This was in turn caused by the build script for `rustc_llvm` erroneously detecting that it was cross compiling when it actually wasn't.
* Tools of the build were compiled against the wrong libraries, so running them would fail on Windows as rpath didn't exist and `PATH` was wrong.
* Some linkchecker fixes for Windows paths had to be applied as well.

8 years agoAuto merge of #30652 - aturon:specialization, r=nikomatsakis
bors [Tue, 15 Mar 2016 00:55:41 +0000 (17:55 -0700)]
Auto merge of #30652 - aturon:specialization, r=nikomatsakis

Implement RFC 1210: impl specialization

This PR implements [impl specialization](https://github.com/rust-lang/rfcs/pull/1210),
carefully following the proposal laid out in the RFC.

The implementation covers the bulk of the RFC. The remaining gaps I know of are:

- no checking for lifetime-dependent specialization (a soundness hole);
- no `default impl` yet;
- no support for `default` with associated consts;

I plan to cover these gaps in follow-up PRs, as per @nikomatsakis's preference.

The basic strategy is to build up a *specialization graph* during
coherence checking. Insertion into the graph locates the right place
to put an impl in the specialization hierarchy; if there is no right
place (due to partial overlap but no containment), you get an overlap
error. Specialization is consulted when selecting an impl (of course),
and the graph is consulted when propagating defaults down the
specialization hierarchy.

You might expect that the specialization graph would be used during
selection -- i.e., when actually performing specialization. This is
not done for two reasons:

- It's merely an optimization: given a set of candidates that apply,
  we can determine the most specialized one by comparing them directly
  for specialization, rather than consulting the graph. Given that we
  also cache the results of selection, the benefit of this
  optimization is questionable.

- To build the specialization graph in the first place, we need to use
  selection (because we need to determine whether one impl specializes
  another). Dealing with this reentrancy would require some additional
  mode switch for selection. Given that there seems to be no strong
  reason to use the graph anyway, we stick with a simpler approach in
  selection, and use the graph only for propagating default
  implementations.

Trait impl selection can succeed even when multiple impls can apply,
as long as they are part of the same specialization family. In that
case, it returns a *single* impl on success -- this is the most
specialized impl *known* to apply. However, if there are any inference
variables in play, the returned impl may not be the actual impl we
will use at trans time. Thus, we take special care to avoid projecting
associated types unless either (1) the associated type does not use
`default` and thus cannot be overridden or (2) all input types are
known concretely.

r? @nikomatsakis

8 years agorustbuild: Fix cross compiling to FreeBSD
Alex Crichton [Mon, 14 Mar 2016 05:20:51 +0000 (22:20 -0700)]
rustbuild: Fix cross compiling to FreeBSD

This commit fixes our support for cross compiling a compiler to run on FreeBSD.
Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1]
which I hope to soon use to start producing FreeBSD nightly compilers. With the
`make dist` support added in #32237 we should be able to produce standard
rustc/rust-std packages for FreeBSD through a new slave with this cross compiler.

Currently, however, we don't "Just Work" when cross compiling FreeBSD and a
number of changes were required (part of this PR). They include:

* A few build fixes were needed in LLVM. Our own branch has been rebased on the
  actual 3.8 release and I applied one extra commit [2] which contains two fixes:

  1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many
     platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately
     this doesn't take into account when we're cross compiling, and as predicted
     the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To
     fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which
     is what we're compiling for which fixes the problem.
  2. The `PATH_MAX` constant is apparently defined in a different location than
     many other Unix systems, so a file which required this just needed some
     help to keep compiling.

* Support for compiling compiler-rt with CMake has been added to rustbuild. It
  looks like it just emulates Linux in what it compiles as it didn't seem to
  naturally produce anything else... At least the architecture is right, so
  seems good for now at least!

[1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile
[2]: https://github.com/rust-lang/llvm/commit/be89e4b5
[3]: https://bugs.webkit.org/show_bug.cgi?id=138420

8 years agoAdd pretty printer output for `default`
Aaron Turon [Mon, 14 Mar 2016 05:55:26 +0000 (22:55 -0700)]
Add pretty printer output for `default`

8 years agoAdjust error code
Aaron Turon [Sun, 13 Mar 2016 21:18:45 +0000 (14:18 -0700)]
Adjust error code

8 years agoParse fail test fixes
Aaron Turon [Sun, 13 Mar 2016 20:30:44 +0000 (13:30 -0700)]
Parse fail test fixes

8 years agoFixes after rebase
Aaron Turon [Fri, 11 Mar 2016 23:51:35 +0000 (15:51 -0800)]
Fixes after rebase

8 years agoIntroduce ICE when the topmost projection restriction kicks in, as per issue #32205
Aaron Turon [Fri, 11 Mar 2016 22:47:29 +0000 (14:47 -0800)]
Introduce ICE when the topmost projection restriction kicks in, as per issue #32205

8 years agoTest fixes, added README for tests
Aaron Turon [Fri, 11 Mar 2016 20:15:28 +0000 (12:15 -0800)]
Test fixes, added README for tests