summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2016-01-19Add an impl for Box<Error> from &str.Michael Sproul-0/+2
2016-01-19Add an impl for Box<Error> from String.Michael Sproul-0/+18
Closes #30156.
2016-01-12Update test -- here we get a RFC 1214 warning (that will eventually beNiko Matsakis-1/+3
an error) but the bugfix causes this warning to propagate and become an unresolved variable instead of a `TyError`, so we wind up seeing an obscure inference error afterwards, which is somewhat unfortunate, and suggests this bugfix can cause RFC 1214 warnings to become errors.
2015-12-09Auto merge of #30245 - Aatch:dynamic-align-dst, r=pnkfelixbors-0/+87
Fixes #26403 This adjusts the pointer, if needed, to the correct alignment by using the alignment information in the vtable. Handling zero might not be necessary, as it shouldn't actually occur. I've left it as it's own commit so it can be removed fairly easily if people don't think it's worth doing. The way it's handled though means that there shouldn't be much impact on performance.
2015-12-08Fix unsized structs with destructorsJames Miller-1/+17
The presence of the drop flag caused the offset calculation to be incorrect, leading to the pointer being incorrect. This has been fixed by calculating the offset based on the field index (and not assuming that the field is always the last one). However, I've also stopped the drop flag from being added to the end of unsized structs to begin with. Since it's not actually accessed for unsized structs, and isn't actually where we would say it is, this made more sense.
2015-12-07Auto merge of #30202 - oli-obk:fix/const_index_feature_gate, r=Aatchbors-0/+15
see https://github.com/rust-lang/rust/issues/29947#issuecomment-161781257 I also added some missing tests
2015-12-08Align pointers to DST fields properlyJames Miller-0/+71
DST fields, being of an unknown type, are not automatically aligned properly, so a pointer to the field needs to be aligned using the information in the vtable. Fixes #26403 and a number of other DST-related bugs discovered while implementing this.
2015-12-07Add regression test for Clone for [[T; 256]; 4] where T: Copy and not CloneUlrik Sverdrup-0/+18
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-80/+31
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-80/+31
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05fix const index feature-gate regressionOliver Schneider-0/+15
2015-12-04Auto merge of #30084 - oli-obk:const_fn, r=pnkfelixbors-0/+2
2015-12-04Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelixbors-0/+130
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701 - Added syntax support for attributes on expressions and all syntax nodes in statement position. - Extended `#[cfg]` folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. - Extended lint checker to recognize lint levels on expressions and locals. - As per RFC, attributes are not yet accepted on `if` expressions. Examples: ```rust let x = y; { ... } assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3)); let FOO = 0; ``` Implementation wise, there are a few rough corners and open questions: - The parser work ended up a bit ugly. - The pretty printer change was based mostly on guessing. - Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts, but where it seemed weird to accept attributes and hence the parser doesn't. This includes: - const expressions in patterns - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls) - on range expressions, since `#[attr] x .. y` parses as `(#[attr] x) .. y`, which is inconsistent with `#[attr] .. y` which would parse as `#[attr] (.. y)` - Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals. - Memory impact has not been measured yet. - A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work: ```rust let x = { #[cfg(foo)] Foo { data: x } #[cfg(not(foo))] Foo { data: y } }; ``` - One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way. - Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point? - Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder. - The work on pretty printer tests for this did trigger, but not fix errors regarding macros: - expression `foo![]` prints as `foo!()` - expression `foo!{}` prints as `foo!()` - statement `foo![];` prints as `foo!();` - statement `foo!{};` prints as `foo!();` - statement `foo!{}` triggers a `None` unwrap ICE.
2015-12-02Disable the null check elimination passBjörn Steinbrink-0/+24
This pass causes mis-optimizations in some cases and is probably no longer really important for us, so let's disable it for now. Fixes #30081
2015-12-01Auto merge of #25570 - oli-obk:const_indexing, r=nikomatsakisbors-26/+47
This PR allows the constant evaluation of index operations on constant arrays and repeat expressions. This allows index expressions to appear in the expression path of the length expression of a repeat expression or an array type. An example is ```rust const ARR: [usize; 5] = [1, 2, 3, 4, 5]; const ARR2: [usize; ARR[1]] = [42, 99]; ``` In most other locations llvm's const evaluator figures it out already. This is not specific to index expressions and could be remedied in the future.
2015-11-30Fix regression in patterns with empty variantsVadim Petrochenkov-0/+22
2015-11-28Auto merge of #29383 - petrochenkov:empstr, r=pnkfelixbors-21/+10
Fixes https://github.com/rust-lang/rust/issues/28692 Fixes https://github.com/rust-lang/rust/issues/28992 Fixes some other similar issues (see the tests) [breaking-change], needs crater run (cc @brson or @alexcrichton ) The pattern with parens `UnitVariant(..)` for unit variants seems to be popular in rustc (see the second commit), but mostly used by one person (@nikomatsakis), according to git blame. If it causes breakage on crates.io I'll add an exceptional case for it.
2015-11-27Auto merge of #30085 - oli-obk:fix/pnkfelix_test, r=pnkfelixbors-20/+32
for discussion see https://github.com/rust-lang/rust/pull/26848/files#r43151926 r? @pnkfelix
2015-11-27revert test to check runtime evaluation instead of constant evaluationOliver Schneider-20/+32
see https://github.com/rust-lang/rust/pull/26848/files#r43151926
2015-11-27implement calling of `const fn`-methods in true constantsOliver Schneider-0/+2
2015-11-27pass at least one argument to execveSébastien Marie-2/+2
under OpenBSD and Bitrig, it is an error to pass an empty argv argument to execve(2). It results the test fail as execve(2) don't exec and set errno to EINVAL. instead, make argv with two arguments (in order to differenciate the initial call, from the execve call).
2015-11-26Extended simple macro testMarvin Löbel-1/+11
2015-11-26Added stmt_expr_attribute feature gateMarvin Löbel-0/+23
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-0/+97
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-25Auto merge of #30044 - nikomatsakis:issue-29466, r=arielb1bors-0/+3607
The graph extent mechanism is not good. I have some ideas for a better replacement, but this PR simply removes it. It also stops recursing on statement scopes and processes them using an "on the heap" stack, which fixes #29466. r? @dotdash
2015-11-24Rewrite stmt processing not to recurse to avoid stack overflow if thereNiko Matsakis-0/+3607
are tons of let statements. Fixes #29466.
2015-11-23Add tests for #25810 and #29276Andrew Paseltiner-0/+48
Closes #25810. Closes #29276.
2015-11-21Auto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichtonbors-0/+48
On Windows: Previously these paths were silently truncated at these NUL characters, now they fail with `ErrorKind::InvalidInput`.
2015-11-20add feature gate `const_indexing`Oliver Schneider-0/+1
tracking issue is #29947
2015-11-19Add run-pass test for paths containing the NUL characterTobias Bucher-0/+48
2015-11-19Re-unignore environment test on MinGWTobias Bucher-4/+1
2015-11-19Fix the falloutVadim Petrochenkov-10/+1
2015-11-19Fix various bugs around empty structs and patternsVadim Petrochenkov-11/+9
2015-11-18Revert not-ignoring weird environment variables for MinGWTobias Bucher-1/+4
2015-11-18allow indexing into constant arraysOliver Schneider-26/+46
2015-11-18Auto merge of #29882 - devonhollowood:master, r=Manishearthbors-21/+0
Implement #14615
2015-11-17Rollup merge of #29868 - petrochenkov:gv, r=sanxiynManish Goregaokar-2/+2
r? @arielb1
2015-11-17Remove 'raw_pointer_derive' lint (#14615)Devon Hollowood-21/+0
2015-11-16Ignore malformed environment strings like glibc doesTobias Bucher-4/+46
Otherwise, the iterator and the functions for getting specific environment variables might disagree, for environments like FOOBAR Variable names starting with equals sign are OK: glibc only interprets equals signs not in the first position as separators between variable name and variable value. Instead of skipping them entirely, a leading equals sign is interpreted to be part of the variable name.
2015-11-16Do not generate comparefoo.gv and simpleeq.gv during testingVadim Petrochenkov-2/+2
2015-11-15Auto merge of #29836 - eefriedman:normalize-fn, r=arielb1bors-0/+45
Fixes #23406. Fixes #23958. Fixes #29832. CC @arielb1
2015-11-15fix prettyAriel Ben-Yehuda-1/+2
2015-11-15fix remaining bugsAriel Ben-Yehuda-0/+46
2015-11-15evaluate projections outside the outer probe in recursive evaluationAriel Ben-Yehuda-0/+31
2015-11-15simplify and reduce the size of EvaluationResultAriel Ben-Yehuda-0/+35
2015-11-14Consistently normalize fn types after erasing lifetimes.Eli Friedman-0/+45
Fixes #23406. Fixes #23958. Fixes #29832.
2015-11-14implement coercions in MIRAriel Ben-Yehuda-0/+76
2015-11-13represent fat ptr operands as 2 separate pointersAriel Ben-Yehuda-0/+63
this does add some complexity, but to do otherwise would require unsized lvalues to have their own allocas, which would be ugly.
2015-11-13MIR: implement fat raw pointer comparisonsAriel Ben-Yehuda-0/+173
The implementation itself only requires changes to trans, but a few additional bugs concerning the handling of fat pointers had to be fixed.
2015-11-12Auto merge of #29770 - ollie27:assert_eq_unsized, r=alexcrichtonbors-0/+13
`format_args!` doesn't support none Sized types so we should just pass it the references to `left_val` and `right_val`. The following works: ```rust assert!([1, 2, 3][..] == vec![1, 2, 3][..]) ``` So I would expect this to as well: ```rust assert_eq!([1, 2, 3][..], vec![1, 2, 3][..]) ``` But it fails with "error: the trait `core::marker::Sized` is not implemented for the type `[_]` [E0277]" I don't know if this change will have any nasty side effects I don't understand.