about summary refs log tree commit diff
path: root/src/test/run-pass/const-enum-vec-index.rs
AgeCommit message (Collapse)AuthorLines
2018-09-06Migrated slew of run-pass tests to various subdirectories of `ui/run-pass/`.Felix S. Klock II-39/+0
2017-02-19fix run-pass test that required `Copy` implNiko Matsakis-0/+2
2015-11-18allow indexing into constant arraysOliver Schneider-5/+4
2015-06-13Use `assert_eq!` instead of `assert!` in testspetrochenkov-2/+2
2015-04-08Remove pretty-expanded from failing testsAlex Crichton-1/+0
This commit removes pretty-expanded from all tests that wind up calling panic! one way or another now that its internals are unstable.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-1/+1
Now that support has been removed, all lingering use cases are renamed.
2015-03-23rustdoc: Replace no-pretty-expanded with pretty-expandedBrian Anderson-0/+2
Now that features must be declared expanded source often does not compile. This adds 'pretty-expanded' to a bunch of test cases that still work.
2014-12-20Allow use of `[_ ; n]` syntax for fixed length and repeating arrays.Nick Cameron-1/+1
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
2014-11-17Switch to purely namespaced enumsSteven Fackler-6/+6
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-29Rename fail! to panic!Steve Klabnik-4/+4
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-09test: Convert statics to constantsAlex Crichton-2/+2
Additionally, add lots of tests for new functionality around statics and `static mut`.
2014-08-26DST coercions and DST structsNick Cameron-0/+12
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-2/+2
Who doesn't like a massive renaming?
2013-09-30rpass: Remove usage of fmt!Alex Crichton-2/+2
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+1
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-1/+1
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-3/+3
2013-03-07test: Fix tests.Patrick Walton-1/+1
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-1/+1
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-02-17`pub fn main` for run-pass tests that didn't have itJed Davis-1/+1
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-2/+2
2013-02-07Fix vector indexing in consts so it works with the enum vector const fix.Jed Davis-0/+25