summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2019-03-16Reduce test caseEsteban Küber-18/+4
2019-03-16Emit unclosed delimiters during recoveryEsteban Küber-1/+13
2019-03-16Bail when encountering a second unexpected token in the same spanEsteban Küber-58/+14
2019-03-16Do not panic on missing close parenEsteban Küber-0/+107
Fix #58856.
2019-03-16Expand where negative supertrait specific error is shownEsteban Küber-0/+15
Fix #58857.
2019-03-16Unit (and regression) tests for warning cycle code.Felix S. Klock II-59/+0
2019-02-25Rollup merge of #58370 - nox:relax-bounds, r=dtolnayMazdak Farrokhzad-10/+11
Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S> Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-22Auto merge of #56113 - spastorino:erroneous-loop-diagnostic-in-nll, r=pnkfelixbors-1/+1
Erroneous loop diagnostic in nll Closes #53773 r? @nikomatsakis
2019-02-21update test files to reflect new outputNiko Matsakis-15/+22
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-20Auto merge of #58056 - nikomatsakis:issue-57843-universe-leak, r=pnkfelixbors-0/+36
make generalization code create new variables in correct universe In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out. Fixes #57843 r? @pnkfelix
2019-02-20Fix erroneous loop diagnostic in nllSantiago Pastorino-1/+1
This commit fixes the logic of detecting when a use happen in a later iteration of where a borrow was defined Fixes #53773
2019-02-16Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obkkennytm-1/+4
Add specific feature gate error for const-unstable features Before: ``` error: `impl Trait` in const fn is unstable --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ error: aborting due to previous error ``` After: ``` error[E0723]: `impl Trait` in const fn is unstable (see issue #57563) --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ = help: add #![feature(const_fn)] to the crate attributes to enable error: aborting due to previous error ``` This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469. r? @oli-obk
2019-02-16Rollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakiskennytm-0/+59
Fix #57730 cc https://github.com/rust-lang/rust/pull/57730 r? @cramertj
2019-02-15make generalization code create new variables in correct universeNiko Matsakis-0/+36
In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out.
2019-02-14add .stderr fileNiko Matsakis-0/+17
2019-02-14Update const fn testsvarkor-1/+4
2019-02-14rustc_mir: split qualify_consts' checking and value qualification.Eduard-Mihai Burtescu-4/+4
2019-02-14Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obkMazdak Farrokhzad-1/+1
Hidden suggestion support Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding. r? @pietroalbini CC @zackmdavis
2019-02-14Rollup merge of #58267 - estebank:match-arms, r=matthewjasperMazdak Farrokhzad-24/+33
Tweak "incompatible match arms" error - Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitly stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error. Fix #46776, fix #57206. CC #24157, #38234.
2019-02-13Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>Anthony Ramine-10/+11
Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-7/+9
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Use hidden suggestions for unused imports lintEsteban Küber-1/+1
2019-02-11Auto merge of #56645 - pietroalbini:fix-unused-imports, r=estebankbors-1/+1
Initial implementation of rustfixable unused_imports lint This PR adds the initial implementation of rustfixable `unused_imports` lint. The implementation works, but rustfix is not able to apply all the suggestions until https://github.com/rust-lang/rust/issues/53934 is fixed. It also needs https://github.com/rust-lang/rust/pull/58296 to hide the suggested note since it's really useless. cc https://github.com/rust-lang/rust/issues/47888 <details><summary><code>cargo fix</code> in action on the <code>unused_imports</code> lint</summary> ![screenshot from 2018-12-09 15-49-01](https://user-images.githubusercontent.com/2299951/49698874-3a026080-fbca-11e8-9bf1-24060b6c59c8.png) </details>
2019-02-10Re-blessed tests.Alexander Regueiro-1/+3
2019-02-10tests: doc commentsAlexander Regueiro-6/+6
2019-02-09Auto merge of #57944 - estebank:unclosed-delim-the-quickening, r=oli-obkbors-1/+1
Deduplicate mismatched delimiter errors Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently. Second attempt at #54029, follow up to #53949. Fix #31528.
2019-02-08unused_imports: update testsPietro Albini-1/+1
2019-02-07Resolve incorrect diagnostic for using a non-const value in a constantvarkor-24/+16
2019-02-07Make name resolution handle consts in GenericParamsFromOuterFunction properlyvarkor-27/+27
2019-02-07Adjust parser generic parameter errorsvarkor-20/+16
2019-02-07Update testsvarkor-42/+36
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Reweork incompatible match arms errorEsteban Küber-24/+33
- Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitely stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error.
2019-02-07add doc comment and revert angle bracket changeEsteban Küber-2/+2
2019-02-07Update test output after rebaseEsteban Küber-3/+3
2019-02-06Auto merge of #58061 - nnethercote:overhaul-syntax-Folder, r=petrochenkovbors-2/+2
Overhaul `syntax::fold::Folder`. This PR changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. This makes the code faster and more concise.
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-2/+2
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2019-02-05Auto merge of #57973 - davidtwco:issue-52891, r=estebankbors-16/+265
Add suggestion for duplicated import. Fixes #52891. This PR adds a suggestion when a import is duplicated (ie. the same name is used twice trying to import the same thing) to remove the second import.
2019-02-02Update visibility of intermediate use items.David Wood-0/+35
Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This commit ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
2019-02-01add regression test for #57979Niko Matsakis-0/+42
2019-01-31Add suggestion for duplicated import.David Wood-16/+265
This commit adds a suggestion when a import is duplicated (ie. the same name is used twice trying to import the same thing) to remove the second import.
2019-01-30Don't panic when accessing enum variant ctor using `Self` in matchEsteban Küber-0/+24
2019-01-29Auto merge of #57901 - lqd:issue_57362, r=nikomatsakisbors-10/+80
Add information to higher-ranked lifetimes conflicts error messages Make these errors go through the new "placeholder error" code path, to have self tys displayed and make them hopefully less confusing. Should fix #57362. r? @nikomatsakis — so we can iterate on the specific wording you wanted.
2019-01-28Refer to synthetically named lifetimes as "some specific lifetime" rather ↵Rémy Rakic-6/+6
than "the specific lifetime"
2019-01-28Rollup merge of #57904 - euclio:attribute-typos, r=davidtwcoMazdak Farrokhzad-1/+1
add typo suggestion to unknown attribute error Provides a suggestion using Levenshtein distance to suggest built-in attributes and attribute macros. Fixes #49270.
2019-01-28Unused variable suggestions on all patterns.David Wood-3/+107
This commit extends existing suggestions to prefix unused variable bindings in match arms with an underscore so that it applies to all patterns in a match arm.
2019-01-27add typo suggestion to unknown attribute errorAndy Russell-1/+1
2019-01-27When mentioning lifetimes, put either the trait ref or the self type closer ↵Rémy Rakic-2/+2
to the lifetimes When mentioning lifetimes, only invert wording between the expected trait and the self type when the self type has the vid. This way, the lifetimes always stay close to the self type or trait ref that actually contains them.
2019-01-27Fix issue-57362-1.rs attributesRémy Rakic-0/+0
2019-01-27identify when implemented for "some specific lifetime"Niko Matsakis-12/+14
2019-01-27break apart testsNiko Matsakis-17/+24