about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-03-29Regression test for incremental treatment of ↵Felix S. Klock II-0/+19
rustc_scalar_valid_range_{start,end}.
2019-03-29Regression test for incremental treatment of rustc_on_unimplemented.Felix S. Klock II-0/+27
2019-03-29revert change to test file as per review requestEsteban Küber-2/+1
2019-03-29Rollup merge of #59486 - varkor:dead-code-impl, r=sanxiynMazdak Farrokhzad-0/+17
Visit `ImplItem` in `dead_code` lint Fixes https://github.com/rust-lang/rust/issues/47131.
2019-03-29Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwcoMazdak Farrokhzad-4/+33
Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans Fix #58298.
2019-03-29Rollup merge of #59467 - hgallagher1993:local_branch, r=estebankMazdak Farrokhzad-84/+173
Better diagnostic for binary operation on BoxedValues Fixes #59458
2019-03-29Rollup merge of #59462 - taiki-e:no-core, r=petrochenkovMazdak Farrokhzad-0/+18
Fix error in Rust 2018 + no_core environment Minimized reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b9f6c3026ec9d856699fa6dbd4361f0 This is a fix for the error that occurred in #58702. r? @Centril
2019-03-28fix text after rebaseEsteban Küber-0/+8
2019-03-29Rollup merge of #59394 - mark-i-m:dup-matcher-bindings-2, r=CentrilMazdak Farrokhzad-5/+10
warn -> deny duplicate match bindings This is the next step of https://github.com/rust-lang/rust/issues/57742 r? @Centril - [x] Decide whether to go to deny-by-default or hard error. - My preference is to make this deny-by-default, rather than going straight to a hard error. The CI should fail because I haven't updated the ui test yet. I'll update it when we decide which to do. - [x] Update [test](https://github.com/mark-i-m/rust/blob/c25d6b83441e0c060ee0273193ef27b29e1318cd/src/test/ui/macros/macro-multiple-matcher-bindings.rs) - [ ] ~Crater run~ see https://github.com/rust-lang/rust/pull/59394#issuecomment-477817351
2019-03-29Use platform dependent mcount functionYuki OKUSHI-0/+7
2019-03-28Implement `#[non_exhaustive]` on variants.David Wood-189/+136
This commit removes the check that disallows the `#[non_exhaustive]` attribute from being placed on enum variants and removes the associated tests. Further, this commit lowers the visibility of enum variant constructors when the variant is marked as non-exhaustive.
2019-03-28deny duplicate matcher bindings by defaultmark-5/+10
2019-03-28Add check for when left and right overlap and change span for explanation to ↵hgallagher1993-42/+9
point at operator
2019-03-28Rollup merge of #59429 - estebank:for-loop-move-nll, r=petrochenkovMazdak Farrokhzad-22/+14
When moving out of a for loop head, suggest borrowing it in nll mode Follow up to #59195 for NLL.
2019-03-28Rollup merge of #59408 - euclio:compiletest-normalization, r=oli-obkMazdak Farrokhzad-149/+149
compiletest: make path normalization smarter Fixes #59109.
2019-03-28Rollup merge of #59371 - dlrobertson:rename_va_list_copy, r=joshtriplettMazdak Farrokhzad-20/+20
ffi: rename VaList::copy to VaList::with_copy Rename `VaList::copy` to `VaList::with_copy` r? @joshtriplett
2019-03-28Revise and generalize the macros-unlinted tests.Felix S. Klock II-2/+85
Review feedback asked for the test to be generalized to include macros 2.0; that generalization is dyn-2015-idents-in-decl-macros-unlinted.rs As a drive-by, I also decided to revise the test to make it clear *why* we cannot generally lint these cases. (I already had similar demonstrations in dyn-2015-edition-keyword-ident-lint.rs, but it does not hurt to try to emphasize matters.) I also added some commentary on the cases where we could choose to make the lint smarter, namely the situations where a macro is *definitely* using `dyn` as an identifier (because it is using it as a path component).
2019-03-28Revise test slightly so that `dyn` in macro invocation *must* be parsed as ↵Felix S. Klock II-4/+4
keyword in test. Back-story: After reflection this morning, I realized that the previous form of this test would allow the macro invocation to treat the `dyn` input as a raw-identifier rather than a keyword, and since the input was discarded by that version of the macro, the test would pass despite the detail that the input `dyn` should not have been parsed as a raw-identifier. This revision fixes that oversight, by actually *using* the macro input to construct a `Box<dyn Trait>` type.
2019-03-28Recover from parse error in tuple syntaxEsteban Küber-9/+165
2019-03-28Rollup merge of #59198 - estebank:recovered-pattern, r=zackmdavisMazdak Farrokhzad-27/+4
Do not complain about unmentioned fields in recovered patterns When the parser has to recover from malformed code in a pattern, do not complain about missing fields. Fix #59145.
2019-03-28Rollup merge of #58803 - haraldh:fs_copy_fix, r=alexcrichtonMazdak Farrokhzad-4/+9
fs::copy() unix: set file mode early A convenience method like fs::copy() should try to prevent pitfalls a normal user doesn't think about. In case of an empty umask, setting the file mode early prevents temporarily world readable or even writeable files, because the default mode is 0o666. In case the target is a named pipe or special device node, setting the file mode can lead to unwanted side effects, like setting permissons on `/dev/stdout` or for root setting permissions on `/dev/null`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: https://github.com/rust-lang/rust/issues/26933 Fixed: https://github.com/rust-lang/rust/issues/37885
2019-03-27Expand testEsteban Küber-2/+30
2019-03-27Account for short-hand field syntax when suggesting borrowEsteban Küber-4/+42
2019-03-27Account for fully overlapping multiline annotationsEsteban Küber-12/+9
When two multiline span labels point at the same span, we special case the output to avoid weird behavior: ``` foo( _____^ |_____| || bar, || ); || ^ ||______| |______foo baz ``` instead showing ``` foo( _____^ | bar, | ); | ^ | | |______foo baz ```
2019-03-27Add testEsteban Küber-0/+35
2019-03-27Do not suggest borrowing when the span comes from a macroEsteban Küber-4/+1
2019-03-28Add a regression test for #47131varkor-0/+17
2019-03-27Rollup merge of #59459 - JohnTitor:add-tests, r=CentrilJosh Stone-0/+88
Add some tests close #52977 It seems that there are no tests for this issue, so I opened this PR. off-topic: I noticed [this test](https://github.com/rust-lang/rust/blob/master/src/test/ui/existential_types/nested_existential_types.rs)'s indents are bad, could I include commit to fix this, or should I separate? r? @oli-obk
2019-03-27Rollup merge of #59439 - Centril:generalize-assign-to-bool-diagnostic, r=oli-obkJosh Stone-6/+211
Generalize diagnostic for `x = y` where `bool` is the expected type Extracted out of https://github.com/rust-lang/rust/pull/59288. Currently we special case a diagnostic for `if x = y { ...` since the expected type is `bool` in this case and we instead suggest `if x == y`. This PR generalizes this such that given an expression of form `x = y` (`ExprKind::Assign(..)`) where the expected type is `bool`, we emit a suggestion `x == y`. r? @oli-obk Let's do a perf run to make sure this was not the source of regressions in #59288.
2019-03-27Rollup merge of #59421 - estebank:tuple-index-suffix, r=petrochenkovJosh Stone-24/+68
Reject integer suffix when tuple indexing Fix #59418. r? @varkor
2019-03-27Rollup merge of #59284 - RalfJung:maybe-uninit, r=sfacklerJosh Stone-4/+7
adjust MaybeUninit API to discussions uninitialized -> uninit into_initialized -> assume_init read_initialized -> read set -> write
2019-03-27Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavusJosh Stone-0/+23
Add suggestion to use `&*var` when `&str: From<String>` is expected Fix #53879.
2019-03-27Rollup merge of #57565 - petrochenkov:turbowarn, r=CentrilJosh Stone-57/+9
syntax: Remove warning for unnecessary path disambiguators `rustfmt` is now stable and it removes unnecessary turbofishes, so removing the warning as discussed in https://github.com/rust-lang/rust/pull/43540 (where it was introduced). One hardcoded warning less. Closes https://github.com/rust-lang/rust/issues/58055 r? @nikomatsakis
2019-03-27Rollup merge of #57293 - Zoxc:incr-passes3, r=michaelwoeristerJosh Stone-26/+26
Make some lints incremental Blocked on https://github.com/rust-lang/rust/pull/57253 r? @michaelwoerister
2019-03-27Better diagnostic for binary operation on BoxedValueshgallagher1993-84/+206
2019-03-27Regression test for rust-lang/rust#56327.Felix S. Klock II-0/+25
2019-03-27Some tests illustrating where the revised lint does and does not apply.Felix S. Klock II-0/+346
2019-03-27Add a testTaiki Endo-0/+18
2019-03-27Add some testsYuki OKUSHI-0/+88
2019-03-27add negative test case in assignment-expected-boolMazdak Farrokhzad-2/+23
2019-03-27adjust assignment-in-if test accordingly.Mazdak Farrokhzad-6/+26
2019-03-27add test for assignment x = y where type bool is expected.Mazdak Farrokhzad-0/+164
2019-03-27Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkovbors-2/+43
Introduce proc_macro::Span::source_text A function to extract the actual source behind a Span. Background: I would like to use `syn` in a `build.rs` script to parse the rust code, and extract part of the source code. However, `syn` only gives access to proc_macro2::Span, and i would like to get the source code behind that. I opened an issue on proc_macro2 bug tracker for this feature https://github.com/alexcrichton/proc-macro2/issues/110 and @alexcrichton said the feature should first go upstream in proc_macro. So there it is! Since most of the Span API is unstable anyway, this is guarded by the same `proc_macro_span` feature as everything else.
2019-03-27Give variant parts their own unique idPhilip Craig-1/+1
and bump llvm version in test
2019-03-26Add specific message for tuple struct invoked with suffixed numeric field nameEsteban Küber-1/+19
2019-03-26Reword invalid suffixe errorsEsteban Küber-30/+30
2019-03-26Use `expect_no_suffix` for errorEsteban Küber-7/+6
2019-03-26fix some uses I missedRalf Jung-4/+7
2019-03-26Rollup merge of #59389 - euclio:deprecated-suggestion, r=varkorMazdak Farrokhzad-5/+71
replace redundant note in deprecation warning
2019-03-26Rollup merge of #59315 - Zoxc:move-query, r=oli-obkMazdak Farrokhzad-159/+159
Add no_hash to query macro and move some queries over r? @oli-obk