summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2018-07-03use `pat_ty_adjusted` from `expr_use_visitor` to type of argumentsNiko Matsakis-0/+42
2018-06-08Do not promote union field accessesOliver Schneider-0/+38
2018-06-08Deny #[cfg] and #[cfg_attr] on generic parameters.kennytm-0/+84
2018-06-08Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"Pietro Albini-44/+66
This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.
2018-06-03typeck: Do not pass the field check on field errorDan Robertson-0/+72
If a struct pattern has a field error return an error.
2018-06-03change `PointerKind::Implicit` to a noteNiko Matsakis-0/+52
`PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo. The `note` field, in contrast, is intended more-or-less primarily for this purpose of adding extra data.
2018-06-03restore emplacement syntax (obsolete)Niko Matsakis-0/+43
2018-06-03prohibit turbofish in `impl Trait` methodsNiko Matsakis-0/+36
2018-06-03[beta] Fix naming conventions for new lintsVadim Petrochenkov-22/+22
2018-05-25Beta branch does not have const fn `subsec_millis` yetOliver Schneider-14/+1
2018-05-24Enforce stability of const fn in promotedsOliver Schneider-0/+87
2018-05-21Fix `fn main() -> impl Trait` for non-`Termination` traitleonardo.yvens-0/+24
Fixes #50595. This bug currently affects stable. Why I think we can go for hard error: - It will in stable for at most one cycle and there is no legitimate reason to abuse it, nor any known uses in the wild. - It only affects `bin` crates (which have a `main`), so there is little practical difference between a hard error or a deny lint, both are a one line fix. The fix was to just unshadow a variable. Thanks @nikomatsakis for the mentoring! r? @nikomatsakis
2018-05-13typeck: Fix ICE with struct update syntaxDan Robertson-0/+40
If check_expr_struct_fields fails, do not continue to record update. If we continue to record update, the struct may cause us to ICE later on indexing a field that may or may not exist.
2018-05-06in which the must-use additional messaging is tucked into a noteZack M. Davis-2/+5
Also, a comment is edited to reflect that spaces around the equals-sign in attributes is the standard (q.v. rust-lang-nursery/fmt-rfcs@bea80532e7).
2018-05-05Suggest more helpful formatting stringKornel-4/+7
2018-05-04Fold rustfix tests back into the UI test suiteAlex Crichton-11/+178
2018-05-04First step towards rustfix compiletest modePascal Hertleif-0/+20
This is the first small step towards testing auto-fixable compiler suggestions using compiletest. Currently, it only checks if next to a UI test there also happens to a `*.rs.fixed` file, and then uses rustfix (added as external crate) on the original file, and asserts that it produces the fixed version. To show that this works, I've included one such test. I picked this test case at random (and because it was simple) -- It is not relevant to the 2018 edition. Indeed, in the near future, we want to be able to restrict rustfix to edition-lints, so this test cast might go away soon. In case you still think this is somewhat feature-complete, here's a quick list of things currently missing that I want to add before telling people they can use this: - [ ] Make this an actual compiletest mode, with `test [fix] …` output and everything - [ ] Assert that fixed files still compile - [ ] Assert that fixed files produce no (or a known set of) diagnostics output - [ ] Update `update-references.sh` to support rustfix - [ ] Use a published version of rustfix (i.e.: publish a new version rustfix that exposes a useful API for this)
2018-05-03Auto merge of #50413 - kennytm:rollup, r=kennytmbors-2/+53
Rollup of 12 pull requests Successful merges: - #50302 (Add query search order check) - #50320 (Fix invalid path generation in rustdoc search) - #50349 (Rename "show type declaration" to "show declaration") - #50360 (Clarify wordings of the `unstable_name_collision` lint.) - #50365 (Use two vectors in nearest_common_ancestor.) - #50393 (Allow unaligned reads in constants) - #50401 (Revert "Implement FromStr for PathBuf") - #50406 (Forbid constructing empty identifiers from concat_idents) - #50407 (Always inline simple BytePos and CharPos methods.) - #50416 (check if the token is a lifetime before parsing) - #50417 (Update Cargo) - #50421 (Fix ICE when using a..=b in a closure.) Failed merges:
2018-05-04Rollup merge of #50406 - ExpHP:concat-nonzero-idents, r=dtolnaykennytm-0/+23
Forbid constructing empty identifiers from concat_idents The empty identifier is a [reserved identifier](https://github.com/rust-lang/rust/blob/8a37c75a3a661385cc607d934c70e86a9eaf5fd7/src/libsyntax_pos/symbol.rs#L300-L305) in rust, apparently used for black magicks like representing the crate root or somesuch... and therefore, being able to construct it is Ungood. Presumably. ...even if the macro that lets you construct it is so useless that you can't actually do any damage with it. (and believe me, I tried) Fixes #50403. **Note:** I noticed that when you try to do something similar with `proc_macro::Term`, the compiler actually catches it and flags the identifier as reserved. Perhaps a better solution would be to somehow have that same check applied here.
2018-05-04Rollup merge of #50393 - oli-obk:packed_const_panic, r=eddybkennytm-0/+28
Allow unaligned reads in constants fixes #50356 introduced in https://github.com/rust-lang/rust/pull/49513
2018-05-04Rollup merge of #50360 - kennytm:fix-50232-clarify-unstable-name-collision, ↵kennytm-2/+2
r=nikomatsakis Clarify wordings of the `unstable_name_collision` lint. Stabilizing an inherent method may cause change in behavior instead of inference error. Updated to use the wording from [varkor's comment]. Closes #50232. [varkor's comment]: https://github.com/rust-lang/rust/issues/50232#issuecomment-384678097
2018-05-03Auto merge of #50030 - flip1995:rfc2103, r=petrochenkovbors-0/+26
Implement tool_attributes feature (RFC 2103) cc #44690 This is currently just a rebased and compiling (hopefully) version of #47773. Let's see if travis likes this. I will add the implementation for `tool_lints` this week.
2018-05-03add missing output for ui testMichael Lamparski-0/+8
2018-05-02forbid empty identifiers from concat_identsMichael Lamparski-0/+15
2018-05-02Auto merge of #50355 - petrochenkov:50187, r=oli-obkbors-0/+49
Fix an unresolved import issue with enabled `use_extern_macros` This is a kinda ugly special-purpose solution that will break if we suddenly add a fourth namespace, but I hope to come up with something more general if I get to import resolution refactoring this summer. Fixes https://github.com/rust-lang/rust/issues/50187 thus removing a blocker for stabilization of `use_extern_macros`
2018-05-02Auto merge of #50354 - varkor:initial-field-alignment-c-int, r=eddybbors-0/+47
Correct initial field alignment for repr(C)/repr(int) Fixes #50098 following https://github.com/rust-lang/rust/issues/50098#issuecomment-385497333. (I wasn't sure which kind of test was best suited here — I picked run-pass simply because that was convenient, but if codegen is more appropriate, let me know and I'll change it.) r? @eddyb
2018-05-02Allow unaligned reads in constantsOliver Schneider-0/+28
2018-05-02Auto merge of #49943 - pnkfelix:fix-issue-49918, r=nikomatsakisbors-32/+74
Treat generators as if they have an arbitrary destructor Conservatively assume dropping a generator touches its upvars, via locals' destructors. Fix #49918
2018-05-02make it compile againflip1995-1/+2
2018-05-02Add tests for a new feature 'tool_attributes'Seiichi Uchida-0/+25
2018-05-01Auto merge of #49982 - petrochenkov:noreex, r=alexcrichtonbors-267/+247
Remove unstable `macro_reexport` It's subsumed by `feature(use_extern_macros)` and `pub use` cc https://github.com/rust-lang/rust/issues/35896 closes https://github.com/rust-lang/rust/issues/29638 closes https://github.com/rust-lang/rust/issues/38951
2018-05-01Update ui/generator tests to reflect changes from new generator drop rules.Felix S. Klock II-32/+74
2018-05-01Add a print_types_sizes regression testvarkor-0/+47
2018-05-01Auto merge of #49789 - petrochenkov:prelext, r=nikomatsakisbors-0/+19
Module experiments: Add one more prelude layer for extern crate names passed with `--extern` Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183 When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order: - local variables - items in unnamed blocks - items in the current module - :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude") - standard library prelude (`Vec`, `drop`) - language prelude (built-in types like `u8`, `str`, etc) The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types. This is a one-time breaking change, that's why it would be nice to run this through crater. Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).
2018-05-01Fix an error from "unused" lint + Fix rebaseVadim Petrochenkov-81/+73
2018-05-01Give removal reasons to removed featuresVadim Petrochenkov-0/+6
2018-05-01Remove `macro_reexport`Vadim Petrochenkov-267/+249
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-05-01Auto merge of #50198 - oli-obk:const_prop, r=eddybbors-9/+8
Remove some unused code
2018-05-01Clarify wordings of the `unstable_name_collision` lint.kennytm-2/+2
Stabilizing an inherent method may cause change in behavior instead of inference error. Updated to use the wording from [varkor's comment]. Closes #50232. [varkor's comment]: https://github.com/rust-lang/rust/issues/50232#issuecomment-384678097
2018-05-01Better support for import resolution in 3 namespacesVadim Petrochenkov-0/+49
2018-04-30Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakisbors-239/+104
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940) r? @nikomatsakis
2018-05-01Rollup merge of #50327 - varkor:match-unused-struct-field, r=estebankkennytm-6/+85
Display correct unused field suggestion for nested struct patterns Extends https://github.com/rust-lang/rust/pull/47922 by checking more sophisticated patterns (e.g. references, slices, etc.). Before: ``` warning: unused variable: `bar` --> src/main.rs:37:21 | 37 | &Foo::Bar { bar } => true, | ^^^ help: consider using `_bar` instead | = note: #[warn(unused_variables)] on by default ``` After: ``` warning: unused variable: `bar` --> src/main.rs:37:21 | 37 | &Foo::Bar { bar } => true, | ^^^ help: try ignoring the field: `bar: _` | = note: #[warn(unused_variables)] on by default ``` Fixes #50303. r? @estebank
2018-04-30Improve div by zero const eval errorsOliver Schneider-6/+5
2018-04-30Update ui test outputOliver Schneider-7/+7
2018-04-30Auto merge of #50272 - scottmcm:termination-test-error, r=nikomatsakisbors-0/+34
Add a ui test for an incorrect Result success type in a #[test] cc https://github.com/rust-lang/rust/issues/48854#issuecomment-384730601 r? @nikomatsakis
2018-04-30Correct unused field warning on struct match container patternsvarkor-6/+55
2018-04-30Auto merge of #50092 - abonander:issue-49934, r=petrochenkovbors-0/+102
Warn on pointless #[derive] in more places This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly. closes #49934
2018-04-30Correct unused field warning on box struct matchvarkor-9/+21
2018-04-30Correct unused field warning on &struct matchvarkor-4/+22
2018-04-29Warn on pointless `#[derive]` in more placesAustin Bonander-0/+102
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes #49934