about summary refs log tree commit diff
path: root/src/test/compile-fail/check-static-values-constraints.rs
AgeCommit message (Collapse)AuthorLines
2018-08-14Moved compile-fail tests to ui tests.David Wood-123/+0
2017-09-09Stabilize drop_types_in_const.Eduard-Mihai Burtescu-26/+1
2017-08-28rustc_mir: conservatively deny non-noop drops in constant contexts.Eduard-Mihai Burtescu-1/+2
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-0/+1
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-01-12Mark even more tests as gate testsest31-0/+2
Now, no feature outside of the whitelist is without a test marked as its gate test.
2016-05-07Implement RFC 1440 "Allow Drop types in statics/const functions".Eduard Burtescu-13/+13
2016-05-07test: adjust for the move to MIR-based const checking.Eduard Burtescu-0/+1
2015-05-21Make various fixes:Niko Matsakis-1/+1
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-02-16rustc: merge check_static into check_const.Eduard Burtescu-7/+8
2015-01-08Update compile fail tests to use isize.Huon Wilson-4/+4
2015-01-07Test fixes and rebase conflictsAlex Crichton-0/+2
2015-01-07markers -> markerNick Cameron-1/+1
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-1/+1
[breaking-change]
2014-11-17Switch to purely namespaced enumsSteven Fackler-17/+21
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-10-09test: Convert statics to constantsAlex Crichton-23/+27
Additionally, add lots of tests for new functionality around statics and `static mut`.
2014-10-02tests: remove uses of Gc.Eduard Burtescu-4/+0
2014-08-09Fix misspelled comments for tests.Joseph Crail-1/+1
2014-07-26Remove managed_box gate from testsBrian Anderson-1/+0
No longer does anything.
2014-07-04librustc: Remove the `&LIFETIME EXPR` production from the language.Patrick Walton-2/+2
This was parsed by the parser but completely ignored; not even stored in the AST! This breaks code that looks like: static X: &'static [u8] = &'static [1, 2, 3]; Change this code to the shorter: static X: &'static [u8] = &[1, 2, 3]; Closes #15312. [breaking-change]
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-9/+10
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-1/+1
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-14test: Remove all uses of `~str` from the test suite.Patrick Walton-2/+5
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-5/+6
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-4/+6
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-03-20Allow static items that don't fulfill `Freeze`Flavio Percoco-24/+0
2014-02-27Immutable static items should be `Freeze` Fixes #12432Flavio Percoco-0/+26
2014-02-27Forbid certain types for static itemsFlavio Percoco-0/+128
- For each *mutable* static item, check that the **type**: - cannot own any value whose type has a dtor - cannot own any values whose type is an owned pointer - For each *immutable* static item, check that the **value**: - does not contain any ~ or box expressions (including ~[1, 2, 3] sort of things) - does not contain a struct literal or call to an enum variant / struct constructor where - the type of the struct/enum has a dtor