summary refs log tree commit diff
path: root/src/librustc/middle/check_static_recursion.rs
AgeCommit message (Collapse)AuthorLines
2015-10-16Provide span for visit_enum_defVadim Petrochenkov-1/+1
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-3/+3
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-3/+3
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-8/+9
2015-10-01move direct accesses of `node` to go through `as_local_node_id`, unlessNiko Matsakis-25/+31
they are being used as an opaque "position identifier"
2015-09-08Allow tracking issues for lang features.Huon Wilson-2/+2
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-03Add an intital HIR and lowering stepNick Cameron-26/+27
2015-08-24fallout from moving def-idNiko Matsakis-5/+3
2015-08-04rustc: replace def::MethodProvenance with ty::ImplOrTraitItemContainer.Eduard Burtescu-1/+1
2015-07-24Add static_recursion feature gate.Eli Friedman-4/+26
2015-07-24Allow recursive static variables.Eli Friedman-3/+1
There isn't any particularly good reason for this restriction, so just get rid of it, and fix trans to handle this case.
2015-07-08Add comments about the checks for recursive variant definition, as requested ↵Sean Patrick Santos-0/+4
by @nrc.
2015-06-22Fix issue #23302, ICE on recursively defined enum variant discriminant.Sean Patrick Santos-34/+136
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-2/+2
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-37/+75
constants is not yet working.
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-2/+2
2015-02-24rustc: combine partial_def_map and last_private_map into def_map.Eduard Burtescu-3/+3
2015-01-20Add error codes to rustcBrian Anderson-4/+4
2015-01-15syntax: add fully qualified UFCS expressions.Eduard Burtescu-1/+1
2015-01-07use slicing sugarJorge Aparicio-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-1/+1
2014-12-20rustc: middle: move DefMap from resolve to def.Eduard Burtescu-6/+5
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-1/+1
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-06Fallout from collection conventionsAlexis Beingessner-1/+1
2014-10-29check_static_recursion: Handle foreign itemsBen Gamari-1/+11
2014-10-09rustc: Add `const` globals to the languageAlex Crichton-13/+15
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-09-14Separate static item recursion check into its own passBrian Koropoff-0/+109
This new pass is run before type checking so that recursive items are detected beforehand. This prevents going into an infinite recursion during type checking when a recursive item is used in an array type. As a bonus, use `span_err` instead of `span_fatal` so multiple errors can be reported. Closes issue #17252