Commit Graph

821 Commits

Author SHA1 Message Date
Patrick Walton
e7dbe6cd6f librustc: Register new snapshots 2013-03-21 18:10:20 -07:00
Patrick Walton
94327d00c6 librustc: Replace the &static bound with 'static 2013-03-21 17:31:35 -07:00
Patrick Walton
d4fee24c7c librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis 2013-03-21 17:31:34 -07:00
Marvin Löbel
0a47cd5ef1 Un-renamed trim and substr functions. 2013-03-21 23:06:05 +01:00
Marvin Löbel
ee2f3d9673 Switched over substr and trim functions in str to be non-allocating, temporary renamed them to better track use-sites 2013-03-21 23:06:04 +01:00
bors
6aa612a909 auto merge of #5461 : catamorphism/rust/flagless, r=nikomatsakis
r? @nikomatsakis The typechecker previously passed around a boolean return flag to
indicate whether it saw something with type _|_ (that is, something
it knows at compile-time will definitely diverge) and also had some
manual checks for the `ty_err` pseudo-type that represents a previous
type error. This was because the typing rules implemented by the
typechecker didn't properly propagate _|_ and ty_err. I fixed it.

This also required changing expected error messages in a few tests,
as now we're printing out fewer derived errors -- in fact, at this
point we should print out no derived errors, so report any that
you see (ones that include "[type error]") as bugs.
2013-03-21 11:46:00 -07:00
Tim Chevalier
f36f9fc91c rustc: Comments only - explain the invariant about ty_err and ty_bot a little 2013-03-21 11:32:57 -07:00
Patrick Walton
5726fd4526 librustc: Forbid access to cross-crate private static methods 2013-03-21 09:47:17 -07:00
bors
56d288d0dc auto merge of #5464 : luqmana/rust/const-pat, r=pcwalton
r? @pcwalton
2013-03-21 08:49:13 -07:00
bors
b8899138f8 auto merge of #5466 : Kimundi/rust/view-slice-rename, r=bstrie
A slice now always refers to something that returns an borrowed pointer, views don't exist anymore. If you want to have an explictit copy of a slice, use `to_owned()`
2013-03-21 07:06:54 -07:00
bors
0b4f2687ce auto merge of #5470 : sanxiyn/rust/remove-oldmap-2, r=sanxiyn
Referencing #4986.
2013-03-21 06:15:58 -07:00
Seo Sanghyeon
e2b9cddbbb Switch impls_seen from oldmap 2013-03-21 22:11:30 +09:00
Marvin Löbel
9d9a209e9a back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique 2013-03-21 14:05:57 +01:00
Seo Sanghyeon
f0beb8c059 Switch CoherenceInfo from oldmap 2013-03-21 20:55:28 +09:00
Seo Sanghyeon
dad5c3029d Time type checking passes separately 2013-03-21 19:28:58 +09:00
Seo Sanghyeon
64d923f7dd Move the function to time passes to util 2013-03-21 18:50:02 +09:00
bors
3ac89737ca auto merge of #5465 : sanxiyn/rust/remove-oldmap, r=sanxiyn
Improves resolve by 20% as measured by time-passes on rustc.
2013-03-21 01:21:51 -07:00
Seo Sanghyeon
f68f2282c1 Switch Module.import_resolutions from oldmap 2013-03-21 17:10:57 +09:00
Luqman Aden
2ed80c35e2 librustc: Fix path-qualified and cross-crate constants in match patterns. 2013-03-21 00:38:30 -07:00
Seo Sanghyeon
e84323e9b8 Switch Module.children from oldmap 2013-03-21 16:26:38 +09:00
Tim Chevalier
db00362313 Make typechecker compositional
The typechecker previously passed around a boolean return flag to
indicate whether it saw something with type _|_ (that is, something
it knows at compile-time will definitely diverge) and also had some
manual checks for the `ty_err` pseudo-type that represents a previous
type error. This was because the typing rules implemented by the
typechecker didn't properly propagate _|_ and ty_err. I fixed it.

