summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-07-18add test for #52213Ariel Ben-Yehuda-0/+24
2018-07-03use `pat_ty_adjusted` from `expr_use_visitor` to type of argumentsNiko Matsakis-0/+42
2018-06-08Deduplicate and fix a testOliver Schneider-48/+11
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-50/+89
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-24/+24
2018-06-03fix @!has conditions in pub-use-extern-macros testQuietMisdreavus-3/+3
2018-06-03update "pub-use-extern-macros" test to hide the regular import statementQuietMisdreavus-0/+1
2018-06-03Make sure the float comparison output is consistent with the expectedkennytm-0/+65
behavior when NaN is involved.
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/+37
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-15Fix self referential impl Trait substitutionsleonardo.yvens-0/+29
A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes #49376 Fixes #50626 r? @petrochenkov
2018-05-14rustc: don't trip an assertion for enums with present but uninhabited variants.Eduard-Mihai Burtescu-0/+15
2018-05-14typeck: Save the index of private fieldsDan Robertson-0/+59
Save the index of all fields regardless of their visibility. Problems could occur later when attempting to index fields in error recovery if they are not inserted.
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-13rustc: leave space for fields of uninhabited types to allow partial ↵Eduard-Mihai Burtescu-4/+69
initialization.
2018-05-07Auto merge of #50305 - GuillaumeGomez:fix-mod-stackoverflow, r=QuietMisdreavusbors-0/+37
Prevent infinite recursion of modules Fixes #50196. r? @QuietMisdreavus
2018-05-07Auto merge of #50454 - Manishearth:edition-preview-fixes, r=alexcrichtonbors-3/+11
Various edition preview fixes Implement a bunch of things discussed in the meeting.
2018-05-07Prevent infinite recursion of modulesGuillaume Gomez-0/+37
2018-05-07Auto merge of #50000 - michaelwoerister:cross-lang-lto, r=alexcrichtonbors-0/+80
Add some groundwork for cross-language LTO. Implements part of #49879: - Adds a `-Z cross-lang-lto` flag to rustc - Makes sure that bitcode is embedded in object files if the flag is set. This should already allow for using cross language LTO for staticlibs (where one has to invoke the linker manually anyway). However, `rustc` will not try to enable LTO for its own linker invocations yet. r? @alexcrichton
2018-05-07Fix Mac OS section name for LLVM bitcode.Michael Woerister-1/+1
2018-05-06in which the must-use additional messaging is tucked into a noteZack M. Davis-5/+12
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-06Fix assertion message generationShotaro Yamada-0/+19
2018-05-05Auto merge of #50276 - Zoxc:build-cleanup, r=alexcrichtonbors-1/+1
Misc tweaks This: - ~~Add explicit dependencies on `getops`~~ - Fixes the libtest-json test when `RUST_BACKTRACE=1` is set - ~~Sets `opt-level` to `3`~~ - Removes the use of `staged_api` from `rustc_plugin` - ~~Enables the Windows Error Reporting dialog when running rustc during bootstrapping~~ - Disables Windows Error Reporting dialog when running compiletest tests - Enables backtraces when running rustc during bootstrapping - ~~Removes the `librustc` dependency on `libtest`~~ - Triggers JIT debugging on Windows if rustc panics during bootstrapping r? @alexcrichton
2018-05-05Suggest more helpful formatting stringKornel-4/+7
2018-05-05Fix libtest-json testJohn Kåre Alsaker-1/+1
2018-05-05Auto merge of #50419 - sinkuu:rustdoc_nested_impl_trait, r=QuietMisdreavusbors-0/+7
rustdoc: Resolve nested `impl Trait`s Fixes #50358. Populates `cx.impl_trait_bounds` incrementally while `clean`ing generic params, so that a synthetic type-parameter can refer to previous ones. cc #50366
2018-05-04Fold rustfix tests back into the UI test suiteAlex Crichton-11/+178
2018-05-04test: Make a dedicated testsuite for rustfixAlex Crichton-0/+367
This commit adds a dedicated mode to compiletest for running rustfix tests, adding a new `src/test/rustfix` directory which will execute all tests as a "rustfix" test, namely requiring that a `*.fixed` is next to the main file which is the result of the rustfix project's application of fixes. The `rustfix` crate is pulled in to actually perform the fixing, and the rustfix compiletest mode will assert a few properties about the fixing: * The expected fixed output must be the same as rustc's output suggestions applied to the original code. * The fixed code must compile successfully * The fixed code must have no further diagnostics emitted about it
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-04Make extern_absolute_paths only work on the new editionManish Goregaokar-3/+11
2018-05-04Auto merge of #49870 - ↵bors-53/+122
pnkfelix:issue-27282-immut-borrow-all-pat-ids-in-guards, r=nikomatsakis Immutably and implicitly borrow all pattern ids for their guards (NLL only) This is an important piece of rust-lang/rust#27282. It applies only to NLL mode. It is a change to MIR codegen that is currently toggled on only when NLL is turned on. It thus affect MIR-borrowck but not the earlier static analyses (such as the type checker). This change makes it so that any pattern bindings of type T for a match arm will map to a `&T` within the context of the guard expression for that arm, but will continue to map to a `T` in the context of the arm body. To avoid surfacing this type distinction in the user source code (which would be a severe change to the language and would also require far more revision to the compiler internals), any occurrence of such an identifier in the guard expression will automatically get a deref op applied to it. So an input like: ```rust let place = (1, Foo::new()); match place { (1, foo) if inspect(foo) => feed(foo), ... } ``` will be treated as if it were really something like: ```rust let place = (1, Foo::new()); match place { (1, Foo { .. }) if { let tmp1 = &place.1; inspect(*tmp1) } => { let tmp2 = place.1; feed(tmp2) }, ... } ``` And an input like: ```rust let place = (2, Foo::new()); match place { (2, ref mut foo) if inspect(foo) => feed(foo), ... } ``` will be treated as if it were really something like: ```rust let place = (2, Foo::new()); match place { (2, Foo { .. }) if { let tmp1 = & &mut place.1; inspect(*tmp1) } => { let tmp2 = &mut place.1; feed(tmp2) }, ... } ``` In short, any pattern binding will always look like *some* kind of `&T` within the guard at least in terms of how the MIR-borrowck views it, and this will ensure that guard expressions cannot mutate their the match inputs via such bindings. (It also ensures that guard expressions can at most *copy* values from such bindings; non-Copy things cannot be moved via these pattern bindings in guard expressions, since one cannot move out of a `&T`.)
2018-05-04Auto merge of #50435 - cuviper:rm-lookup_host, r=sfacklerbors-4/+2
Remove the deprecated std::net::{lookup_host,LookupHost} These are unstable, and were deprecated by #47510, since Rust 1.25. The internal `sys` implementations are still kept to support the call in the common `resolve_socket_addr`.
2018-05-04Update mir-opt test to reflect change to MIR code-generation.Felix S. Klock II-53/+61
2018-05-04Auto merge of #50409 - KiChjang:issue-50343, r=nikomatsakisbors-0/+34
Skip checking for unused mutable locals that have no name Fixes #50343.
2018-05-03Remove the deprecated std::net::{lookup_host,LookupHost}Josh Stone-4/+2
These are unstable, and were deprecated by #47510, since Rust 1.25. The internal `sys` implementations are still kept to support the call in the common `resolve_socket_addr`.
2018-05-03Auto merge of #50413 - kennytm:rollup, r=kennytmbors-7/+109
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 #50320 - GuillaumeGomez:fix-search-path-generation, ↵kennytm-4/+6
r=QuietMisdreavus Fix invalid path generation in rustdoc search Fixes #50311.
2018-05-03Fix invalid path generation in rustdoc searchGuillaume Gomez-4/+6
2018-05-04Rollup merge of #50416 - rleungx:non-lifetime, r=estebankkennytm-0/+20
check if the token is a lifetime before parsing Fixes #50381.
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 #50421 - ↵kennytm-0/+27
kennytm:fix-50415-ice-when-returning-range-inclusive-from-closure, r=michaelwoerister Fix ICE when using a..=b in a closure. Fix #50415.
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