This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.
It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
Right now rustc hardcodes -lrustllvm. The idea is to instead remember all the native
modules used and convert them to -l directives to the linker. In the case of a
library that is installed in an unusual location, Graydon suggested using metadata:
native module foo = "bar" {
}
This will replace the various node_id-to-node mappings done in several
other passes. This commit already uses the new map in resolve, dropping
the ast_map that was built there before.
This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
These errors are non-fatal. The session.abort_if_errors function needs to be
called at strategic points to convert the previous errors to utter failure.
Issue #440
Revert "rustc: Export only what's needed from middle::ty"
This reverts commit 4255d58aa5db2a05362c4435a0e807205e1b8ed7.
Revert "rustc: Make name resolution errors less fatal"
This reverts commit b8ab9ea89c16c60237e7660804f4321f59ae0435.
Revert "rustc: Make import resolution errors less fatal"
This reverts commit 92a8ae94b971206bf0502da3dc5f416fcb24cc36.
Revert "rustc: Export only what's used from middle::resolve"
This reverts commit 4539a2cf7ad99851a165c98ed2f4e4a475cffd7d.
Revert "rustc: Re-introduce session.span_err, session.err"
This reverts commit 7fe9a88e31ae07f2fd89f6715efedd7e3edf49e6.
Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal"
This reverts commit c394a7f49ac29a099994e243017065de2ff97f2a.
These errors are non-fatal. The session.abort_if_errors function needs to be
called at strategic points to convert the previous errors to utter failure.
Issue #440