Niko Matsakis
3b1399df2d
Make calling def_id on a DefSelfTy an error; the previous defids that
...
were returned, either the trait or the *self type itself*, were not
particularly representative of what the Def is (a type parameter).
Rewrite paths to handle this case specially, just as they handle the
primitive case specifically. This entire `def_id` codepath is kind of a
mess.
2015-10-01 10:37:19 -04:00
Niko Matsakis
cb784b70ba
Remove DefRegion, which is not used
2015-10-01 10:37:19 -04:00
Vadim Petrochenkov
eedb95101b
Fill in some missing parts in the default AST visitor
...
+ Add helper macro for walking lists (including Options)
2015-09-28 23:06:43 +03:00
Vadim Petrochenkov
f284cbc7af
Cleanup interfaces of Name, SyntaxContext and Ident
...
Make sure Name, SyntaxContext and Ident are passed by value
Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24 23:05:02 +03:00
Vadim Petrochenkov
40ce80484c
Remove random Idents outside of libsyntax
2015-09-23 20:04:49 +03:00
Nick Cameron
66f662f37d
Fix crash with --save-analysis
...
Should be lowering ast expressions to HIR expressions, not cheating via the hir map. That goes wrong now that there is not a 1:1 mapping between ast and hir (in the case of the crash due to ExprParen).
2015-09-18 16:41:11 +12:00
Nick Cameron
6a127e95c7
fixup
2015-09-05 09:45:35 +12:00
Nick Cameron
edca8f73d6
rustfmt librustc_trans/save
2015-09-05 09:45:35 +12:00
Nick Cameron
facdf2ebb1
Add an intital HIR and lowering step
2015-09-03 10:02:36 +12:00
Niko Matsakis
e91bef2e05
fallout from moving def-id
2015-08-24 05:35:34 -04:00
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
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
bors
55ede7ed8e
Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb
...
this has quite some fallout. but also made lots of stuff more readable imo
[breaking-change] for plugin authors
2015-07-28 21:14:28 +00:00
Oliver Schneider
00a5e66f81
remove get_ident
and get_name
, make as_str
sound
2015-07-28 18:07:20 +02:00
Nick Cameron
f91a20bbfb
save-analysis: return an Option from get_path_data
2015-07-25 17:47:26 +12:00
Felix S. Klock II
91493df752
Work around unary negation to-be-feature-gated warning by
...
replacing references to `-1` as a `ast::NodeId` with `ast::DUMMY_NODE_ID`,
which seems like a better notation to use (it is currently also `-1`.
(AFAICT the code is not *relying* on the value `-1` anywhere, it
really just needed a dummy value for when the input is `None`.)
2015-07-21 18:12:06 +02:00
Nick Cameron
41b056823c
save-analysis: tweak constructors
2015-07-14 14:21:54 +12:00
Nick Cameron
0c766cb8bc
save-analysis: API-ify methods
2015-07-09 12:24:39 +12:00
Nick Cameron
df5a1ca880
save-analysis: factor out helper method
2015-07-09 12:24:39 +12:00
Nick Cameron
374af4aea7
save-analysis: API-ify paths
2015-07-09 12:24:39 +12:00
Nick Cameron
8ac0bce64e
save-analysis: api-ify method calls
2015-07-09 12:24:39 +12:00
Eduard Burtescu
d256eb1c5d
rustc: remove MethodOrigin and use the container to distinguish inherent methods.
2015-07-04 17:51:31 +03:00
Eduard Burtescu
96d24a5c58
rustc: remove MethodOrigin::Object and use traits::VtableObject instead.
2015-07-04 06:21:00 +03:00
Eduard Burtescu
5620a58791
rustc_lint: use traits::select for methods in unconditional_recursion.
2015-07-04 06:21:00 +03:00
Eduard Burtescu
70365ed911
rustc: simplify ty::MethodOrigin and avoid trait item indices.
2015-07-04 06:21:00 +03:00
Eduard Burtescu
fe354e58bd
rustc: remove unused MethodStaticClosure variant of MethodOrigin.
2015-07-04 06:21:00 +03:00
bors
f027bdc1c8
Auto merge of #26378 - arielb1:unused-mut, r=pnkfelix
...
This makes it somewhat more aggressive, so this is kind-of a [breaking-change] for these compiling with `#[deny(unused_mut)]`.
r? @pnkfelix
2015-07-03 21:31:46 +00:00
Nick Cameron
a1d40c81f9
save-analysis: skip generated content in patterns
2015-07-01 15:53:08 +12:00
Ariel Ben-Yehuda
a18d9842ed
Make the unused_mut lint smarter with respect to locals.
...
Fixes #26332
2015-07-01 00:12:12 +03: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
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
Eduard Burtescu
2e997ef2d4
rustc: remove ownership of tcx from trans' context.
2015-06-19 01:18:42 +03:00
Nick Cameron
718268398e
Rebasing and bug fixing
2015-06-15 10:06:01 +12:00
Nick Cameron
92d6676412
save-analysis: use a macro for 'downcasting'
2015-06-15 08:16:35 +12:00
Nick Cameron
788fdddf37
save-analysis: API-ify struct lits
2015-06-15 08:16:35 +12:00
Nick Cameron
04b32cecac
save-analysis: merge StructRef and TypeRef
2015-06-15 08:15:29 +12:00
Nick Cameron
78c25eabd5
save-analysis: API-ify impls
2015-06-15 08:15:29 +12:00
Nick Cameron
abe5f7b95a
save-analysis: move fields to the API
2015-06-15 08:14:50 +12: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
d7f5fa4636
Conver reborrows to .iter() calls where appropriate
2015-06-11 13:56:07 +01:00
Joshua Landau
ca7418b846
Removed many pointless calls to *iter() and iter_mut()
2015-06-10 21:14:03 +01:00
Eduard Burtescu
76eaed44d9
syntax: move ast_map to librustc.
2015-06-10 02:40:45 +03:00
Simon Sapin
c160192f5f
Replace usage of String::from_str with String:from
2015-06-08 16:55:35 +02:00
Peter Elmers
1ef0ad8adc
Change &String[..] to just &String, since it coerces to &str automatically.
2015-06-02 12:21:49 -07:00
Peter Elmers
6812ca1cc8
Move EnumData to the API.
2015-06-02 12:21:20 -07:00