rust/src/librustc_mir
bors 42001edc99 Auto merge of #35403 - scottcarr:lvalue_refactor, r=nikomatsakis
refactor lvalue_ty to be method of lvalue

Currently `Mir` (and `MirContext`) implement a method `lvalue_ty` (and actually many more `foo_ty`).  But this should be a method of `Lvalue`.

If you have an `lvalue` and you want to get its type, the natural thing to write is:

```
lvalue.ty()
```

Of course it needs context, but still:

```
lvalue.ty(mir, tcx)
```

Makes more sense than

```
mir.lvalue_ty(lvalue, tcx)
```

I actually think we should go a step farther and have traits so we could get the type of some value generically, but that's up for debate.  The thing I'm running into a lot in the compiler is I have a value of type `Foo` and I know that there is some related type `Bar` which I can get through some combination of method calls, but it's often not as direct as I would imagine.  Unless you already know the code, its not clear why you would look in `Mir` for a method to get the type of an `Lvalue`.
2016-08-11 05:04:41 -07:00
..
build Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
hair track MIR through the dep-graph 2016-08-08 18:44:24 -04:00
transform Auto merge of #35403 - scottcarr:lvalue_refactor, r=nikomatsakis 2016-08-11 05:04:41 -07:00
Cargo.toml Fix Cargo.tomls 2016-06-27 18:30:46 +00:00
diagnostics.rs Implement RFC 1440 "Allow Drop types in statics/const functions". 2016-05-07 19:14:33 +03:00
graphviz.rs track MIR through the dep-graph 2016-08-08 18:44:24 -04:00
lib.rs Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
mir_map.rs track MIR through the dep-graph 2016-08-08 18:44:24 -04:00
pretty.rs track MIR through the dep-graph 2016-08-08 18:44:24 -04:00