Commit Graph

1710 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
bff28ec468 refactor rustc_metadata to use CamelCase names and IndexVec 2016-06-28 23:41:09 +03:00
Jeffrey Seyfried
360dcae419 Update src/rustc/Cargo.lock 2016-06-27 23:40:04 +00:00
Ariel Ben-Yehuda
ce4fdefbd8 fix issues 2016-06-09 21:47:58 +03:00
Ariel Ben-Yehuda
2de6ea7a35 fix Cargo.lock 2016-06-09 01:05:37 +03:00
Vadim Petrochenkov
731144b95a sanity -> validation
Add test for `::super` in import prefix
2016-05-28 20:52:49 +03:00
Alex Crichton
bb9062a296 rustbuild: Add support for crate tests + doctests
This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc #31590
2016-05-12 08:52:20 -07:00
Alex Crichton
8d65591cf2 rustbuild: Tighten dependencies of build scripts
Ensure that `rerun-if-changed` is printed for all build scripts to ensure that
they've all got the right list of dependencies.
2016-05-10 23:41:19 -07:00
Alex Crichton
0ec321f7b5 rustc: Implement custom panic runtimes
This commit is an implementation of [RFC 1513] which allows applications to
alter the behavior of panics at compile time. A new compiler flag, `-C panic`,
is added and accepts the values `unwind` or `panic`, with the default being
`unwind`. This model affects how code is generated for the local crate, skipping
generation of landing pads with `-C panic=abort`.

[RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md

Panic implementations are then provided by crates tagged with
`#![panic_runtime]` and lazily required by crates with
`#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic
runtime must match the final product, and if the panic strategy is not `abort`
then the entire DAG must have the same panic strategy.

With the `-C panic=abort` strategy, users can expect a stable method to disable
generation of landing pads, improving optimization in niche scenarios,
decreasing compile time, and decreasing output binary size. With the `-C
panic=unwind` strategy users can expect the existing ability to isolate failure
in Rust code from the outside world.

Organizationally, this commit dismantles the `sys_common::unwind` module in
favor of some bits moving part of it to `libpanic_unwind` and the rest into the
`panicking` module in libstd. The custom panic runtime support is pretty similar
to the custom allocator support with the only major difference being how the
panic runtime is injected (takes the `-C panic` flag into account).
2016-05-09 08:22:36 -07:00
Manish Goregaokar
0cb966fa3b
Rollup merge of #33404 - gsquire:cargo-lock, r=alexcrichton
Cargo lock tidy check

A rebased PR for #32901
2016-05-08 07:00:07 -07:00
Eduard Burtescu
78884b7659 mir: qualify and promote constants. 2016-05-07 19:14:28 +03:00
Garrett Squire
b3de042146 add a check to make tidy to ensure cargo lock file is updated 2016-05-04 10:25:17 -07:00
Tamir Duberstein
322f3a3eaa rustc: update Cargo.lock 2016-04-24 19:38:49 -04:00
Alex Crichton
ede8944ea7 rustbuild: Run all markdown documentation tests
This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation. This also includes support
for running the error index tests.
2016-04-19 09:52:56 -07:00
bors
74b3684d00 Auto merge of #32895 - alexcrichton:rustbuild-beta, r=brson
rustbuild: Fix handling of the bootstrap key

Bring the calculation logic in line with the makefiles and also set the
RUSTC_BOOTSTRAP_KEY environment variable to enable the bootstrap on the stable
compiler.
2016-04-15 04:10:11 -07:00
Alex Crichton
7bfaeaaf9c tidy: Add a check to ensure Cargo.toml is in sync
This verifies that the crates listed in the `[dependencies]` section of
`Cargo.toml` are a subset of the crates listed in `lib.rs` for our in-tree
crates. This should help ensure that when we refactor crates over time we keep
these dependency lists in sync.
2016-04-12 15:55:14 -07:00
Alex Crichton
8efbfae6bf rustbuild: Fix handling of the bootstrap key
Bring the calculation logic in line with the makefiles and also set the
RUSTC_BOOTSTRAP_KEY environment variable to enable the bootstrap on the stable
compiler.
2016-04-11 17:16:32 -07:00
Eduard Burtescu
8b0937293b rustc: move rustc_front to rustc::hir. 2016-04-06 09:01:55 +03:00
bors
3ec71b033a Auto merge of #32598 - alexcrichton:rustbuild-osx, r=aturon
rustbuild: Fix compile on OSX for 10.7

This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-04-02 10:30:03 -07:00
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
Alex Crichton
08ca5d9558 rustbuild: Fix compile on OSX for 10.7
This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-03-29 21:51:00 -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
Niko Matsakis
1a3a70760b Implement proper subtyping for region fn types (part of #2263) 2012-10-24 18:56:31 -07:00
Brian Anderson
a66e01369d Merge pull request #3852 from veddan/type-limits
Lint pass like GCC's -Wtype-limits (#3833)
2012-10-24 14:38:49 -07:00
Patrick Walton
4da58a5bd6 rustc: Implement typechecking for tuple structs. r=nmatsakis 2012-10-24 10:54:09 -07:00
Viktor Dahl
87b5f05a9d Cleaned up formatting and fixed bug in rev_binop 2012-10-24 18:44:37 +02:00
Viktor Dahl
9d915294c9 Implemented '-W type-limits' (#3833) 2012-10-24 18:44:37 +02:00
Patrick Walton
61bb3571a5 rustc: Implement construction of monomorphic struct-like variants. r=nmatsakis 2012-10-23 19:23:46 -07:00
Tim Chevalier
087cbb55d0 Remove <- operator from the compiler
Yield an obsolete syntax error on things like "let foo <- bar;"
and "foo <- bar;" r=brson

Progress on #3466
2012-10-23 12:10:19 -07:00
Tim Chevalier
48c8d1fecd Remove uses of binary move in the compiler 2012-10-23 12:10:04 -07:00
Patrick Walton
3bf0a9b094 rustc: Implement typechecking for simple monomorphic derivable traits on monomorphic types. r=brson 2012-10-23 10:45:23 -07:00
Brian Anderson
575950d12c rustc: Lower-case the error messages in kind.rs, for consistency 2012-10-23 10:41:33 -07:00
Brian Anderson
b2af873b76 Merge remote-tracking branch 'luqmana/incoming' 2012-10-22 21:44:53 -07:00
Patrick Walton
1048f9abfa rustc: Factor out struct literal typechecking in preparation for struct-like enum variants 2012-10-22 18:00:55 -07:00
Patrick Walton
ec1c60c4d6 rustc: Implement generic cross-crate trait inheritance 2012-10-22 18:00:48 -07:00
Simon BD
cc0f2c6bb2 Merge remote-tracking branch 'original/incoming' into incoming 2012-10-22 18:33:41 -05:00
Brian Anderson
5a86f5d084 rustc: Convert two printlns in trans into debug! 2012-10-22 13:33:44 -07:00
Brian Anderson
64e1ecb939 Long lines 2012-10-22 12:02:55 -07:00
Brian Anderson
2eea07be11 Merge pull request #3826 from jdm/doublefail
Fix ICE stemming from use of unique pointers in unreachable blocks.
2012-10-22 11:32:30 -07:00
Tim Chevalier
14e7df7d1a Fix breakage (forgot to commit this... 2012-10-22 10:54:23 -07:00
Tim Chevalier
dca0776747 Incorporate review comments (mostly fixing indentation)
Previous commit was r=nmatsakis
2012-10-22 09:44:56 -07:00
Tim Chevalier
dd66e7549b Preliminary support for labeled break/continue for loops
This patch adds preliminary middle-end support (liveness and trans)
for breaks and `loop`s to `loop` constructs that have labels.

while and for loops can't have labels yet.

Progress on #2216
2012-10-22 09:20:37 -07:00
Tim Chevalier
46d4bbbae4 Simplify the AST representation of ty param bounds
Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.

r=nmatsakis

Closes #2284
2012-10-22 09:01:12 -07:00
Niko Matsakis
42c05fe642 Correct propagation of mutability from components to base in borrowck
Fixes #3828.
2012-10-21 23:52:36 -07:00
Luqman Aden
e1db959ec2 rustc: add new intrinsics - atomic_cxchg{_acq,_rel} 2012-10-21 22:23:50 -04:00
Josh Matthews
7c7980196c Fix ICE stemming from use of unique pointers in unreachable blocks. 2012-10-21 03:43:41 -04:00
Ben Striegel
ac81fff229 Remove old fixed-length vector syntax 2012-10-20 17:50:46 -07:00
Tim Chevalier
10612ee30c Remove superfluous by-ref in option::get, option::get_default, option::expect
Superficial change, no review.
2012-10-19 11:38:28 -07:00
Patrick Walton
754704ea94 rustc: Implement intra-crate static methods on anonymous trait implementations. r=nmatsakis 2012-10-18 14:29:18 -07:00
Erick Tryzelaar
a7ecde3323 libcore: minor code cleanup.
This is minor and probably completely inconsequential to performance,
but I find vec::map to be more clear than vec::each and a push.
2012-10-18 10:09:57 -07:00
Erick Tryzelaar
95423d28f2 libcore: call [u8] values bytes, not bufs 2012-10-18 10:09:42 -07:00
Erick Tryzelaar
4e03ffdb65 rustc: optimize away some mallocs when building GEP args 2012-10-18 08:03:04 -07:00
Tim Chevalier
33adb7a824 Merge pull request #3739 from killerswan/usagemsg
Add a module to getopts for verbose option group declaration (and use it in rustc)
2012-10-17 13:05:04 -07:00