Commit graph

1641 commits

Author SHA1 Message Date
Alex Crichton
3d6340ffe2 rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 10:18:36 -07:00
Felix S. Klock II
782c0cf4a2 Add rustbuild dependency from rustc_borrowck upon rustc_mir crate. 2016-03-22 18:09:57 +01:00
Alex Crichton
6cc06b36c4 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.
2016-03-16 17:15:55 -07:00
Alex Crichton
8cd1c17d90 rustbuild: Refactor stage arguments away
The facet of a stage is rarely relevant when running a tool or building
something, it's all a question of what stage the *compiler* is built in. We've
already got a nice handy `Compiler` structure to carry this information, so
let's use it!

This refactors the signature of the `Build::cargo` function two ways:

1. The `stage` argument is removed, this was just duplicated with the `compiler`
   argument's stage field.
2. The `target` argument is now required. This was a bug where if the `--target`
   flag isn't passed then the snapshot stage0 compiler is always used, so we
   won't pick up any changes.

Much of the other changes in this commit are just propagating these decisions
outwards. For example many of the `Step` variants no longer have a stage
argument as they're baked into the compiler.
2016-03-14 14:56:49 -07:00
Alex Crichton
16fefc5ead rustbuild: Fix stage1 rustdoc
Just always build stage1 rustdoc, it's really not that much more to build as
it's essentially just one library.
2016-03-08 13:44:14 -08:00
Alex Crichton
ee6df13f0c rustbuild: Move rustbook to a src/tools directory
We've actually got quite a few tools that are compiled as part of our build,
let's start housing them all in a `tools` directory.
2016-03-08 11:52:09 -08:00
Alex Crichton
52ec682776 rustbuild: Sync changes to Cargo.lock 2016-02-28 10:50:13 -08:00
Alex Crichton
95761417c3 rustbuild: Sync some Cargo.toml/lib.rs dependencies
The standard library doesn't depend on rustc_bitflags, so move it to explicit
dependencies on all other crates. Additionally, the arena/fmt_macros deps could
be dropped from libsyntax.
2016-02-21 09:49:13 -08:00
Alex Crichton
2581b14147 bootstrap: Add a bunch of Cargo.toml files
These describe the structure of all our crate dependencies.
2016-02-11 11:12:32 -08:00
Alex Crichton
046e6874c4 Add a Cargo-based build system
This commit is the start of a series of commits which start to replace the
makefiles with a Cargo-based build system. The aim is not to remove the
makefiles entirely just yet but rather just replace the portions that invoke the
compiler to do the bootstrap. This commit specifically adds enough support to
perform the bootstrap (and all the cross compilation within) along with
generating documentation.

More commits will follow up in this series to actually wire up the makefiles to
call this build system, so stay tuned!
2016-02-11 10:42:28 -08:00
Brian Anderson
69a8b4d8e2 Rename src/rustc to src/librustc. Use the driver crate 2012-11-07 13:53:39 -08:00
Patrick Walton
f72ef31ede rustc: Long lines 2012-11-07 13:48:09 -08:00
Patrick Walton
2904095570 rustc: Implement the Drop trait. r=brson 2012-11-07 12:34:32 -08:00
Graydon Hoare
92e3a8c17e rustc: reuse const vals, translate fn paths as consts. Close #2530. 2012-11-06 17:13:52 -08:00
Niko Matsakis
b0ed151539 Cleanup how we handle proto in types, remove unsound subtyping
Fixes #1896 which was never truly fixed, just masked.
The given tests would have failed had they used `~fn()` and
not `@fn()`.  They now result in compilation errors.

Fixes #2978.

Necessary first step for #2202, #2263.
2012-11-06 08:56:29 -08:00
Brian Anderson
bc3f89e92b rustc: Stop declaring unused upcalls 2012-11-05 15:22:35 -08:00
Patrick Walton
449f4fbb07 rustc: Implement deriving involving generic bounded traits. r=brson 2012-11-05 13:38:45 -08:00
Patrick Walton
be93b29d30 rustc: Implement parsing and typechecking for "once fn" 2012-11-05 13:17:02 -08:00
Patrick Walton
b90d7d4c81 rustc: Refactor vtable lookup to use a vtable context, so that it can be called outside a function. rs=refactor 2012-11-02 17:59:15 -07:00
Patrick Walton
9e0c596141 rustc: Eliminate the necessity of having an expr in order to call lookup_vtables(). rs=#rust
Automatically-generated derived methods don't have exprs and need to call this function.
2012-11-02 17:11:57 -07:00
Patrick Walton
0c2e6fda73 rustc: Implement ~Trait. r=nmatsakis 2012-11-02 10:15:19 -07:00
Patrick Walton
65d4dbeb12 rustc: Implement dereference via unary '*' for structs. r=nmatsakis 2012-11-02 09:56:35 -07:00
Patrick Walton
4165edff22 rustc: Implement translation of pattern matching for tuple structs and unit-like structs. r=nmatsakis 2012-11-02 09:56:28 -07:00
Patrick Walton
106f9976ab rustc: Implement typechecking, exhaustiveness checking, and borrow checking for pattern matching of tuple structs. r=nmatsakis
Conflicts:

	src/rustc/middle/typeck/check/alt.rs