This also required changing expected error messages in a few tests,
as now we're printing out fewer derived errors -- in fact, at this
point we should print out no derived errors, so report any that
you see (ones that include "[type error]") as bugs.
2013-03-20 19:44:38 -07:00
bors
a8527e2e97 auto merge of #5456 : graydon/rust/fixups, r=pcwalton
Stage markers for stage3 and a trivial prelude fix.
2013-03-20 18:27:48 -07:00
Marvin Löbel
a7d296f24c renamed str::view -> slice_DBG_BRWD
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method  -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
bors
b12714eff5 auto merge of #5455 : pcwalton/rust/framework, r=catamorphism
r? @catamorphism
2013-03-20 16:42:47 -07:00
bors
6f3d1686b2 auto merge of #5447 : erickt/rust/incoming, r=graydon
This normalizes the how we call reverse iteration functions. It also adds a char_len method, and a method to iterate backwards over a string.
2013-03-20 15:30:50 -07:00
Patrick Walton
a29934a61b librustc: Fix bug preventing -framework Foo from working cross-crate. 2013-03-20 13:54:26 -07:00
Graydon Hoare
9350d14ecb add stage3 markers where necessary for dist-snap 2013-03-20 13:48:57 -07:00
bors
99ac243e7b auto merge of #5445 : nikomatsakis/rust/issue-3678-refactor-trans_call, r=graydon
Refactor trans_call to separate out the translation of the arguments, environment, and return pointer.  Towards #3678.  r? @brson
2013-03-20 13:15:58 -07:00
bors
0847d52a86 auto merge of #5450 : pcwalton/rust/warnings, r=graydon
r? @graydon
2013-03-20 11:52:09 -07:00
Patrick Walton
e72d011f68 librustc: Remove debug code and add scary warnings for rusti/rustpkg 2013-03-20 11:44:01 -07:00
Erick Tryzelaar
cefecd8601 core: add str::each{,i}_reverse 2013-03-20 07:53:23 -07:00
Niko Matsakis
ad70c748c3 Apply explicit self transformation before we enter check_fn 2013-03-20 06:17:03 -04:00
Niko Matsakis
00f97b9fb0 Refactor the self-info so that the def-id is carried in ty_self()
and the fn_ctxt doesn't need any self_info field at all.

