Ariel Ben-Yehuda
eedb1cc576
rename ADTDef to AdtDef etc.
2015-08-07 15:03:09 +03:00
Ariel Ben-Yehuda
5f3c1412ad
use VariantDef instead of struct_fields
2015-08-06 16:54:40 +03:00
Ariel Ben-Yehuda
4816e60667
create VariantDef-s (but don't actually use them)
2015-08-06 15:57:52 +03:00
Ariel Ben-Yehuda
764310e7bb
introduce an ADTDef struct for struct/enum definitions
2015-08-06 14:16:56 +03:00
Eduard Burtescu
a34b0a4691
rustc: replace def::MethodProvenance with ty::ImplOrTraitItemContainer.
2015-08-04 01:16:53 +03:00
Oliver Schneider
00a5e66f81
remove get_ident
and get_name
, make as_str
sound
2015-07-28 18:07:20 +02:00
mitaa
19512be113
Sidestep warning about repeated E0005 span_err!
invocation.
...
Fixes #27279
2015-07-26 09:56:28 +02:00
mitaa
adfdbc4bd7
Remove ast::LocalSource
with only one used variant
...
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-26 08:56:29 +02:00
Manish Goregaokar
688a09910a
Move E0006 into E0005
2015-07-23 12:45:11 +05:30
Eli Friedman
6bdfb05347
Clarify the usage of "hints" in const_eval.
...
The "hint" mechanism is essentially used as a workaround to compute
types for expressions which have not yet been type-checked. This
commit clarifies that usage, and limits the effects to the places
where it is currently necessary.
Fixes #26210 .
2015-07-17 18:29:34 -07:00
bors
adcae006d2
Auto merge of #26895 - jroesch:modernize-typeck-names, r=nikomatsakis
...
This PR modernizes some names in the type checker. The only remaining snake_case name in ty.rs is `ctxt` which should be resolved by @eddyb's pending refactor. We can bike shed over the names, it would just be nice to bring the type checker inline with modern Rust.
r? @eddyb
cc @nikomatsakis
2015-07-12 19:22:11 +00:00
Simonas Kazlauskas
7a90865db5
Implement RFC 1058
2015-07-12 00:47:56 +03:00
Jared Roesch
1a268f4d1b
Rename TypeWithMutability to TypeAndMut
2015-07-10 18:27:06 -07:00
Ulrik Sverdrup
836f32e769
Use vec![elt; n] where possible
...
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is
exactly equivalent to `vec![elt; n]`, do this replacement in the whole
tree.
(Actually, vec![] is smart enough to only call clone n - 1 times, while
the former solution would call clone n times, and this fact is
virtually irrelevant in practice.)
2015-07-09 11:05:32 +02:00
Jared Roesch
754aaea88c
Remove snake_case names from ty.rs
2015-07-08 12:38:19 -07:00
Jared Roesch
ce089e50a4
Address nits
2015-07-01 13:08:25 -07:00
Jared Roesch
9faae6a5ca
Remove Typer and ClosureTyper
...
This commit finalizes the work of the past commits by fully moving the fulfillment context into
the InferCtxt, cleaning up related context interfaces, removing the Typer and ClosureTyper
traits and cleaning up related intefaces
2015-06-30 02:41:40 -07:00
Jared Roesch
e2d7e904ca
Remove Typer + ClosureTyper impls for ParameterEnv
2015-06-30 02:40:17 -07:00
Jared Roesch
79d02895ff
Begin refactor type checking state
...
This first patch starts by moving around pieces of state related to
type checking. The goal is to slowly unify the type checking state
into a single typing context. This initial patch moves the
ParameterEnvironment into the InferCtxt and moves shared tables
from Inherited and ty::ctxt into their own struct Tables. This
is the foundational work to refactoring the type checker to
enable future evolution of the language and tooling.
2015-06-27 13:43:20 -07:00
Eduard Burtescu
ad66c215aa
rustc: switch most remaining middle::ty functions to methods.
2015-06-26 07:34:57 +03:00
Eduard Burtescu
6db5126240
rustc: make ty::mk_* constructors into methods on ty::ctxt.
2015-06-26 07:34:56 +03:00
Eduard Burtescu
59935f70e0
rustc: move some functions in middle::ty working on Ty to methods.
2015-06-26 07:34:56 +03:00
Oliver Schneider
88b03f349e
change const_val
enum and its variants to camel-case
2015-06-23 10:31:32 +02:00
Eduard Burtescu
0b58fdf925
rustc: remove Repr and UserString.
2015-06-19 01:39:26 +03:00
Eduard Burtescu
a3727559c6
rustc: use the TLS type context in Repr and UserString.
2015-06-19 01:32:44 +03:00
Eduard Burtescu
96ad4a4863
rustc: use Repr and UserString instead of ppaux::ty_to_string.
2015-06-19 01:18:43 +03:00
Eli Friedman
33b7386d39
Split TyArray into TyArray and TySlice.
...
Arrays and slices are closely related, but not that closely; making the
separation more explicit is generally more clear.
2015-06-12 16:50:13 -07:00
Eli Friedman
3c69db4c3c
Cleanup: rename middle::ty::sty and its variants.
...
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-12 11:07:16 -07:00
Joshua Landau
ca7418b846
Removed many pointless calls to *iter() and iter_mut()
2015-06-10 21:14:03 +01:00
Sean Patrick Santos
29eb550ee6
Get associated consts working in match patterns.
2015-04-23 21:02:29 -06:00
Sean Patrick Santos
7129e8815e
Functional changes for associated constants. Cross-crate usage of associated constants is not yet working.
2015-04-23 21:02:26 -06:00
Tamir Duberstein
29ac04402d
Positive case of len()
-> is_empty()
...
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14 20:26:03 -07:00
Tobias Bucher
97f24a8596
Make sum
and product
inherent methods on Iterator
...
In addition to being nicer, this also allows you to use `sum` and `product` for
iterators yielding custom types aside from the standard integers.
Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this
is a breaking change.
[breaking-change]
2015-04-08 00:26:35 +02:00
Niko Matsakis
d9530c01a7
Fallout out rustc
2015-04-01 11:22:39 -04:00
Manish Goregaokar
5eb4be4c56
Rollup merge of #23803 - richo:unused-braces, r=Manishearth
...
Pretty much what it says on the tin.
2015-03-28 18:12:06 +05:30
Richo Healey
cbce6bfbdb
cleanup: Remove unused braces in use statements
2015-03-28 02:23:20 -07:00
Alex Crichton
43bfaa4a33
Mass rename uint/int to usize/isize
...
Now that support has been removed, all lingering use cases are renamed.
2015-03-26 12:10:22 -07:00
Niko Matsakis
8e58af4004
Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses of
...
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about
how to use `[]`.
2015-03-23 16:55:45 -04:00
Alex Crichton
fccf5a0005
Register new snapshots
2015-03-18 16:32:32 -07:00
Jorge Aparicio
8256241d3a
impl f{32,64}
2015-03-16 21:57:43 -05:00
Barosl Lee
edbc0e509f
check_match: Dereference ref x
before comparing it and some other type
...
The arity of `ref x` is always 1, so it needs to be dereferenced before
being compared with some other type whose arity is not 1.
Fixes #23009 .
2015-03-14 23:32:57 +09:00
Richo Healey
061d84399e
remove uses of as_slice where deref coercions can be used
2015-03-09 07:54:19 -07:00
Manish Goregaokar
c8c4d85b50
Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw
...
When warnings and errors occur, the associated help message should not print the same code snippet.
https://github.com/rust-lang/rust/issues/21938
2015-03-05 12:38:32 +05:30
Ivan Radanov Ivanov
7496539a00
Change span_help calls to fileline_help where appropriate
2015-03-03 15:18:33 +02:00
Felix S. Klock II
5d950bd37d
Switch to eval_const_expr_partial
when check_match.rs
checks for NaN
.
2015-03-03 12:10:58 +01:00
Eduard Burtescu
5a6a9ed792
rustc: combine partial_def_map and last_private_map into def_map.
2015-02-24 14:16:02 +02:00
Niko Matsakis
68e5bb3f2c
Remove remaining uses of []
. This time I tried to use deref coercions where possible.
2015-02-20 14:08:14 -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
Alex Crichton
5a32b4a34f
rollup merge of #22491 : Gankro/into_iter
...
Conflicts:
src/libcollections/bit.rs
src/libcollections/linked_list.rs
src/libcollections/vec_deque.rs
src/libstd/sys/common/wtf8.rs
2015-02-18 14:34:08 -08:00