Graydon Hoare
c29e9fb60b
syntax: implement foreach .. in .. { .. } via desugaring.
2013-07-30 18:50:28 -07:00
Michael Woerister
8a329770b6
New naming convention for ast::{node_id, local_crate, crate_node_id, blk_check_mode, ty_field, ty_method}
2013-07-29 16:16:48 +02:00
Patrick Walton
99d44d24c7
librustc: Remove copy
expressions from the language.
2013-07-17 14:57:52 -07:00
Michael Sullivan
82ae2fa93a
Clean up Repr impls a bit so we can add generic impls for @ and ~.
2013-07-11 15:51:09 -07:00
Niko Matsakis
729b07f83c
Modify borrow checker to visit irrefutable patterns that appear in
...
let and function arguments; modify type checker to store type
information for all patterns and handles some missing cases.
2013-07-08 13:55:10 -04:00
Corey Richardson
1662bd371c
Great renaming: propagate throughout the rest of the codebase
2013-06-29 11:20:02 -04:00
bors
132cfcdd88
auto merge of #7363 : bblum/rust/soundness, r=nikomatsakis
...
The commit f9a5453 is meant to be a temporary hold-over. Whether or not there is added a way for the compiler to "implicitly borrow" stack closures in this way, there should be a codegen optimization that prevents having to traverse possibly-very-many function pointers to find the function you ultimately wanted to call. I tried to separate out the changes so this particular commit could be straight-up reverted if auto-borrowing happens in the future.
r? @nikomatsakis
2013-06-29 04:22:53 -07:00
bors
c80e3bac3e
auto merge of #7244 : bblum/rust/once, r=nikomatsakis
...
@graydon suggested that once closures not be part of the language for 1.0, but that they might be hidden behind a -Z compile flag as an "experimental feature" in case people decide they need them.
Regardless of whether ```-Z once-fns``` is set, this PR will parse the ```once``` keyword and will prevent closures labelled with it from being called more than once. It will also permit moving out of captured vars in heap closures, just to let the runtime writers stop using ```Cell``` sooner. Setting ```-Z once-fns``` only toggles whether the move-out-from-capture privilege is also given for stack closures.
r? @nikomatsakis
2013-06-29 02:34:43 -07:00
Ben Blum
ff4ab9e147
'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep for making them noncopyable.
2013-06-29 04:39:34 -04:00
Patrick Walton
3625781cfe
librustc: Fix more merge fallout.
2013-06-28 10:44:17 -04:00
Alex Crichton
1841b31c61
Add 'static mut' items to the language
2013-06-23 17:59:35 -07:00
Daniel Micay
d2e9912aea
vec: remove BaseIter implementation
...
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
James Miller
761fc16c60
Fix-up PP Code to reflect new lifetime param syntax
2013-06-22 12:38:40 +12:00
Daniel Micay
49c74524e2
vec: rm old_iter implementations, except BaseIter
...
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.
This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21 03:20:22 -04:00
Ben Blum
643be38cfe
Hide the once-move-out privilege for stack fns behind '-Z once-fns'
2013-06-19 15:53:05 -04:00
Ben Blum
1496216db6
Permit moving out of captured upvars in once fns. Close #2549 .
2013-06-19 14:25:51 -04:00
Daniel Micay
585f5f7f79
add IteratorUtil to the prelude
2013-06-14 23:15:42 -04:00
Huon Wilson
096f6f56a8
Use @str instead of @~str in libsyntax and librustc. Fixes #5048 .
...
This almost removes the StringRef wrapper, since all strings are
Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts
several things to be &'static str (the lint table and the intrinsics
table).
There are many instances of .to_managed(), unfortunately.
2013-06-13 10:20:52 +10:00
Daniel Micay
004816f4c6
option: remove redundant old_iter impls
2013-06-11 14:06:12 -04:00
Erick Tryzelaar
23808efd11
syntax: move callee_id into the expr_ variants
2013-06-01 15:31:56 -07:00
Patrick Walton
5fb254695b
Remove all uses of pub impl
. rs=style
2013-06-01 09:18:27 -07:00
Patrick Walton
206ab89629
librustc: Stop reexporting the standard modules from prelude.
2013-05-29 19:04:53 -07:00
Niko Matsakis
5851d3242c
Move checking for moves and initialization of local variables and patterns into
...
borrow checker and generalize what moves are allowed. Fixes a nasty
bug or two in the pattern move checking code. Unifies dataflow code
used for initialization and other things. First step towards
once fns. Everybody wins.
Fixes #4384 . Fixes #4715 . cc once fns (#2202 ), optimizing local moves (#5016 ).
2013-05-28 20:22:14 -04:00
Patrick Walton
f3723cf7c4
libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra
2013-05-22 21:57:07 -07:00
Niko Matsakis
5ca383b777
Distinguish tuple elements by index in mem_categorization. Fixes #5362 .
2013-05-17 21:12:50 -04:00
Niko Matsakis
d204cfd739
Issue #5967 : Make rvalues mutable
2013-05-14 09:26:21 -04:00
Patrick Walton
5d3559e645
librustc: Make self
and static
into keywords
2013-05-12 16:35:18 -07:00
Tim Chevalier
ed41864464
Warning police
2013-05-11 20:36:44 -07:00
Alex Crichton
63c7e2f991
Remove the '<->' operator from the language
2013-05-10 22:51:06 -04:00
Niko Matsakis
e18ed77b72
Remove remnants of mutable fields from mem_categorization, borrowck.
2013-05-09 15:58:41 -04:00
Niko Matsakis
15164cc6a6
Issue the correct deref count for the implicit deref that occurs
...
as part of an autoslice operation (#6272 ).
Fixes #6272 .
2013-05-09 15:58:02 -04:00
Patrick Walton
db4573a776
librustc: Remove mutable fields from the language.
...
They're still parsed though, to get through bootstrapping.
2013-05-08 17:04:00 -07:00
Niko Matsakis
4300d4d2fa
Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
...
Conflicts:
src/libcore/core.rc
src/libcore/hashmap.rs
src/libcore/num/f32.rs
src/libcore/num/f64.rs
src/libcore/num/float.rs
src/libcore/num/int-template.rs
src/libcore/num/num.rs
src/libcore/num/strconv.rs
src/libcore/num/uint-template.rs
src/libcore/ops.rs
src/libcore/os.rs
src/libcore/prelude.rs
src/libcore/rt/mod.rs
src/libcore/unstable/lang.rs
src/librustc/driver/session.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/gather_loans.rs
src/librustc/middle/borrowck/loan.rs
src/librustc/middle/borrowck/preserve.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/region.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/inline.rs
src/librustc/middle/trans/reachable.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/util/ppaux.rs
src/libstd/arena.rs
src/libstd/ebml.rs
src/libstd/json.rs
src/libstd/serialize.rs
src/libstd/std.rc
src/libsyntax/ast_map.rs
src/libsyntax/parse/parser.rs
src/test/compile-fail/borrowck-uniq-via-box.rs
src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00
Niko Matsakis
0b0b8018a6
add warning for #6248 and remove instances of it
2013-05-05 12:17:59 -04:00
Niko Matsakis
ccf2f7b979
make asm_comments something that you opt in to
2013-05-04 14:29:08 -04:00
Daniel Micay
86efd97a10
add gitattributes and fix whitespace issues
2013-05-03 20:01:42 -04:00
Niko Matsakis
e7d96934c1
Correct mismatch between the way that pattern ids and expression ids map to types (pattern ids map to the input type, expression ids map to the output type)
2013-05-03 12:29:24 -04:00
Seo Sanghyeon
4294aed01b
Use static strings
2013-05-02 10:36:30 +09:00
Niko Matsakis
545d51c160
rustc: remove modes
2013-04-30 14:08:18 -04:00
Niko Matsakis
a896440ca1
new borrow checker (mass squash)
2013-04-30 06:59:32 -04:00
bors
c081ffbd1e
auto merge of #6121 : luqmana/rust/newtype-cc, r=graydon
...
#6086
2013-04-30 02:21:37 -07:00
Luqman Aden
b50aa827a0
librustc: Fix pattern matching on cross crate newtype structs.
2013-04-29 17:35:36 -07:00
Patrick Walton
f30f54e9d0
librustc: Remove the concept of modes from the compiler.
...
This commit does not remove `ty::arg`, although that should be
possible to do now.
2013-04-29 14:30:55 -07:00
Daniel Micay
f792baba42
only use #[no_core] in libcore
2013-04-27 21:34:24 -04:00
Tim Chevalier
52d3f5558e
core, rustc: Warning police
2013-04-23 10:17:38 -07:00
Alex Crichton
d1985c9dd0
Implement a lint mode to deal with unused 'mut' variables
2013-04-20 21:02:38 -04:00
Niko Matsakis
007abe9352
Rather than storing a list of ty::method per trait, store one ty::method
...
per method and list of def-ids per trait.
2013-04-05 05:36:02 -04:00
Alex Crichton
6f812fef1b
rustc: Remove uses of oldmap::HashMap
2013-03-26 19:21:04 -04:00
Patrick Walton
e7c60c141b
librustc: Remove pure
from libsyntax and librustc.
2013-03-22 12:57:27 -07:00
Patrick Walton
4634f7edae
librustc: Remove all uses of static
from functions. rs=destatic
2013-03-22 10:27:39 -07:00