Jorge Aparicio
17bc7d8d5b
cleanup: replace as[_mut]_slice()
calls with deref coercions
2015-02-05 13:45:01 -05:00
Jorge Aparicio
d5d7e6565a
for x in xs.iter()
-> for x in &xs
2015-02-02 13:40:18 -05:00
Niko Matsakis
2f465869fd
Separate out the unboxed closure table into two tables, so that we can
...
generate the closure type and closure kind separately.
2015-02-01 06:13:06 -05:00
Alex Crichton
64dd7be2c5
Merge remote-tracking branch 'origin/master' into rollup
...
Conflicts:
src/liballoc/lib.rs
src/libcore/ops.rs
2015-01-30 14:55:34 -08:00
Jorge Aparicio
a873316277
remove dead code
2015-01-30 10:37:44 -05:00
Jorge Aparicio
9fdc0effd2
implement for loop desugaring
2015-01-30 10:36:31 -05:00
Niko Matsakis
80c793c1d3
Allow individual upvars to be inferred to move semantics. Fixes #21603 .
2015-01-30 05:56:39 -05:00
Niko Matsakis
2f29cdeb4b
Remove the capture mode map and just store the capture mode for individual variables.
...
Also add test. Fixes #16749 .
2015-01-30 05:56:39 -05:00
Jorge Aparicio
788181d405
s/Show/Debug/g
2015-01-29 07:49:02 -05:00
Jorge Aparicio
7d661af9c8
for x in range(a, b)
-> for x in a..b
...
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29 07:47:37 -05:00
Eduard Burtescu
11ef6f1349
Remove "unboxed" attribute in code referring to new closures.
2015-01-26 04:15:09 +02:00
Huon Wilson
2e888d0341
Add the span of the operator itself to ast::BinOp.
2015-01-25 00:33:50 +11:00
Eduard Burtescu
2cdc86c180
syntax: add fully qualified UFCS expressions.
2015-01-15 18:51:14 +02:00
Jorge Aparicio
517f1cc63c
use slicing sugar
2015-01-07 17:35:56 -05:00
Alex Crichton
771fe9026a
rollup merge of #20607 : nrc/kinds
...
Conflicts:
src/libcore/array.rs
src/libcore/cell.rs
src/libcore/prelude.rs
src/libstd/path/posix.rs
src/libstd/prelude/v1.rs
src/test/compile-fail/dst-sized-trait-param.rs
2015-01-06 15:34:10 -08:00
Alex Crichton
0b3b957554
rollup merge of #20645 : nikomatsakis/rustbook-ice
...
Conflicts:
src/librustc/middle/mem_categorization.rs
src/librustc/middle/ty.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/foreign.rs
src/librustc_typeck/check/mod.rs
2015-01-06 15:29:09 -08:00
Alex Crichton
5c3ddcb15d
rollup merge of #20481 : seanmonstar/fmt-show-string
...
Conflicts:
src/compiletest/runtest.rs
src/libcore/fmt/mod.rs
src/libfmt_macros/lib.rs
src/libregex/parse.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/dataflow.rs
src/librustc/middle/infer/higher_ranked/mod.rs
src/librustc/middle/ty.rs
src/librustc_back/archive.rs
src/librustc_borrowck/borrowck/fragments.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_resolve/lib.rs
src/librustc_trans/back/link.rs
src/librustc_trans/save/mod.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/callee.rs
src/librustc_trans/trans/common.rs
src/librustc_trans/trans/consts.rs
src/librustc_trans/trans/controlflow.rs
src/librustc_trans/trans/debuginfo.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/monomorphize.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/method/mod.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/collect.rs
src/libsyntax/ext/format.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/token.rs
src/test/run-pass/issue-8898.rs
2015-01-06 15:22:24 -08:00
Nick Cameron
9f07d055f7
markers -> marker
2015-01-07 12:10:31 +13:00
Nick Cameron
0c7f7a5fb8
fallout
2015-01-07 12:02:52 +13:00
Sean McArthur
44440e5c18
core: split into fmt::Show and fmt::String
...
fmt::Show is for debugging, and can and should be implemented for
all public types. This trait is used with `{:?}` syntax. There still
exists #[derive(Show)].
fmt::String is for types that faithfully be represented as a String.
Because of this, there is no way to derive fmt::String, all
implementations must be purposeful. It is used by the default format
syntax, `{}`.
This will break most instances of `{}`, since that now requires the type
to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the
correct fix. Types that were being printed specifically for users should
receive a fmt::String implementation to fix this.
Part of #20013
[breaking-change]
2015-01-06 14:49:42 -08:00
Nick Cameron
e970db37a9
Remove old slicing hacks and make new slicing work
2015-01-07 10:49:00 +13:00
Nick Cameron
f7ff37e4c5
Replace full slice notation with index calls
2015-01-07 10:46:33 +13:00
Nick Cameron
503709708c
Change std::kinds
to std::markers
; flatten std::kinds::marker
...
[breaking-change]
2015-01-07 09:45:28 +13:00
Niko Matsakis
2486d93e5b
Fix ICE that @steveklabnik encountered in rust-ice. The problems turned out to be that were being very loose with bound regions in trans (we were basically just ignoring and flattening binders). Since binders are significant to subtyping and hence to trait selection, this can cause a lot of problems. So this patch makes us treat them more strictly -- for example, we propagate binders, and avoid skipping past the Binder
by writing foo.0
.
...
Fixes #20644 .
2015-01-06 13:42:42 -05:00
Jorge Aparicio
4e9c50e081
remove AdjustAddEnv
2015-01-05 17:22:15 -05:00
Jorge Aparicio
5f7f2c9a05
remove ty_closure
2015-01-05 17:22:15 -05:00
Jorge Aparicio
351409a622
sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs
2015-01-03 22:54:18 -05:00
Jorge Aparicio
8c5bb80d9b
sed -i -s 's/\bmod}/self}/g' **/*.rs
2015-01-03 22:42:37 -05:00
Niko Matsakis
7474be0660
Make ty::ParameterEnvironment
, not ty::ctxt
, implement Typer
and
...
`UnboxedClosureTyper`. This requires adding a `tcx` field to
`ParameterEnvironment` but generally simplifies everything since we
only need to pass along an `UnboxedClosureTyper` or `Typer`.
2015-01-03 07:01:21 -05:00
Niko Matsakis
83ef3042de
Modify type_known_to_meet_builtin_bound
so that it doesn't suppress overflow,
...
which should always result in an error.
NB. Some of the hunks in this commit rely on a later commit which adds
`tcx` into `param_env` and modifies `ParameterEnvironment` to
implement `Typer`.
2015-01-03 07:01:21 -05:00
Niko Matsakis
429d9cce1b
Be more tolerant of errors in EUV so we can run it during typeck.
2015-01-03 07:00:51 -05:00
Niko Matsakis
f7abf47058
Re-introduce McResult<>
as a way of aborting mem-categorization (and
...
expr-use-visitor) early. Turns out I was wrong to remove this; it
causes a lot of pain trying to run EUV etc during typeck without
ICEing on erroneous programs.
2015-01-03 07:00:51 -05:00
bors
1f887c8c57
auto merge of #20412 : nikomatsakis/rust/assoc-types, r=aturon
...
These changes fix various problems encountered getting japaric's `at-iter` branch to work. This branch converts the `Iterator` trait to use an associated type.
2015-01-02 08:11:19 +00:00
Niko Matsakis
78f848cde5
Refactor the Typer interface to separate out UnboxedClosureTyper methods, which are
...
the only things that trait selection needs.
2015-01-01 18:48:26 -05:00
Nick Cameron
7e2b9ea235
Fallout - change array syntax to use ;
2015-01-02 10:28:19 +13:00
Niko Matsakis
0b64e5796b
Make ExprUseVisitor<..> use inherited parameter environments.
2014-12-30 09:32:42 -05:00
Nick Cameron
4e2afb0052
Remove ExprSlice by hacking the compiler
...
[breaking-change]
The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-30 13:06:25 +13:00
Nick Cameron
ed8f503911
Add hypothetical support for ranges with only an upper bound
...
Note that this doesn't add the surface syntax.
2014-12-30 13:06:24 +13:00
Huon Wilson
85970d49df
Intern Region in tcx.
...
This makes sty only 32 bytes on machines with 64-bit pointers.
2014-12-29 23:55:25 +11:00
Huon Wilson
4f2b0f032a
Store Substs in an arena in the tcx.
...
This current inflates memory use more than 3 times.
2014-12-29 23:55:24 +11:00
Niko Matsakis
4856456dd7
Move mem-categorization more things to use TYPER for the method origin
2014-12-25 07:04:07 -05:00
Niko Matsakis
a583ba2fa0
Remove McResult
from the mem-categorization interface.
2014-12-25 07:04:07 -05:00
Niko Matsakis
8f770f10b2
Extend Typer interface to include expr_ty_adjusted
so that we can
...
remove another direct dependency on tcx from euv.
2014-12-25 07:04:07 -05:00
Niko Matsakis
230d0eb003
Use the typer in ExprUseVisitor and do not hard code to tcx
2014-12-25 07:04:07 -05:00
Nick Cameron
17826e10a2
Type checking and trans for ranges
2014-12-24 09:12:45 +13:00
Nick Cameron
8a357e1d87
Add syntax for ranges
2014-12-24 09:12:45 +13:00
Alex Crichton
de11710d80
rollup merge of #19891 : nikomatsakis/unique-fn-types-3
...
Conflicts:
src/libcore/str.rs
src/librustc_trans/trans/closure.rs
src/librustc_typeck/collect.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs
2014-12-22 12:51:23 -08:00
Niko Matsakis
f46099575a
Make ty_bare_fn carry an optional def-id indicating whether it is the
...
type of a fn item or a fn pointer, which are now differentiated.
Introduce coercion from fn item to fn pointer.
2014-12-22 12:27:07 -05:00
Alex Crichton
082bfde412
Fallout of std::str stabilization
2014-12-21 23:31:42 -08:00
Jorge Aparicio
e64a0072d6
librustc: use #[deriving(Copy)]
2014-12-19 10:51:00 -05:00