Step towards fixing `fn(&self)` (cc #4846) to have a distinct
lifetime.
2013-03-20 06:14:53 -04:00
bors
db4dc1ffe2 auto merge of #5443 : alexcrichton/rust/less-bad-copy, r=catamorphism
Removes a lot of instances of `/*bad*/ copy` throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling `librustc` with optimizations.

Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of `git grep`s along with some spot checking and removing the easy ones.
2013-03-20 00:09:47 -07:00
bors
01e179840f auto merge of #5432 : ILyoan/rust/arm_use_ndk_rebase, r=sanxiyn
Partial Fix for #5265

- Enabling LLVM ARM ehabi option.
- Add ARM debug information manually for ccall.s
- Compile object file using Android-NDK.

Current LLVM trunk version can generate ARM debug information for assembly files but it is incomplete for object files. Unwinding on ARM can be done with LLVM trunk(the LLVM submodule of rust has problem on generating ARM debug information). See #5368

The Android-NDK detour(0f89eab) can be removed after LLVM has complete feature of generating ARM debug information for object file.
2013-03-19 23:12:46 -07:00
Alex Crichton
3fac7cce8f rustc: Remove some bad copies throughout 2013-03-20 01:28:32 -04:00
bors
f3c879fdd8 auto merge of #5442 : pcwalton/rust/extern-block-restriction, r=pcwalton
r? @graydon
2013-03-19 21:57:49 -07:00
Erick Tryzelaar
fe74a1c9a2 core: rename vec::rev_each{,i} to vec::each{,i}_reverse
I'm making this change because the _reverse suffix is more commonly
used in libcore/libstd.
2013-03-19 20:24:04 -07:00
bors
4cb9ca9296 auto merge of #5410 : luqmana/rust/cfg-and, r=graydon
This adopts the syntax from #2119. No more annoying workarounds involving wrapping in mods!
2013-03-19 18:39:50 -07:00
bors
251d0c4557 auto merge of #5350 : yichoi/rust/pull-0313-2, r=graydon,pcwalton
FIX #5330

rename arm-unknown-android to arm-linux-androideabi
2013-03-19 17:06:55 -07:00
Patrick Walton
2e7ec80bcc librustc: Enforce privacy for static methods.
This starts moving a bunch of privacy checks into the privacy
checking phase and out of resolve.
2013-03-19 13:40:48 -07:00
Luqman Aden
429fed0c8b librustc: adjust logic for cfg attribute and add not predicate. 2013-03-19 13:00:51 -07:00
bors
e1888948c6 auto merge of #5426 : nikomatsakis/rust/issue-4846-lifetimes-in-expl-self, r=pcwalton
(this will be needed for snapshotting at some point)

r? @pcwalton
2013-03-19 12:43:14 -07:00
bors
a14ec73cd2 auto merge of #5356 : jld/rust/enum-less-magic, r=graydon
Fixes #1645.
2013-03-19 11:43:10 -07:00
Niko Matsakis
e821671989 Refactor trans_call to separate out the translation of the arguments, environment, and return pointer 2013-03-19 14:40:34 -04:00
bors
58209910bd auto merge of #5433 : lucab/rust/lucab/cfgspec, r=graydon
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
2013-03-19 10:43:24 -07:00
Luca Bruno
0a34a3f0f5 Make driver::driver::parse_cfgspecs parse any variety of meta_item
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399

Signed-off-by: Luca Bruno <lucab@debian.org>
2013-03-19 14:02:59 +01:00
ILyoan
0f89eab89d Use NDK for building android target objects 2013-03-19 17:23:31 +09:00
Luqman Aden
8b66578e66 Allow expressions that are not just a single value for repeated fixed length vector syntax. 2013-03-18 17:31:41 -07:00
Luqman Aden
787f5bb0db Now actually allow using constants in those constant expressions for [T * n]. 2013-03-18 17:31:41 -07:00
Luqman Aden
42f95d055c Allow constant expressions in [Type * n]. 2013-03-18 17:31:41 -07:00
Patrick Walton
e78f2e2ac5 librustc: Make the compiler ignore purity.
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
2013-03-18 17:21:16 -07:00
Patrick Walton
c4db4faefa libsyntax: Stop parsing old lifetimes, except for the ones on data type declarations. 2013-03-18 17:21:15 -07:00
Patrick Walton
352c070365 librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming 2013-03-18 17:21:14 -07:00
Niko Matsakis
a6187c62e9 Make &self permit explicit lifetimes, but don't really use them
(this will be needed for snapshotting at some point).
2013-03-18 15:03:37 -04:00
Luqman Aden
83f2d4ab3d Fix type_use for inline asm. 2013-03-15 18:57:19 -07:00
Luqman Aden
d68b98a5bf Don't use by_val for passing asm operands. 2013-03-15 18:55:44 -07:00
Luqman Aden
3d56936be3 Tidy. 2013-03-15 18:55:44 -07:00
Luqman Aden
e182ac4bbd Actually use no or multiple operands properly. 2013-03-15 18:55:44 -07:00
Luqman Aden
9ead7dad93 Implicitly use addr_of for output operands in asm. 2013-03-15 18:55:44 -07:00
Luqman Aden
59dcbd9f1c Initial support for output operands in asm. 2013-03-15 18:55:44 -07:00
Luqman Aden
d8ab47e7f9 Properly handle input operands for inline asm. 2013-03-15 18:55:43 -07:00
Luqman Aden
6d078db952 Actually pass inline asm operands around. 2013-03-15 18:55:43 -07:00
Luqman Aden
471d2b1765 Inline asm exprs should be RvalueStmtExpr. 2013-03-15 18:55:43 -07:00
Patrick Walton
1c8490b0d9 librustc: Remove another deprecated use of as Trait. rs=burningtree 2013-03-14 08:03:05 -07:00
Patrick Walton
aa4c19b6ab librustc: Allow path-qualified constants in patterns 2013-03-13 20:07:11 -07:00
Patrick Walton
8fa66e8e07 librustc: Remove implicit self from the language, except for old-style drop blocks. 2013-03-13 20:07:10 -07:00
Patrick Walton
a410652bc9 librustc: Remove "base types" from the language. 2013-03-13 20:07:09 -07:00
Patrick Walton
b85158e23a librustc: Remove overloaded operator autoderef. 2013-03-13 20:07:09 -07:00
Patrick Walton
b1c699815d librustc: Don't accept as Trait anymore; fix all occurrences of it. 2013-03-13 20:07:09 -07:00
Patrick Walton
24a0de4e7f librustc: Separate out trait storage from evec/estr storage 2013-03-13 20:07:08 -07:00
ILyoan
688c4c403d Remove unused import in librustc 2013-03-14 09:52:51 +09:00
ILyoan
1095bbe5eb Remove unused variable 2013-03-14 09:52:51 +09:00
bors
ab5472a724 auto merge of #5307 : nikomatsakis/rust/remove-by-val, r=nikomatsakis
This is done in two steps:

First, we make foreign functions not consider modes at all.  This is because previously ++ mode was the only way to pass structs to foreign functions and so forth.  We also add a lint mode warning if you use `&&` mode in a foreign function, since the semantics of that change (it used to pass a pointer to the C function, now it doesn't).

Then, we remove by value and make it equivalent to `+` mode.  At the same time, we stop parsing `-` mode and convert all uses of it to `+` mode (it was already being parsed to `+` mode anyhow).

This obsoletes pull request #5298.

r? @brson
2013-03-13 14:57:55 -07:00
Niko Matsakis
852619d5d7 Remove ++ mode from the compiler (it is parsed as + mode)
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-13 17:00:09 -04:00
Niko Matsakis
efc7f82bc4 Revamp foreign code not to consider the Rust modes. This requires
adjusting a few foreign functions that were declared with by-ref
mode.  This also allows us to remove by-val mode in the near future.

With copy mode, though, we have to be careful because Rust will implicitly pass
somethings by pointer but this may not be the C ABI rules.  For example, rust
will pass a struct Foo as a Foo*.  So I added some code into the adapters to
fix this (though the C ABI rules may put the pointer back, oh well).

This patch also includes a lint mode for the use of by-ref mode
in foreign functions as the semantics of this have changed.
2013-03-13 16:59:37 -04:00
bors
67b0f3d5b2 auto merge of #5339 : catamorphism/rust/less-copy, r=catamorphism 2013-03-13 13:57:56 -07:00
bors
7e6020db63 auto merge of #5319 : brson/rust/debuginfo, r=brson
Continuing #5140 

For the sake of getting this merged I've disabled debuginfo tests on mac (where running gdb needs root). Please feel free to follow up with further improvements.
2013-03-13 11:34:00 -07:00
bors
695e9fd13c auto merge of #5293 : brson/rust/logging, r=brson
r? @graydon

This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros.

After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later.

I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
2013-03-13 10:40:07 -07:00
Jed Davis
a301db7eef Represent enums with regular structs; no more alignment-breaking casts. 2013-03-13 10:25:49 -07:00
Young-il Choi
268faef63a mk: target triple rename arm-unknown-android->arm-linux-androideabi 2013-03-13 09:21:12 +09:00
bors
ece098667d auto merge of #5332 : jdm/rust/transitivelink, r=graydon
The original change bit Servo because rust-harfbuzz includes libharfbuzz.a in its link_args. This works fine in the rust-harfbuzz subdirectory where the static library resides, but when this is propagated to servo_gfx, the lirbrary can no longer be found since it's a relative path.
2013-03-12 11:06:55 -07:00
Tim Chevalier
f9269a1bda rustc: One Less Bad Copy 2013-03-12 10:04:35 -07:00
Luqman Aden
18b71a7831 Add alignstack option for inline asm. 2013-03-12 01:03:35 -07:00
Luqman Aden
7f500ab4c1 Keep everything tidy. 2013-03-12 01:03:34 -07:00
Luqman Aden
5aa734d6a1 Parse operands properly and add a way to indicate volatile asm. 2013-03-12 01:03:34 -07:00
Luqman Aden
bcc6c3e3db Require unsafe block for inline assembly. 2013-03-12 01:03:34 -07:00
Luqman Aden
fc78b93c41 Wrap llvm::InlineAsm::AsmDialect 2013-03-12 01:03:34 -07:00
Luqman Aden
ecccc0d649 Parse inline assembly. 2013-03-12 01:03:34 -07:00
Brian Anderson
82f190355b Remove uses of log 2013-03-11 23:19:42 -07:00
Josh Matthews
1e1efbf2c3 Avoid propagating link_arg values that are unlikely to be resolveable under arbitrary directories. 2013-03-12 00:50:19 -04:00
bors
9b9ffd5b41 auto merge of #5304 : jld/rust/const-adjustments, r=graydon
These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right.

As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions.

There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.
2013-03-11 21:12:43 -07:00
Brian Leibig
c978025d0d Debuginfo revamp 2013-03-11 14:09:06 -07:00
bors
ce24ebb858 auto merge of #5314 : jld/rust/adt-simplification, r=pcwalton
Struct and enum representations have some complicatedness that's no longer needed.  Now that everything's in one place and has access to anything we'd want to know about the type, flatten some of that out.  Slight changes to representations in some cases.
2013-03-11 11:54:49 -07:00
Patrick Walton
08c840205e librustc: Lint the old drop destructor notation off 2013-03-11 09:36:00 -07:00
Patrick Walton
7353568cd8 librustc: Remove old-style operator overloading 2013-03-11 09:36:00 -07:00
Patrick Walton
dc4869945c librustc: Remove newtype enums from librustc 2013-03-11 09:35:59 -07:00
Patrick Walton
d18f785457 librustc: Replace all uses of fn() with &fn(). rs=defun 2013-03-11 09:35:58 -07:00
Seo Sanghyeon
9e85589ad3 Implement vector destructuring from tail 2013-03-11 19:01:51 +09:00
Jed Davis
9eaa608b04 Get rid of the Unit enum representation.
The only thing we really lose is that C-like enums with one variant and a
non-zero discriminant now take up space, but I do not think this is a
common usage.  As previously noted, that was mostly there for
transitional compatibility with the pre-adt.rs codebase.
2013-03-11 00:01:04 -07:00