Simonas Kazlauskas
c71970eea2
Extract attribute handling code into a module
...
This commit causes no change in trans semantics, it just moves some functions around and
deduplicates them.
2015-04-03 15:46:09 +03:00
Richo Healey
cbce6bfbdb
cleanup: Remove unused braces in use statements
2015-03-28 02:23:20 -07:00
Niko Matsakis
37601131a0
Make the Fn
traits inherit from one another and remove the bridging
...
impls.
This requires:
1. modifying trait selection a bit so that when we synthesize impls for
fn pointers and closures;
2. adding code to trans so that we can synthesize a `FnMut`/`FnOnce`
impl for a `Fn` closure and so forth.
2015-03-23 16:46:02 -04:00
Tamir Duberstein
d51047ded0
Strip all leading/trailing newlines
2015-03-15 09:08:21 -07:00
Niko Matsakis
00fcf79448
Remove the synthetic "region bound" from closures and instead update how
...
type-outlives works for closure types so that it ensures that all upvars
outlive the region in question. This gives the same guarantees but
without introducing artificial regions (and gives better error messages
to boot).
2015-03-02 05:45:41 -05:00
Alex Crichton
231eeaa35b
rollup merge of #22502 : nikomatsakis/deprecate-bracket-bracket
...
Conflicts:
src/libcollections/slice.rs
src/libcollections/str.rs
src/librustc/middle/lang_items.rs
src/librustc_back/rpath.rs
src/librustc_typeck/check/regionck.rs
src/libstd/ffi/os_str.rs
src/libsyntax/diagnostic.rs
src/libsyntax/parse/parser.rs
src/libsyntax/util/interner.rs
src/test/run-pass/regions-refcell.rs
2015-02-18 15:48:40 -08:00
Niko Matsakis
9ea84aeed4
Replace all uses of &foo[]
with &foo[..]
en masse.
2015-02-18 17:36:03 -05:00
Kevin Butler
061206b9c7
Remove usage of .map(|&foo| foo)
2015-02-18 00:57:35 +00:00
Eduard Burtescu
f4473a4664
rustc_trans: promote constant rvalues in functions as an optimization.
2015-02-16 17:13:47 +02: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
Niko Matsakis
ced10626de
Address @eddyb nit by simplifying ClosureEnv
.
2015-01-30 05:57:57 -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
Eduard Burtescu
9690be5ece
Adjust most comments and messages to not use "unboxed".
2015-01-26 04:15:09 +02:00
Eduard Burtescu
11ef6f1349
Remove "unboxed" attribute in code referring to new closures.
2015-01-26 04:15:09 +02:00
Ariel Ben-Yehuda
e0eb3ccba0
Kill TraitStore
2015-01-20 00:43:15 +02:00
Alex Crichton
11e265c2e0
rollup merge of #20707 : nikomatsakis/issue-20582
2015-01-07 17:44:24 -08:00
Jorge Aparicio
517f1cc63c
use slicing sugar
2015-01-07 17:35:56 -05:00
Niko Matsakis
bdc1bfd8f1
Rename common::normalize to common::erase_regions
2015-01-07 14:07:58 -05: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
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
f7ff37e4c5
Replace full slice notation with index calls
2015-01-07 10:46:33 +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
643826150b
trans: remove dead code
2015-01-05 17:22:16 -05:00
Jorge Aparicio
8a6d7a68b1
remove mk_closure
2015-01-05 17:22:15 -05:00
Jorge Aparicio
5f7f2c9a05
remove ty_closure
2015-01-05 17:22:15 -05:00
Eduard Burtescu
9a90d436f6
rustc: allow paths in constants to refer to polymorphic items.
2015-01-04 18:47:58 +02:00
Jorge Aparicio
351409a622
sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs
2015-01-03 22:54:18 -05:00
Jorge Aparicio
56dcbd17fd
sed -i -s 's/\bmod,/self,/g' **/*.rs
2015-01-03 22:42:21 -05:00
Niko Matsakis
1e3214ba33
Normalize the associated types in closure and closure upvar types.
2015-01-01 18:48:26 -05:00
Alex Crichton
520cdcb79a
rollup merge of #20217 : luqmana/pc
2014-12-30 16:25:58 -08:00
Niko Matsakis
f95bb55a1c
Move the scalar types out of static data so that we can put Rc
into sty.
2014-12-30 09:34:38 -05:00
Luqman Aden
82ebd2bc20
librustc_trans: Remove some dead code now that procs are gone.
2014-12-30 01:45:22 -05:00
Alex Crichton
3583d613b9
Test fixes and rebase conflicts
2014-12-22 15:17:26 -08: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
5e2bca9e86
librustc_trans: use #[deriving(Copy)]
2014-12-19 10:51:00 -05:00
Niko Matsakis
1205fd88df
Centralize on using Binder
to introduce new binding levels, rather than having FnSig carry an implicit binding level. This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that.
2014-12-19 03:29:30 -05:00
Alex Crichton
2593070d57
rollup merge of #19581 : luqmana/duc
...
Fixes #19575 .
2014-12-09 09:24:41 -08:00
Niko Matsakis
096a28607f
librustc: Make Copy
opt-in.
...
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.
A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.
For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.
This breaks code like:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
Change this code to:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
impl Copy for Point2D {}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
This is the backwards-incompatible part of #13231 .
Part of RFC #3 .
[breaking-change]
2014-12-08 13:47:44 -05:00
Luqman Aden
8ebc1c9fd8
librustc: Fix debuginfo for captured variables in non-FnOnce unboxed closures.
2014-12-05 18:56:40 -05:00
Michael Woerister
251386c605
debuginfo: Make variables captured in unboxed closures available in debuginfo.
2014-11-27 16:38:17 +01:00
Steve Klabnik
cd5c8235c5
/*! -> //!
...
Sister pull request of https://github.com/rust-lang/rust/pull/19288 , but
for the other style of block doc comment.
2014-11-26 16:50:14 -08:00
Ruud van Asseldonk
c724131a86
rustc: Change all ABI constants to all caps.
...
This also removes `box_field_refcnt`. It was not used anywhere.
2014-11-21 17:49:11 +01:00
Ruud van Asseldonk
b781c8b08e
rustc: Unify fat pointer ABI constants.
...
This merges the `trt_field_*`, `fn_field_*` and `slice_elt_*` constants
into two `FAT_PTR_*` constants. This resolves the first part of #18590 .
2014-11-21 17:49:11 +01:00
Eduard Burtescu
9f7aa7fa76
rustc: middle: remove obsolete ty::get.
2014-11-19 06:24:35 +02:00
Eduard Burtescu
4c3ad48c45
rustc: fix fallout of making Ty
an alias for &TyS
instead of a wrapper.
2014-11-19 06:24:35 +02:00
Eduard Burtescu
5bc98954d5
rustc: fix fallout of adding the 'tcx
lifetime to Ty
.
2014-11-19 06:24:34 +02:00
Eduard Burtescu
9706d8f602
rustc: middle: rename ty::t
to Ty
and use it unqualified everywhere.
2014-11-19 06:24:34 +02:00