2012-11-02 09:56:09 -07:00
Brian Anderson
b92c1197b6 Long lines 2012-11-01 16:39:32 -07:00
Brian Anderson
3edccc311e Support #[cfg] on methods 2012-11-01 15:48:50 -07:00
Patrick Walton
abab49b7cf rustc: Fix tab characters 2012-11-01 15:13:43 -07:00
Patrick Walton
94f05c1936 rustc: Stop overwriting trait static method types when checking generic trait refs. Closes #3903. rs=blocking-burg 2012-11-01 15:10:41 -07:00
Brian Anderson
45d04f5704 rustc: Swap argument order in drop_and_cancel_clean 2012-10-31 16:11:27 -07:00
Brian Anderson
740763fdef Merge remote-tracking branch 'vertexclique/incoming' 2012-10-31 16:11:23 -07:00
Mahmut Bulut
add4127192 change function and place in expr.rs 2012-11-01 00:49:37 +02:00
Brian Anderson
cb4de738cf Fix checking of duplicate and missing struct field initializers. Closes #3486. Closes #3892 2012-10-31 13:56:41 -07:00
Tim Chevalier
62f98c8ff8 Preserve parenthesization in the AST
Maintain explicit "paren" nodes in the AST so we can pretty-print
without having to guess where parens should go. We may revisit this
in the future.

r=graydon
2012-10-30 15:05:32 -07:00
Mahmut Bulut
bf792b922c * dropnzero_val fn added
* zero-mem for not needed drop situation placed in Ignore
2012-10-30 23:37:09 +02:00
Patrick Walton
a3b83c6224 rustc: Translate "deriving" for monomorphic intra-crate enums. r=brson 2012-10-30 11:40:44 -07:00
Patrick Walton
675c272dad rustc: Instantiate trait refs for automatically-derived implementations. Should fix check-fast. rs=bustage 2012-10-30 11:21:01 -07:00
Patrick Walton
a369a7881f rustc: Implement typechecking for automatically-derived enums 2012-10-29 14:11:56 -07:00
Patrick Walton
17a875b08a Merge pull request #3871 from pcwalton/master
rustc: Translate monomorphic intra-crate automatically-derived method…
2012-10-29 10:37:22 -07:00
Tim Chevalier
64193a9eb8 Remove unnecessary suffixes 2012-10-27 17:16:26 -07:00
Niko Matsakis
2093952847 Partial fix for #2687---impl method must only be subtype of trait method, not exact match. 2012-10-26 19:41:17 -07:00
Patrick Walton
d5a27a0e0c rustc: Translate monomorphic intra-crate automatically-derived methods that follow the "eq" format 2012-10-26 18:23:45 -07:00
Tim Chevalier
decbbaa182 Fix long line 2012-10-25 14:54:40 -07:00
Brian Anderson
a9d7642b5d Merge remote-tracking branch '14427/incoming'
Conflicts:
	src/libstd/sort.rs
2012-10-25 14:01:49 -07:00
Patrick Walton
57cd6b3e3f rustc: Translate and check exhaustiveness of struct-like enum variant patterns. r=nmatsakis 2012-10-25 13:59:10 -07:00
Patrick Walton
65ee0e1ded Merge pull request #3858 from pcwalton/struct-like-typeck
rustc: Typecheck, privacy check, and borrow check struct-like enum variants. r=tjc
2012-10-25 12:35:29 -07:00
Tim Chevalier
75947b311a Make error message for non-copyable args less misleading
No review, just changing error message text.

Closes #3855
2012-10-25 12:20:41 -07:00
Patrick Walton
588ea59992 rustc: Typecheck, privacy check, and borrow check struct-like enum variants 2012-10-25 12:15:52 -07:00
Patrick Walton
599b4208fb rustc: Translate tuple struct constructors 2012-10-25 11:49:26 -07:00
Brian Anderson
d82ddc280c Long lines 2012-10-24 20:28:39 -07:00
Niko Matsakis
c6ed01cab3 adjust comments 2012-10-24 18:56:31 -07:00