about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-06-27Fix the error of selecting obligation by not running the borrow checker.Vytautas Astrauskas-6/+31
2018-06-27Move regression test from `compile-fail/` to `ui/` test directory.Felix S. Klock II-0/+8
2018-06-27Fix the regression test for issue 50716.Vytautas Astrauskas-1/+3
2018-06-27Fix NLL issue 50716 and add a regression test.Vytautas Astrauskas-0/+26
2018-06-27Implement `#[macro_export(local_inner_macros)]`Vadim Petrochenkov-0/+92
2018-06-27Auto merge of #51773 - oli-obk:cleanup_impl_trait, r=nikomatsakisbors-105/+18
Don't inspect the generated existential type items r? @nikomatsakis My debugging led me to the `hir::ItemExistential(..)` checks, which are entirely unnecessary because we never use the items directly. The issue was that items were iterated over in a random order (due to hashmaps), so if you checked the `ItemExistential` before the function that has the actual return `impl Trait`, you'd run into those ICEs you encountered.
2018-06-26driveby status update to 2015 comment about parens in patternsZack M. Davis-0/+2
2018-06-26inclusive range syntax lint (`...` → `..=`)Zack M. Davis-2/+84
Our implementation ends up changing the `PatKind::Range` variant in the AST to take a `Spanned<RangeEnd>` instead of just a `RangeEnd`, because the alternative would be to try to infer the span of the range operator from the spans of the start and end subexpressions, which is both hideous and nontrivial to get right (whereas getting the change to the AST right was a simple game of type tennis). This is concerning #51043.
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-111/+110
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-26Don't inspect the generated existential type itemsOliver Schneider-105/+18
2018-06-26Auto merge of #51805 - pietroalbini:rollup, r=pietroalbinibors-150/+240
Rollup of 11 pull requests Successful merges: - #51104 (add `dyn ` to display of dynamic (trait) types) - #51153 (Link panic and compile_error docs) - #51642 (Fix unknown windows build) - #51730 (New safe associated functions for PinMut) - #51731 (Fix ICEs when using continue as an array length inside closures (inside loop conditions)) - #51747 (Add error for using null characters in #[export_name]) - #51769 (Update broken rustc-guide links) - #51786 (Remove unnecessary stat64 pointer casts) - #51788 (Fix typo) - #51789 (Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`) - #51791 (Minify css) Failed merges: r? @ghost
2018-06-26Rollup merge of #51789 - estebank:issue-50577, r=oli-obkPietro Albini-0/+28
Don't ICE when performing `lower_pattern_unadjusted` on a `TyError` Fix #50577. CC #51696. r? @oli-obk
2018-06-26Rollup merge of #51747 - varkor:export_name-null-character, r=estebankPietro Albini-1/+24
Add error for using null characters in #[export_name] Fixes #51741.
2018-06-26Rollup merge of #51731 - varkor:closure-array-break-length, r=estebankPietro Albini-12/+51
Fix ICEs when using continue as an array length inside closures (inside loop conditions) Fixes #51707. Fixes #51708. r? @estebank
2018-06-26Rollup merge of #51104 - zackmdavis:dynamo, r=nikomatsakisPietro Albini-137/+137
add `dyn ` to display of dynamic (trait) types ~~I'm not sure we want the `dyn` in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like `Box<dyn Trait>`), but I'm finding the code I would need to change that hard to follow—the [display object seems to](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/traits/error_reporting.rs#L600) be a [`Predicate::Trait`](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L962) variant, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L1309) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L1112) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L975-L985) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~ Resolves #49277 (?). r? @nikomatsakis
2018-06-26Auto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakisbors-0/+70
Implementation of RFC 2086 - Allow Irrefutable Let patterns This is the set of changes for RFC2086. Tracking issue #44495. Rendered [here](https://github.com/rust-lang/rfcs/pull/2086)
2018-06-26Auto merge of #50966 - leodasvacas:self-in-where-clauses-is-not-object-safe, ↵bors-39/+48
r=nikomatsakis `Self` in where clauses may not be object safe Needs crater, virtually certain to cause regressions. In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses. This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error. Part of #50781. r? @nikomatsakis
2018-06-25Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`Esteban Küber-0/+28
2018-06-25Auto merge of #51750 - zackmdavis:superstructure, r=oli-obkbors-24/+183
three diagnostics upgrades * reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion * shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note * structured suggestion for pattern-named-the-same-as-variant warning r? @oli-obk
2018-06-25Auto merge of #51733 - varkor:ice-match-slice, r=oli-obkbors-0/+23
Fix an ICE when matching over const slices Fixes #51655. I'm not super familiar with this code, so tell me if this is the wrong approach 😅 r? @oli-obk
2018-06-25Fill in tracking issue for WHERE_CLAUSES_OBJECT_SAFETY future compat lintleonardo.yvens-1/+1
2018-06-25Make where clause object safety be a warn-by-default lintleonardo.yvens-10/+18
2018-06-25`Self` in where clauses may not be object safeleonardo.yvens-37/+38
This is virtually certain to cause regressions, needs crater. In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses. This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error. Fixes #50781. r? @nikomatsakis
2018-06-25Auto merge of #51335 - mark-i-m:allocator, r=oli-obkbors-0/+48
Prohibit `global_allocator` in submodules Background: #44113 is caused by weird interactions with hygiene. Hygiene is hard. After a lot of playing around, we decided that the best path forward would be to prohibit `global_allocator`s from being in submodules for now. When somebody gets it working, we can re-enable it. This PR contains the following - Some hygiene "fixes" -- things I suspect are the correct thing to do that will make life easier in the future. This includes using call_site hygiene for the generated module and passing the correct crate name to the expansion config. - Comments and minor formatting fixes - Some debugging code - Code to prohibit `global_allocator` in submodules - Test checking that the proper error occurs. cc #44113 #49320 #51241 r? @alexcrichton
2018-06-25Auto merge of #51688 - spastorino:error-note-field-after-move, r=nikomatsakisbors-9/+41
Fix erroneous error note when using field after move Closes #51512 r? @nikomatsakis
2018-06-24actually fix testmark-1/+1
2018-06-24fix testmark-4/+7
2018-06-24Prohibit global_allocator in submodules for nowMark Mansi-1/+9
- we need to figure out hygiene first - change the test to check that the prohibition works with a good error msg - leaves some comments and debugging code - leaves some of our supposed fixes
2018-06-24Attempt to fix hygiene for global_allocatorMark Mansi-0/+37
2018-06-23in which the trivial-casts word to the wise is tucked into a help noteZack M. Davis-0/+95
The top level message shouldn't be too long; the replaced-by-coercion/temporary-variable advice can live in a note. Also, don't mention type ascription when it's not actually available as a real thing. (The current state of discussion on the type ascription tracking issue #23416 makes one rather suspect it will never be a stable thing in its current form, but that's not for us to adjudicate in this commit.) While we're here, yank out the differentiating parts of the numeric/other conditional and only have one codepath emitting the diagnostic.
2018-06-23structured suggestion and rewording for `...` expression syntax errorZack M. Davis-13/+42
Now that `..=` inclusive ranges are stabilized, people probably shouldn't be using `...` even in patterns, even if it's still legal there (see #51043). To avoid drawing attention to `...` being a real thing, let's reword this message to just say "unexpected token" rather "cannot be used in expressions".
2018-06-23use structured suggestion for pattern-named-the-same-as-variant warningZack M. Davis-11/+46
2018-06-23add `dyn` to display of dynamic (trait) type namesZack M. Davis-137/+137
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.
2018-06-24Add backticks to E0558varkor-1/+1
2018-06-23Add error for using null characters in export_namevarkor-0/+23
2018-06-23Fix error code numbersGuillaume Gomez-5/+5
2018-06-23Fix codegen testsvarkor-12/+12
2018-06-23Add a test for breakvarkor-1/+9
2018-06-23Fix an ICE with continue inside a closure inside a loop conditionvarkor-2/+11
2018-06-23Fix an ICE with `continue` as an array lengthvarkor-0/+22
2018-06-23Fix an ICE when matching over const slicesvarkor-0/+23
2018-06-23Auto merge of #51723 - estebank:abolish-ice, r=oli-obkbors-0/+34
Accept `TyError` in `analyze_closure` to avoid ICE Fix #51714.
2018-06-23Auto merge of #51580 - cramertj:async-await, r=eddybbors-21/+355
async/await This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3. Based on https://github.com/rust-lang/rust/pull/51414. cc @petrochenkov for parsing changes. r? @eddyb
2018-06-23Auto merge of #51696 - estebank:fuzzy-ice-ice, r=oli-obkbors-0/+28
Accept `TyError` in patterns to avoid ICE on bad input Fix #50585.
2018-06-23Auto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obkbors-8/+30
Add label to lint for lifetimes used once ``` error: lifetime parameter `'a` only used once --> $DIR/fn-types.rs:19:10 | LL | a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once | ^^ -- ...is used only here | | | this lifetime... ```
2018-06-22Accept `TyError` in `analyze_closure` to avoid ICEEsteban Küber-0/+34
2018-06-22Fix erroneous error note when using field after moveSantiago Pastorino-9/+41
2018-06-22Auto merge of #51681 - varkor:rustc_deprecated-future-deprecation, ↵bors-0/+13
r=petrochenkov Support future deprecation for rustc_deprecated Follow-up to #49179 to allow `since` parameters to be set to future versions of Rust and correspondingly to not be treated as deprecated until that version. This is required for #30459 to be completed (though we'll need to wait until this hits beta).
2018-06-22Review nits and updatesTaylor Cramer-5/+5
Move future_from_generator out of raw Update await to use $crate Renumber errors
2018-06-22Auto merge of #51670 - estebank:issue-51634, r=oli-obkbors-3/+69
Don't suggest incorrect syntax Fix #51634.