Paul Daniel Faria
08182aa9fa
Move unsafe packed ref logic to Semantics, use Attrs::by_key
to simplify repr attr lookup
2020-08-10 08:44:54 -04:00
Paul Daniel Faria
38440d53d8
Cleanup repr check, fix packed repr check and test
2020-08-10 08:44:54 -04:00
Paul Daniel Faria
263f9a7f23
Add tracking of packed repr, use it to highlight unsafe refs
...
Taking a reference to a misaligned field on a packed struct is an
unsafe operation. Highlight that behavior. Currently, the misaligned
part isn't tracked, so this highlight is a bit too aggressive.
2020-08-10 08:44:54 -04:00
Aleksey Kladov
f95f425ae4
Use ty to access most TypeRefs
2020-07-30 21:02:55 +02:00
Aleksey Kladov
2e2642efcc
Remove TypeAscriptionOwner
2020-07-30 20:51:43 +02:00
Aleksey Kladov
1766aae145
Rename EnumVariant -> Variant
2020-07-30 17:56:53 +02:00
Aleksey Kladov
609680ef97
Rename EnumDef -> Enum
2020-07-30 17:52:53 +02:00
Aleksey Kladov
0a9e3ccc26
Rename FieldDef -> Field
2020-07-30 16:49:13 +02:00
Jonas Schievink
dad2f75b91
Use ItemTree to answer enum_data query
2020-06-25 16:52:47 +02:00
Jonas Schievink
2a8fc9e682
adt.rs: fetch struct/union data from item tree
2020-06-25 16:41:08 +02:00
Benjamin Coenen
831bb1cf91
refactor: use attrsOwner directly in is_cfg_enabled
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-05 09:34:07 +02:00
Benjamin Coenen
bed115d6e1
add support of cfg attributes on enum variants #4279
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-03 17:56:45 +02:00
Edwin Cheng
bdcf6f5658
Introduce LowerCtx for path lowering
2020-05-01 20:01:17 +08:00
Aleksey Kladov
970dbf8717
Rename StructField -> Field
2020-04-25 14:23:34 +02:00
Aleksey Kladov
38c67e5c0d
Avoid cyclic queries in name resolution when processing enums
2020-04-11 17:52:26 +02:00
Aleksey Kladov
deb40d52aa
Align naming
2020-04-11 17:20:26 +02:00
Aleksey Kladov
b8eb1597c9
Use Expander for cfg handling in structs
2020-04-11 17:17:12 +02:00
Benjamin Coenen
fc70cf9458
feat: add support for feature attributes in struct literal
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-09 18:32:02 +02:00
Benjamin Coenen
8f1dba6f9a
feat: add attributes support on struct fields and method #3870
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-08 18:12:15 +02:00
Benjamin Coenen
ab864ed259
feat: add attributes support on struct fields #3870
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-07 17:58:05 +02:00
Aleksey Kladov
f840fcb2f5
Simplify Arena to use a generic index
2020-03-19 18:46:30 +01:00
Aleksey Kladov
9faea2364d
Use dyn Trait
for working with databse
...
It improves compile time in `--release` mode quite a bit, it doesn't
really slow things down and, conceptually, it seems closer to what we
want the physical architecture to look like (we don't want to
monomorphise EVERYTHING in a single leaf crate).
2020-03-16 17:42:30 +01:00
Florian Diebold
f1f45f9191
Fix handling of const patterns
...
E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).
Fixes #1618 .
2020-02-21 17:01:19 +01:00
adamrk
68d3743faf
replace uses of VariantData::is_unit with VariantData::kind
2020-02-16 16:10:32 +01:00
adamrk
04aff742b1
show names for record fields in enum completion
2020-02-16 16:10:23 +01:00
Florian Diebold
78111620a3
Remove visibility query, instead add struct field visibility to data
...
Methods should be handled the same, and for items the visibility will be in the
def map.
2019-12-26 16:23:40 +01:00
Aleksey Kladov
e903f58d29
More profiling
2019-12-21 19:44:08 +01:00
Aleksey Kladov
56710f119b
Move enum&union to new loc
2019-12-12 15:11:57 +01:00
Aleksey Kladov
f135a8ea55
Move structs to new loc
2019-12-12 14:58:04 +01:00
ice1000
009437f5d9
Replace ra_hir_expand::either
with crate
2019-12-03 11:07:56 -05:00
Aleksey Kladov
8f1f5a783a
Move source-related traits to a separate module
2019-11-28 19:05:21 +03:00
Aleksey Kladov
ccd1b0800a
Rename Source -> InFile
2019-11-28 12:50:26 +03:00
Aleksey Kladov
1d14fd1737
Use Name::missing consistently
2019-11-27 23:22:20 +03:00
Aleksey Kladov
a443b5033c
Id-ify Ty::Adt
2019-11-26 14:29:12 +03:00
Aleksey Kladov
1455663ea1
Fixme for union fields
2019-11-25 17:50:49 +03:00
Aleksey Kladov
5fd68b5929
Fix hir for ast::UnionDef
2019-11-25 17:50:49 +03:00
Aleksey Kladov
586acef528
Simplify ADT fields
2019-11-24 22:44:24 +03:00
Aleksey Kladov
855a629b14
Use Trace in raw_items
2019-11-24 17:49:49 +03:00
Aleksey Kladov
fc1e543f7a
Get rid of DefDatabase2
2019-11-23 14:49:45 +03:00
Aleksey Kladov
0f415dd4b3
More principled sources for enums and fields
2019-11-22 23:09:17 +03:00
Aleksey Kladov
d8caf56dfc
Uniformalize naming
2019-11-22 21:52:06 +03:00
Aleksey Kladov
36e3fc9d54
Rename Source::ast -> Source::value
2019-11-20 09:42:30 +03:00
Aleksey Kladov
6294fd5ec9
Unfork struct and union ids
2019-11-09 15:34:00 +03:00
Aleksey Kladov
ba2efca2bb
Move CrateDefMap to hir_def
2019-11-03 18:04:06 +03:00
Aleksey Kladov
09f9733ca6
move struct & enum data to hir_def
2019-10-31 16:40:36 +03:00