Vadim Petrochenkov
46750d0409
Merge VariantData and VariantData_
2015-10-13 15:19:27 +03:00
Vadim Petrochenkov
40aa09e4c9
Merge struct fields and struct kind
2015-10-13 15:19:25 +03:00
Vadim Petrochenkov
30af54dede
Dict -> Struct, StructDef -> VariantData, def -> data
2015-10-13 15:19:24 +03:00
Vadim Petrochenkov
beda1f88a7
Provide span for visit_struct_def + remove some dead code
2015-10-13 15:19:19 +03:00
Vadim Petrochenkov
877c35e8a2
Remove now redundant NodeId from Variant
2015-10-13 15:19:18 +03:00
Vadim Petrochenkov
495566ee61
Decouple structure kinds from NodeIds
2015-10-13 15:19:17 +03:00
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
5600c6282e
move direct accesses of node
to go through as_local_node_id
, unless
...
they are being used as an opaque "position identifier"
2015-10-01 10:37:19 -04:00
Niko Matsakis
9ff4f57cd0
move job of creating local-def-ids to ast-map (with a few stragglers)
2015-10-01 10:28:28 -04:00
Vadim Petrochenkov
2a779062d8
Use Names in the remaining HIR structures with exception of...
...
PathSegment, PatIdent, ExprWhile, ExprLoop, ExprBreak and ExprAgain - they need Idents for resolve
2015-09-22 19:58:29 +03:00
Vadim Petrochenkov
64fb709f99
Use Names in hir::{Field, ExprMethodCall, ExprField}
2015-09-22 19:53:53 +03:00
Vadim Petrochenkov
a4af958786
Use Names in HIR Items
2015-09-22 19:53:52 +03:00
Vadim Petrochenkov
ae77dbb835
Use Names in HIR visitors and folders
2015-09-22 19:52:53 +03:00
Vadim Petrochenkov
50e42ea9f7
Correctly walk import lists in AST visitors
2015-09-17 14:13:12 +03:00
Nick Cameron
e9f1b06329
Use ast attributes every where (remove HIR attributes).
...
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-16 10:57:06 +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
Tim Neumann
2d4e07edb5
Fix #23808 : dead_code lint: visit types in paths
2015-08-12 08:22:08 +02: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
d256eb1c5d
rustc: remove MethodOrigin and use the container to distinguish inherent methods.
2015-07-04 17:51:31 +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
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
Seo Sanghyeon
6f7b4ce65a
Do not consider fields matched by wildcard patterns to be used
2015-06-22 21:36:14 +09:00
bors
e7a5a1c33a
Auto merge of #25961 - sanxiyn:dead-variant-2, r=huonw
...
Rebase of #21468 .
Fix #25960 .
2015-06-17 13:30:31 +00: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
Eduard Burtescu
76eaed44d9
syntax: move ast_map to librustc.
2015-06-10 02:40:45 +03:00
Seo Sanghyeon
5af8b5f72b
Extend dead code lint to detect more unused enum variants
2015-06-02 20:31:40 +09:00
Sean Patrick Santos
91ae5e31ab
Fix dead code check for associated const impls.
2015-04-23 21:02:28 -06:00
Sean Patrick Santos
b5499775d6
Structural changes for associated constants
...
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23 21:02:25 -06:00
Tamir Duberstein
10f15e72e6
Negative case of len()
-> is_empty()
...
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14 20:26:03 -07:00
Nick Cameron
01678acf50
Expose visibility for fns in syntax::visit
2015-04-14 09:54:58 +12:00
Jonathan S
3cbc345cf7
In librustc*, convert many uses of ast::Ident to ast::Name, fixing much of #6993 .
2015-04-03 17:46:08 -05: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
Manish Goregaokar
c908d1c1f9
Revert "Extend dead code lint to detect more unused enum variants"
...
This reverts commit b042ffc4a7
.
Conflicts:
src/librustc/middle/pat_util.rs
2015-03-14 12:14:32 +05:30
Manish Goregaokar
0d37323fd3
Rollup merge of #21468 - sanxiyn:dead-variant, r=
...
This implements a wish suggested in #17410 , detecting enum variants that are never constructed, even in the presence of `#[derive(Clone)]`. The implementation is general and not specific to `#[derive(Clone)]`.
r? @jakub-
2015-03-13 18:12:05 +05:30
Eduard Burtescu
9da918548d
syntax: move MethMac to MacImplItem and combine {Provided,Required}Method into MethodTraitItem.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
f98b176314
syntax: gather common fields of impl & trait items into their respective types.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
98491827b9
syntax: move indirection around {Trait,Impl}Item, from within.
2015-03-11 23:39:15 +02:00
Eduard Burtescu
5a6a9ed792
rustc: combine partial_def_map and last_private_map into def_map.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
ffb8092ccf
syntax: use a single Path for Trait::Item in QPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
004df413aa
syntax: don't use TraitRef in QPath.
2015-02-24 14:14:16 +02:00
Niko Matsakis
9ea84aeed4
Replace all uses of &foo[]
with &foo[..]
en masse.
2015-02-18 17:36:03 -05:00
Alex Crichton
c9fdfdb2bb
rollup merge of #22048 : LeoTestard/impl-patterns-used
...
The live code analysis only visited the function's body when visiting a
method, and not the FnDecl and the generics, resulting in code to be
incorrectly marked as unused when it only appeared in the generics, the
arguments, or the return type, whereas the same code in non-method
functions was correctly detected as used. Fixes #20343 .
Originally I just added a call to `walk_generics` and `walk_fndecl` alongside `walk_block` but then I noticed the `walk_method_helper` function did pretty much the same thing. The only difference is that it also calls `visit_mac`, but since this is not going to happen at this stage, I think it's ok. However let me know if this was not the right thing to do.
2015-02-11 14:02:02 -08:00
Leo Testard
73201fd675
Make the live code analysis visit method declarations.
...
The live code analysis only visited the function's body when visiting a
method, and not the FnDecl and the generics, resulting in code to be
incorrectly marked as unused when it only appeared in the generics, the
arguments, or the return type, whereas the same code in non-method
functions was correctly detected as used. Fixes #20343 .
2015-02-10 18:27:05 +01:00
GuillaumeGomez
664c41b427
librustc has been updated
2015-02-06 11:59:10 +01:00