Commit Graph

8 Commits

Author SHA1 Message Date
Oli Scherer 11ddd22510 Run rustfmt 2021-03-12 13:46:39 +00:00
Oli Scherer 3127a9c60f Prepare mir::Constant for ty::Const only supporting valtrees 2021-03-12 12:43:54 +00:00
LeSeulArtichaut cd049ef9ea Remove useless references/dereferences 2021-03-09 20:15:01 +01:00
LeSeulArtichaut c2c4322891 Make arena allocation for the THIR work 2021-03-09 20:14:42 +01:00
LeSeulArtichaut 60def4de5e [WIP] Eagerly construct bodies of THIR 2021-03-09 20:12:41 +01:00
Santiago Pastorino fe922e567f
Lower inline const down to MIR 2020-10-16 15:21:18 -03:00
Aaron Hill f422ef141a
Add CONST_ITEM_MUTATION lint
Fixes #74053
Fixes #55721

This PR adds a new lint `CONST_ITEM_MUTATION`.
Given an item `const FOO: SomeType = ..`, this lint fires on:

* Attempting to write directly to a field (`FOO.field = some_val`) or
  array entry (`FOO.array_field[0] = val`)
* Taking a mutable reference to the `const` item (`&mut FOO`), including
  through an autoderef `FOO.some_mut_self_method()`

The lint message explains that since each use of a constant creates a
new temporary, the original `const` item will not be modified.
2020-09-07 08:44:35 -04:00
mark 9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00