summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-04-07fix compile-fail and parse-fail tests by blindly opting back intoFelix S. Klock II-0/+16
parser recovery (so that expected errors match up) I'm opting into parser recovery in all these cases out of expediency, not because the error messages you get with recovery enabled are actually all that usable in all cases listed.
2016-03-16Add comment explaining purpose of testNiko Matsakis-0/+3
2016-03-16Do not report errors from regionck if other errors were alreadyNiko Matsakis-0/+24
reported during the lifetime of this inferencer. Fixes #30580.
2016-03-16remove wrong assert in check_matchAriel Ben-Yehuda-0/+20
the assert was invalidated by PR #31020 Fixes #31561
2016-03-16don't treat unit patterns as wildcard patternsAriel Ben-Yehuda-0/+29
Fixes #32004
2016-03-01Auto merge of #31962 - sanxiyn:const-eval-map, r=arielb1bors-0/+21
Fix #31910.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-162/+3
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-29Use HIR map instead of tcx in constant evaluatorSeo Sanghyeon-0/+21
Constant evaluator can be called while tcx is in construction.
2016-02-27Auto merge of #31915 - nagisa:mir-unpretty-fix, r=arielb1bors-0/+15
Fixes https://github.com/rust-lang/rust/issues/31913
2016-02-27Add testSimonas Kazlauskas-0/+15
2016-02-26Rollup merge of #31901 - bluss:suggest-use, r=sanxiynManish Goregaokar-8/+8
suggest: Put the `use` in suggested code inside the quotes Change import a trait suggestion from: help: candidate #1: use `std::io::Write` to help: candidate #1: `use std::io::Write` so that the code can be copied directly. Fixes #31864
2016-02-26Auto merge of #31857 - jseyfried:fix_scoping, r=nikomatsakisbors-0/+29
This fixes a bug (#31845) introduced in #31105 in which lexical scopes contain items from all anonymous module ancestors, even if the path to the anonymous module includes a normal module: ```rust fn f() { fn g() {} mod foo { fn h() { g(); // This erroneously resolves on nightly } } } ``` This is a [breaking-change] on nightly but not on stable or beta. r? @nikomatsakis
2016-02-26Auto merge of #31749 - nikomatsakis:compiletest-subdir, r=alexcrichtonbors-0/+0
You can now group tests into directories like `run-pass/borrowck` or `compile-fail/borrowck`. By default, all `.rs` files within any directory are considered tests: to ignore some directory, create a placeholder file called `compiletest-ignore-dir` (I had to do this for several existing directories). r? @alexcrichton cc @brson
2016-02-26suggest: Put the `use` in suggested code inside the quotesUlrik Sverdrup-8/+8
Change import a trait suggestion from: help: candidate #1: use `std::io::Write` to help: candidate #1: `use std::io::Write` so that the code can be copied directly.
2016-02-25Rollup merge of #31818 - GuillaumeGomez:error_display, r=brsonManish Goregaokar-0/+22
Fixes #31788
2016-02-24Move the borrowck run-pass/compile-fail tests into their own directoriesNiko Matsakis-0/+0
as a test.
2016-02-24Improve unused import detectionJeffrey Seyfried-0/+7
2016-02-24Resolve: include normal modules in the ribsJeffrey Seyfried-0/+22
2016-02-24Warn instead of error when using an inaccessable extern crateJeffrey Seyfried-5/+16
2016-02-24Warn when reexporting a private extern crateJeffrey Seyfried-0/+4
2016-02-24Fix the visibility of extern crate declarations and stop warning on pub ↵Jeffrey Seyfried-38/+23
extern crate
2016-02-20Add test for E0152 error message improvementGuillaume Gomez-0/+22
2016-02-20Auto merge of #31757 - petrochenkov:unitdotdot, r=nikomatsakisbors-11/+9
This warning was introduced on Nov 28, 2015 and got into 1.6 stable, it was later requalified from a hardwired warning to a warn-by-default lint. If this patch is landed soon enough, then `match_of_unit_variant_via_paren_dotdot` will get into 1.8 stable as a deny-by-default lint. My intention is to turn it into a hard error after March 3, 2016, then it will hit stable at 1.9. r? @nikomatsakis cc @pnkfelix
2016-02-20Auto merge of #31747 - jseyfried:stop_resolve_after_fail, r=nrcbors-2/+2
Now that #31461 is merged, a failing resolution can never become indeterminate or succeed, so we no longer have to keep trying to resolve failing import directives. r? @nrc
2016-02-20Auto merge of #31674 - VladUreche:issue/21221, r=nikomatsakisbors-53/+233
This commit adds functionality that allows the name resolution pass to search for entities (traits/types/enums/structs) by name, in order to show recommendations along with the errors. For now, only E0405 and E0412 have suggestions attached, as per the request in bug #21221, but it's likely other errors can also benefit from the ability to generate suggestions.
2016-02-19Rollup merge of #31775 - nxnfufunezn:issue-31769, r=eddybSteve Klabnik-0/+14
Fixes : #31769 r? @eddyb
2016-02-19Rollup merge of #31721 - rphmeier:err_tuplestruct_count, r=ManishearthSteve Klabnik-18/+18
Fixes #31706 Also fixes a phrasing error in the diagnostic.
2016-02-19Fix error[E0518] not displayed for #[inline] on structs inside fnsnxnfufunezn-0/+14
2016-02-19Auto merge of #31716 - jseyfried:fix_privacy_for_def_err, r=nrcbors-1/+6
Fixes #31714
2016-02-19Improve dummy bindings for unresolved importsJeffrey Seyfried-1/+1
2016-02-19Show candidates for names not in scopeVlad Ureche-53/+233
This commit adds functionality that allows the name resolution pass to search for entities (traits/types/enums/structs) by name, in order to show recommendations along with the errors. For now, only E0405 and E0412 have suggestions attached, as per the request in bug #21221, but it's likely other errors can also benefit from the ability to generate suggestions.
2016-02-18Make future-compat lint `match_of_unit_variant_via_paren_dotdot` deny by defaultVadim Petrochenkov-11/+9
2016-02-18Change how dep-graph edges are handled in variance toNiko Matsakis-10/+4
be more fine-grained, fixing the `dep-graph-struct-signature` test.
2016-02-17Stop trying to resolve an import directive after the resolution failsJeffrey Seyfried-2/+2
2016-02-17Auto merge of #31707 - GuillaumeGomez:macro_name, r=sfacklerbors-0/+25
I'm wondering if instead of a second help message, a note would be better. I let it up to reviewers.
2016-02-16Fix #31706rphmeier-18/+18
2016-02-16Don't compute LastPrivate data for Def::Err.Jeffrey Seyfried-1/+6
2016-02-16Add check on find_best_match_for_name and improve help message for undefined ↵ggomez-0/+25
macro
2016-02-16Auto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakisbors-0/+15
This PR disallows non-inline modules without path annotations that are either in a block or in an inline module whose containing file is not a directory owner (fixes #29765). This is a [breaking-change]. r? @nikomatsakis
2016-02-15Auto merge of #31530 - dirk:dirk/restrict-matching-of-cfg-opts, r=alexcrichtonbors-0/+13
Fixes #31497.
2016-02-15Auto merge of #31648 - jseyfried:fix_diagnostics, r=nrcbors-4/+5
This PR fixes two unrelated diagnostics bugs in resolve. First, it reports privacy errors for an import only after the import resolution is determined, fixing #31402. Second, it expands the per-module map from block ids to anonymous modules so that it also maps module declarations ids to modules, and it uses this map to in `with_scope` to fix #31644. r? @nrc
2016-02-15Auto merge of #31566 - jseyfried:fix_regression, r=nrcbors-1/+1
This fixes a regression caused by #31461 allowing extern crates to be glob imported, and it fixes the test that was supposed to catch it. r? @nrc
2016-02-14Stricter matching of `--cfg` options on rustcDirk Gadsden-0/+13
Includes compile-fail test to check that it fails on incomplete `--cfg` matches. Fixes #31497.
2016-02-15TestsNick Cameron-0/+44
2016-02-15Some error recovery in the parserNick Cameron-4/+4
2016-02-14Rename Module field anonymous_children to module_children, expand it to ↵Jeffrey Seyfried-4/+5
include both named an anonymous modules, and fix #31644
2016-02-13Disallow non-inline modules without path annotations inside blocks and fix ↵Jeffrey Seyfried-0/+15
fallout
2016-02-11Fix regression from #31461 and fix the test that was supposed to catch it.Jeffrey Seyfried-1/+1
2016-02-11Auto merge of #31461 - jseyfried:remove_import_resolutions, r=nrcbors-3/+3
This PR adds to `NameBinding` so it can more fully represent bindings from imports as well from items, refactors away `Target`, generalizes `ImportResolution` to a simpler type `NameResolution`, and uses a single `NameResolution`-valued map in place the existing maps `children` and `import_resolutions` (of `NameBinding`s and `ImportResolution`s, respectively), simplifying duplicate checking and name resolution. It also unifies the `resolve_name_in_module` in `lib.rs` with its namesake in `resolve_imports.rs`, clarifying and improving the core logic (fixes #31403 and fixes #31404) while maintaining clear future-comparability with shadowable globs (i.e., never reporting that a resolution is a `Success` or is `Failing` unless this would also be knowable with shadowable globs). Since it fixes #31403, this is technically a [breaking-change], but it is exceedingly unlikely to cause breakage in practice. The following is an example of code that would break: ```rust mod foo { pub mod bar {} // This defines bar in the type namespace pub use alpha::bar; // This defines bar in the value namespace // This should define baz in both namespaces, but it only defines baz in the type namespace. pub use self::bar as baz; pub fn baz() {} // This should collide with baz, but now it does not. } pub fn f() {} mod alpha { pub use self::f as bar; // Changing this to `pub fn bar() {}` causes the collision right now. pub use super::*; } ``` r? @nrc
2016-02-10Auto merge of #31499 - kamalmarhubi:cfg-flag-invalid-cfgs, r=brsonbors-0/+25
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This makes the same spec be rejected by the compiler if passed in as a `--cfg` argument. Fixes #31495