about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-01-18Auto merge of #30953 - KalitaAlexey:17823-get-rid-of-duplicate-error, r=nrcbors-109/+1
2016-01-18simplify E0308 message for primitive typeskalita.alexey-109/+1
2016-01-17Expand the macro in variance-btree-invariant-types.rs to make compiletest ↵Jonathan S-36/+43
recognize that it should error
2016-01-17Fix and test variance of BTreeMap and its companion structs.Jonathan S-0/+56
2016-01-17Rollup merge of #30943 - alexcrichton:stabilize-1.7, r=aturonManish Goregaokar-3/+8
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2016-01-16Auto merge of #30567 - steffengy:master, r=alexcrichtonbors-0/+19
Add support to use functions exported using vectorcall. This essentially only allows to pass a new LLVM calling convention from rust to LLVM. ```rust extern "vectorcall" fn abc(param: c_void); ``` references ---- http://llvm.org/docs/doxygen/html/CallingConv_8h_source.html https://msdn.microsoft.com/en-us/library/dn375768.aspx
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-3/+8
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2016-01-16Auto merge of #30533 - nikomatsakis:fulfillment-tree, r=aturonbors-46/+150
This PR introduces an `ObligationForest` data structure that the fulfillment context can use to track what's going on, instead of the current flat vector. This enables a number of improvements: 1. transactional support, at least for pushing new obligations 2. remove the "errors will be reported" hack -- instead, we only add types to the global cache once their entire subtree has been proven safe. Before, we never knew when this point was reached because we didn't track the subtree. - this in turn allows us to limit coinductive reasoning to structural traits, which sidesteps #29859 3. keeping the backtrace should allow for an improved error message, where we give the user full context - we can also remove chained obligation causes This PR is not 100% complete. In particular: - [x] Currently, types that embed themselves like `struct Foo { f: Foo }` give an overflow when evaluating whether `Foo: Sized`. This is not a very user-friendly error message, and this is a common beginner error. I plan to special-case this scenario, I think. - [x] I should do some perf. measurements. (Update: 2% regression.) - [x] More tests targeting #29859 - [ ] The transactional support is not fully integrated, though that should be easy enough. - [ ] The error messages are not taking advantage of the backtrace. I'd certainly like to do 1 through 3 before landing, but 4 and 5 could come as separate PRs. r? @aturon // good way to learn more about this part of the trait system f? @arielb1 // already knows this part of the trait system :)
2016-01-16Add regression tests for #29859. However #29859 is not fully fixed.Niko Matsakis-0/+84
2016-01-16Implement a hacky version of the DAG support we ultimately want, leavingNiko Matsakis-3/+2
a FIXME for later.
2016-01-16Detect cycles and specialize error reporting for Sized. It is importantNiko Matsakis-44/+65
to get the `Sized` error usable, since that hits new users frequently. Further work is needed for the error reporting for non-Sized cycle cases; those currently just fallback to the old path. Also adjust tests.
2016-01-16Auto merge of #30930 - oli-obk:fix/30887, r=arielb1bors-7/+90
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet). fixes #30887 r? @pnkfelix
2016-01-16Auto merge of #30896 - petrochenkov:vkindmeta, r=alexcrichtonbors-29/+107
Also add tests for use of empty structs in cross-crate scenarios Some tests are commented out, they depend on fixes from https://github.com/rust-lang/rust/pull/30882
2016-01-15Auto merge of #30878 - brson:raw-pointer-derive, r=brsonbors-0/+110
This adds back the raw_pointer_derive lint as a 'removed' lint, so that its removal does not cause errors (#30346) but warnings. In the process I discovered regressions in the code for renamed and removed lints, which didn't appear to have any tests. The addition of a second lint pass (ast vs. hir) meant that attributes were being inspected twice, renamed and removed warnings printed twice. I restructured the code so these tests are only done once and added tests. Unfortunately it makes the patch more complicated for the needed beta backport. r? @nikomatsakis
2016-01-15Auto merge of #30446 - michaelwu:associated-const-type-params-pt1, ↵bors-8/+127
r=nikomatsakis This provides limited support for using associated consts on type parameters. It generally works on things that can be figured out at trans time. This doesn't work for array lengths or match arms. I have another patch to make it work in const expressions. CC @eddyb @nikomatsakis
2016-01-15Auto merge of #30773 - fhahn:test-fix, r=alexcrichtonbors-11/+13
In my PR for #21659 I accidentally used `// | help` as test annotation. This PR updates it to `//~| help`. I also found and updated 2 other tests with the same issue.
2016-01-15Preserve struct/variant kinds in metadataVadim Petrochenkov-29/+107
Add tests for use of empty structs in cross-crate scenarios
2016-01-15move const block checks before lowering stepOliver Schneider-7/+90
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet).
2016-01-14Support generic associated constsMichael Wu-8/+127
2016-01-14rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_deriveBrian Anderson-0/+110
cc #30346
2016-01-13s/HARD ERROR/hard error/ -- perhaps the warning is enoughNiko Matsakis-43/+43
2016-01-12Fix test cases accordinglyNiko Matsakis-1/+43
2016-01-11add feature gate "abi_vectorcall" for the vectorcall calling conventionSteffen-0/+19
2016-01-11Rollup merge of #30694 - pnkfelix:issue-25658-real-first-follow, r=nrcSimonas Kazlauskas-20/+8
Proper first and follow sets for macro_rules future proofing implements first stage of RFC amendment 1384; see #30450
2016-01-11Rollup merge of #30538 - oli-obk:kill_unsigned_unary_negation, r=pnkfelixSimonas Kazlauskas-15/+115
fixes #29645
2016-01-11Auto merge of #30676 - nikomatsakis:issue-29857, r=arielb1bors-7/+192
This is an alternative to https://github.com/rust-lang/rust/pull/29954 for fixing #29857 that seems to me to be more inline with the general strategy around `TyError`. It also includes the fix for #30589 -- in fact, just the minimal change of making `ty_is_local` tolerate `TyError` avoids the ICE, but you get a lot of duplicate error reports, so in the case where the impl's trait reference already includes `TyError`, we just ignore the impl altogether. cc @arielb1 @sanxiyn Fixes #29857. Fixes #30589.
2016-01-11Auto merge of #30753 - pnkfelix:downgrade-29383-struct-warnings-to-errors, ↵bors-4/+6
r=nikomatsakis Downgrade unit struct match via S(..) warnings to errors The error signalling was introduced in #29383 It was noted as a warning-cycle-less regression in #30379 Fix #30379
2016-01-11[breaking-change] remove negate_unsigned feature gateOliver Schneider-15/+115
2016-01-08permit coercions if `[error]` is found in either typeNiko Matsakis-2/+2
2016-01-08Change error scheme so that if projection fails we generate `A::B` instead ↵Niko Matsakis-8/+35
of `TyError`
2016-01-08Make coherence more tolerant of error types.Niko Matsakis-0/+158
Fixes #29857. Fixes #30589.
2016-01-08Rollup merge of #30584 - GuillaumeGomez:new_handles, r=pnkfelixSteve Klabnik-0/+12
Last part of #30413. r? @pnkfelix
2016-01-08The 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-08Add new help messages for E0425Guillaume Gomez-0/+12
2016-01-08update test to reflect other sources of brokenness in it under newFelix S. Klock II-1/+6
macro future proofing rules. (We may want to think about what this test was actually testing and figure out a way to test it without running afoul of macro future proofing. I spent some time trying to do this, e.g. by inserting parenthesis in the macro input pattern, but I could not quickly get it working, so I took this tack instead.)
2016-01-07updated test to reflect loosening of check (for issue #30379).Felix S. Klock II-2/+6
2016-01-07After RFC amendment 1384, FOLLOW(pat) includes `|`, so update tests accordingly.Felix S. Klock II-1/+0
2016-01-07Updated future-proofing test, removed outdated test, and addedFelix S. Klock II-18/+2
run-pass test for some new functionality.
2016-01-07Fix tests that used `// | help:` annotationsFlorian Hahn-11/+13
2016-01-07Auto merge of #30724 - nikomatsakis:feature-gate-defaulted-type-parameters, ↵bors-0/+19
r=pnkfelix It was recently realized that we accept defaulted type parameters everywhere, without feature gate, even though the only place that we really *intended* to accept them were on types. This PR adds a lint warning unless the "type-parameter-defaults" feature is enabled. This should eventually become a hard error. This is a [breaking-change] in that new feature gates are required (or simply removing the defaults, which is probably a better choice as they have little effect at this time). Results of a [crater run][crater] suggest that approximately 5-15 crates are affected. I didn't do the measurement quite right so that run cannot distinguish "true" regressions from "non-root" regressions, but even the upper bound of 15 affected crates seems relatively minimal. [crater]: https://gist.github.com/nikomatsakis/760c6a67698bd24253bf cc @rust-lang/lang r? @pnkfelix
2016-01-07Auto merge of #30723 - nrc:macro-err-bug, r=Manishearthbors-0/+26
Fixes #30715
2016-01-06Auto merge of #30654 - nrc:panictry, r=brsonbors-2/+1
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery. [breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2016-01-06Auto merge of #30532 - nikomatsakis:cross-item-dependencies, r=mwbors-0/+354
This is roughly the same as my previous PR that created a dependency graph, but that: 1. The dependency graph is only optionally constructed, though this doesn't seem to make much of a difference in terms of overhead (see measurements below). 2. The dependency graph is simpler (I combined a lot of nodes). 3. The dependency graph debugging facilities are much better: you can now use `RUST_DEP_GRAPH_FILTER` to filter the dep graph to just the nodes you are interested in, which is super help. 4. The tests are somewhat more elaborate, including a few known bugs I need to fix in a second pass. This is potentially a `[breaking-change]` for plugin authors. If you are poking about in tcx state or something like that, you probably want to add `let _ignore = tcx.dep_graph.in_ignore();`, which will cause your reads/writes to be ignored and not affect the dep-graph. After this, or perhaps as an add-on to this PR in some cases, what I would like to do is the following: - [x] Write-up a little guide to how to use this system, the debugging options available, and what the possible failure modes are. - [ ] Introduce read-only and perhaps the `Meta` node - [x] Replace "memoization tasks" with node from the map itself - [ ] Fix the shortcomings, obviously! Notably, the HIR map needs to register reads, and there is some state that is not yet tracked. (Maybe as a separate PR.) - [x] Refactor the dep-graph code so that the actual maintenance of the dep-graph occurs in a parallel thread, and the main thread simply throws things into a shared channel (probably a fixed-size channel). There is no reason for dep-graph construction to be on the main thread. (Maybe as a separate PR.) Regarding performance: adding this tracking does add some overhead, approximately 2% in my measurements (I was comparing the build times for rustdoc). Interestingly, enabling or disabling tracking doesn't seem to do very much. I want to poke at this some more and gather a bit more data -- in some tests I've seen that 2% go away, but on others it comes back. It's not entirely clear to me if that 2% is truly due to constructing the dep-graph at all. The next big step after this is write some code to dump the dep-graph to disk and reload it. r? @michaelwoerister
2016-01-06Fix dependency graph test cases to have correct commments and use -Z incr-compNiko Matsakis-6/+22
2016-01-06Fix tidy errorsNiko Matsakis-3/+2
2016-01-05Add assert-dep-graph testing mechanism and testsNiko Matsakis-0/+339
2016-01-05convert from hard error to future-incompatible lintNiko Matsakis-0/+17
2016-01-06Cancel an error before it panicsNick Cameron-0/+26
Fixes #30715
2016-01-04Feature-gate defaulted type parameters outside of types.Niko Matsakis-0/+2
2016-01-04Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-0/+17