summary refs log tree commit diff
path: root/src/test
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-16rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_deriveBrian Anderson-0/+110
cc #30346 Conflicts: src/librustc_lint/lib.rs
2016-01-12Merge pull request #30854 from brson/beta-next3Alex Crichton-0/+16
More beta ports
2016-01-12Use --cfg when running doctestsSeo Sanghyeon-0/+16
Previously passed --cfg was used only when collecting doctests.
2016-01-12Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-0/+17
2016-01-12Merge pull request #30847 from nikomatsakis/issue-29857-betaBrian Anderson-6/+63
[beta] Backport fix for issue 29857
2016-01-12The lint warnings are not reported since we report the errors first and then ↵Felix S. Klock II-2/+0
exit. I think that behavior is fine, so I am removing the expected warnings from these tests.
2016-01-12updated test to reflect loosening of check (for issue #30379).Felix S. Klock II-2/+6
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.
2016-01-11permit coercions if `[error]` is found in either typeNiko Matsakis-1/+1
Conflicts: src/test/compile-fail/issue-3973.rs
2016-01-11Change error scheme so that if projection fails we generate `A::B` instead ↵Niko Matsakis-5/+60
of `TyError` Conflicts: src/test/compile-fail/issue-29857.rs
2015-12-09Auto merge of #30278 - steveklabnik:rollup, r=steveklabnikbors-0/+37
- Successful merges: #30201, #30224, #30261, #30273, #30274 - Failed merges:
2015-12-09Rollup merge of #30261 - oli-obk:add_regression_test, r=pnkfelixSteve Klabnik-0/+37
see https://github.com/rust-lang/rust/pull/30202/files#r46819188 r? @pnkfelix the only difference between the tests is that one has the const_indexing feature enabled.
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-09Auto merge of #30208 - pnkfelix:fix-issue-30063, r=alexcrichtonbors-0/+46
When given `rustc -C codegen-units=4 --emit=obj`, reset units back to 1. Fix #30063 Note: while this code is careful to handle the case of mutliple emit types (e.g. `--emit=asm,obj`) by reporting all the emit types that conflict with codegen units in its warnings, an invocation with multiple emit types *and* `-o PATH` will continue to ignore the requested target path (with a warning), as it already does today, since the code that checks for that is further downstream. (Multiple emit types without `-o PATH` will "work", though it will downgrade codegen-units to 1 just like all the other cases.) r? @alexcrichton
2015-12-08Auto merge of #30036 - mitaa:doc_id, r=alexcrichtonbors-0/+83
This expands the code which generates unique IDs for Markdown headers within a single block to each rendered page. fixes #25001 fixes #29449
2015-12-08add tests for ensuring const indexing does not cause compile-time errors in ↵Oliver Schneider-0/+37
runtime code
2015-12-08regression test for issue #30063Felix S. Klock II-0/+46
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-1/+34
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 #30241 - Manishearth:diag-30236, r=eddybbors-0/+18
r? @eddyb
2015-12-06Correct span for unused type parameter error in type alias (fixes #30236)Manish Goregaokar-0/+18
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-114/+50
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-114/+50
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-05Add testsmitaa-0/+83
2015-12-05fix const index feature-gate regressionOliver Schneider-1/+34
2015-12-05Auto merge of #30102 - jFransham:feature/better-lifetime-errors, r=Manishearthbors-1/+5
Fixes #30086
2015-12-05Auto merge of #30211 - pnkfelix:fix-getopts-for-issue-30204, r=alexcrichtonbors-0/+29
Fix internal `getopts` so `--a=b=c` acts like `--a b=c` rather than `--a b`. Fix #30204
2015-12-04Expand run-make test with regression tests for #30204Felix S. Klock II-0/+29
Fix #30204.
2015-12-04Auto merge of #30084 - oli-obk:const_fn, r=pnkfelixbors-2/+5
2015-12-04Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelixbors-62/+915
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-04Ignore rpass-fulldeps test in cross compile testsMarvin Löbel-0/+2
2015-12-03Auto merge of #30149 - mitaa:fqn, r=alexcrichtonbors-0/+35
Fixes #30109
2015-12-03Use the extern item-path for documentation linksmitaa-0/+35
The local item-path includes the local crates path to the extern crate declaration which breaks cross-crate rustdoc links if the extern crate is not linked into the crate root or renamed via `extern foo as bar`.
2015-12-02Auto merge of #30165 - dotdash:no_null_elim, r=alexcrichtonbors-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-02Auto merge of #30133 - jseyfried:fix_regression, r=alexcrichtonbors-0/+22
r? @nikomatsakis
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-27/+107
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-12-01Update lifetime compile testsJack Fransham-1/+5
2015-12-01Add test for #30089Jeffrey Seyfried-0/+22
2015-11-30Added test for attributes on parens hir folderMarvin Löbel-0/+34
2015-11-30Added a test for #[cfg] on non-optional positionsMarvin Löbel-0/+18
2015-11-30Fix regression in patterns with empty variantsVadim Petrochenkov-0/+22
2015-11-28Auto merge of #30074 - jonas-schievink:macro-doc, r=sanxiynbors-0/+20
Fixes #17616 New docs for `panic!`: ```rust macro_rules! panic { () => { ... }; ($msg:expr) => { ... }; ($fmt:expr, $($arg:tt)+) => { ... }; } ``` New docs for `assert!`: ```rust macro_rules! assert { ( $ cond : expr ) => { ... }; ( $ cond : expr , $ ( $ arg : tt ) + ) => { ... }; } ``` <sup>not pretty, but at least it's not worse :joy:
2015-11-28Add a testJonas Schievink-0/+20
2015-11-28Auto merge of #29383 - petrochenkov:empstr, r=pnkfelixbors-67/+95
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