summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2018-01-12Treat #[path] files as mod.rs filesTaylor Cramer-10/+1
2018-01-01Auto merge of #47098 - estebank:immutable-field, r=nagisabors-39/+42
Reword trying to operate in immutable fields The previous message ("cannot assign/mutably borrow immutable field") when trying to modify a field of an immutable binding gave the (incorrect) impression that fields can be mutable independently of their ADT's binding. Slightly reword the message to read "cannot assign/mutably borrow field of immutable binding". Re #35937.
2018-01-01Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfriedbors-0/+29
Allow lifetimes in macros This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303. In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes. Still to do: - [x] Feature gate
2018-01-01Auto merge of #47064 - kennytm:force-trailing-newlines, r=estebankbors-4/+2
Add a tidy check for missing or too many trailing newlines. I've noticed recently there are lots of review comments requesting to fix trailing newlines. If this is going to be an official style here, it's better to let the CI do this repetitive check.
2017-12-31Reword trying to operate in immutable fieldsEsteban Küber-39/+42
The previous message ("cannot assign/mutably borrow immutable field") when trying to modify a field of an immutable binding gave the (incorrect) impression that fields can be mutable independently of their ADT's binding. Slightly reword the message to read "cannot assign/mutably borrow field of immutable binding".
2017-12-30in which leading zeroes on tuple-struct accesses are abjuredZack M. Davis-0/+36
Resolves #47073.
2017-12-30Remove excessive trailing newlines.kennytm-2/+0
2017-12-30Add trailing newlines to files which have no trailing newlines.kennytm-2/+2
2017-12-28Add feature gate macro_lifetime_matcherMatt Peterson-0/+29
2017-12-28Auto merge of #47021 - shssoichiro:46576-Incorrect-Span-Imports, r=estebankbors-2/+47
Pass correct span when lowering grouped imports Solves incorrect diagnostics for unused or deprecated imports. Closes #46576. Deprecated imports had an existing test which asserted the incorrect span. That test has been corrected as part of this commit.
2017-12-27Auto merge of #46479 - bkchr:termination_trait, r=arielb1bors-10/+47
Implements RFC 1937: `?` in `main` This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function. Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help! The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
2017-12-27Auto merge of #46803 - estebank:non-ascii-def-span, r=petrochenkovbors-18/+8
Use def span for non-ascii ident feature gate error
2017-12-26Pass correct span when lowering grouped importsJosh Holmer-2/+47
Solves incorrect diagnostics for unused or deprecated imports. Closes #46576. Deprecated imports had an existing test which asserted the incorrect span. That test has been corrected as part of this commit.
2017-12-26Auto merge of #46956 - estebank:incompatible-arm-span-label, r=Zoxcbors-20/+5
"incompatible arm" diagnostic span tweak Use span label instead of span note for single line spans in "incompatible arm" diagnostic.
2017-12-26convert print-type-sizes to use `start` instead of `main`Niko Matsakis-10/+47
This avoids bringing in unwind machinery.
2017-12-25Auto merge of #46973 - arielb1:tuple-casting, r=estebankbors-0/+94
Update check::cast::pointer_kind logic to new rustc Make the match exhaustive, adding handling for anonymous types and tuple coercions on the way. Also, exit early when type errors are detected, to avoid error cascades and the like. Fixes #33690. Fixes #46365. Fixes #46880.
2017-12-25"incompatible arm" diagnostic span tweakEsteban Küber-20/+5
Use span label instead of span note for single line spans in "incompatible arm" diagnostic.
2017-12-25Auto merge of #46949 - davidtwco:issue-46631, r=arielb1bors-0/+47
MIR borrowck: no "move occurs because `X` is not Copy` error Fixes #46631. r? @arielb1
2017-12-25Auto merge of #46914 - mikeyhew:raw_pointer_self, r=arielb1bors-2/+4
Convert warning about `*const _` to a future-compat lint #46664 was merged before I could convert the soft warning about method lookup on `*const _` into a future-compatibility lint. This PR makes that change. fixes #46837 tracking issue for the future-compatibility lint: #46906 r? @arielb1
2017-12-24Handle casts to integer/float variablesAriel Ben-Yehuda-0/+25
These can happen if prior errors disable defaulting. Fixes #43825.
2017-12-23Update check::cast::pointer_kind logic to new rustcAriel Ben-Yehuda-0/+69
Make the match exhaustive, adding handling for anonymous types and tuple coercions on the way. Also, exit early when type errors are detected, to avoid error cascades and the like.
2017-12-23Auto merge of #46864 - estebank:closure-type-err-sp, r=nikomatsakisbors-67/+23
Closure type error ui tweak Do not point at the same span on all notes/help messages, and instead show them without a span.
2017-12-23Auto merge of #46857 - estebank:use-loop-sp, r=nikomatsakisbors-24/+5
Point at `while true` span instead of entire block
2017-12-22Auto merge of #46838 - pnkfelix:issue-46112-followup, r=estebankbors-2/+2
Followup for #46112. Sorting by crate-num should ensure that we favor `std::foo::bar` over `any_other_crate::foo::bar`. Interestingly, *this* change had a much larger impact on our internal test suite than PR #46708 (which was my original fix to #46112).
2017-12-22Updated existing tests.David Wood-0/+2
2017-12-22Converted moves-based-on-type-tuple test and added MIR borrowck comparison.David Wood-0/+45
2017-12-22Convert warning about `*const _` to a future-compat lintMichael Hewson-2/+4
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-20/+60
Do not emit type errors on recovered blocks When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user. Fix #44579.
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-20/+60
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-21Auto merge of #45930 - jplatte:generics_refactoring, r=eddybbors-8/+8
Generics refactoring (groundwork for const generics) These changes were suggested by @eddyb. After this change, the `Generics` contain one `Vec` of an enum for the generic parameters, rather than two separate `Vec`s for lifetime and type parameters. Type params and const params will need to be in a shared `Vec` to preserve their ordering, and moving lifetimes into the same `Vec` should simplify the code that processes `Generics`.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-8/+8
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-21Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkovGuillaume Gomez-14/+10
Use def span for associated function suggestions
2017-12-21Rollup merge of #46827 - petrochenkov:assocrecov2, r=estebankGuillaume Gomez-3/+89
syntax: Follow-up to the incorrect qpath recovery PR cc https://github.com/rust-lang/rust/pull/46788 Add tests checking that "priority" of qpath recovery is higher than priority of unary and binary operators Fix regressed parsing of paths with fn-like generic arguments r? @estebank
2017-12-21Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakisbors-6/+262
Implement non-mod.rs mod statements Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660 This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-20Fix parsing of paths with fn-like generic argumentsVadim Petrochenkov-15/+7
2017-12-20Add tests checking taht "priority" of qpath recovery is higher than unary ↵Vadim Petrochenkov-3/+97
and binary operators
2017-12-20convert region-liveness-drop{-,-no-}may-dangle.rs into ui testsNiko Matsakis-0/+114
The "match exact bits of CFG" approach was fragile and uninformative.
2017-12-20when using feature(nll), don't warn about AST-based region errorsNiko Matsakis-1/+52
Also, keep reporting AST-based region errors that are not occuring in a fn body.
2017-12-20Add nll feature and make nll imply nll_dump_causeSantiago Pastorino-6/+35
2017-12-20use `report_generic_bound_failure` when we can in the compilerNiko Matsakis-58/+102
2017-12-20connect NLL machinery to the `NiceRegionError` codeNiko Matsakis-62/+76
2017-12-20only dump causes if we have nothing betterNiko Matsakis-5/+5
2017-12-20Add three point error handling to borrowckSantiago Pastorino-9/+35
Closes #45988
2017-12-20connect NLL type checker to the impl trait codeNiko Matsakis-0/+118
We now add the suitable `impl Trait` constraints.
2017-12-20propagate `region_bound_pairs` into MIR type-checkNiko Matsakis-0/+252
2017-12-20get the `DefiningTy` from the `body_owner_kind` not typeNiko Matsakis-0/+21
The type isn't a good idea because we want to treat constants uniformly, regardless of what type of value they produce.
2017-12-20Various tweaksEsteban Küber-19/+14
2017-12-20Rollup merge of #46856 - estebank:missing-in-impl-def-span, r=arielb1kennytm-56/+24
Point at def span in "missing in impl" error
2017-12-20Rollup merge of #46835 - topecongiro:bad-span-for-macro-invocation-in-type, ↵kennytm-3/+2
r=petrochenkov Remove a token after closing delimiter from the span of macro in type position e.g. ```rust let x = y: foo!(); ``` The span for `foo!()` includes `;`. cc https://github.com/rust-lang-nursery/rustfmt/issues/2290.
2017-12-20Auto merge of #46733 - nikomatsakis:nll-master-to-rust-master-5, r=arielb1bors-33/+2392
nll part 5 Next round of changes from the nll-master branch. Extensions: - we now propagate ty-region-outlives constraints out of closures and into their creator when necessary - we fix a few ICEs that can occur by doing liveness analysis (and the resulting normalization) during type-checking - we handle the implicit region bound that assumes that each type `T` outlives the fn body - we handle normalization of inputs/outputs in fn signatures Not included in this PR (will come next): - handling `impl Trait` - tracking causal information - extended errors r? @arielb1