about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-01-14Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkovMazdak Farrokhzad-6/+78
Recover from item trailing semicolon CC https://github.com/rust-lang/rfcs/pull/2479 r? @petrochenkov
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-152/+49
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-14Rollup merge of #57540 - estebank:eval-more, r=petrochenkovMazdak Farrokhzad-110/+222
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC #48724.
2019-01-14Rollup merge of #57481 - euclio:bool-cast-suggestion, r=estebankMazdak Farrokhzad-20/+25
provide suggestion for invalid boolean cast Also, don't suggest comparing to zero for non-numeric expressions.
2019-01-14Auto merge of #57592 - Centril:rollup, r=Centrilbors-154/+193
Rollup of 6 pull requests Successful merges: - #57232 (Parallelize and optimize parts of HIR map creation) - #57418 (MetadataOnlyCodegenBackend: run the collector only once) - #57465 (Stabilize cfg_target_vendor) - #57477 (clarify resolve typo suggestion) - #57556 (privacy: Fix private-in-public check for existential types) - #57584 (Remove the `connect_timeout_unroutable` test.) Failed merges: r? @ghost
2019-01-14Rollup merge of #57556 - petrochenkov:privexist, r=arielb1Mazdak Farrokhzad-0/+15
privacy: Fix private-in-public check for existential types Fixes https://github.com/rust-lang/rust/issues/53546 (regression from https://github.com/rust-lang/rust/pull/56878) r? @arielb1
2019-01-14Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavisMazdak Farrokhzad-106/+178
clarify resolve typo suggestion Include the kind of the binding that we're suggesting, and use a structured suggestion. Fixes #53445.
2019-01-14Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, ↵Mazdak Farrokhzad-48/+0
r=joshtriplett,Centril Stabilize cfg_target_vendor This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates. This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0. The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs). Closes #29718
2019-01-14Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapinbors-2/+0
Stabilize core::convert::identity r? @SimonSapin fixes https://github.com/rust-lang/rust/issues/53500 This is waiting for FCP to complete but in the interim it would be good to review.
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-48/+0
2019-01-14Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obkbors-250/+220
Use structured suggestions for nonstandard style lints This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered. Fixes #48103. Fixes #52414.
2019-01-13Suggest removal of semicolon when appropriateEsteban Küber-23/+73
2019-01-13Tweak output of type mismatch between "then" and `else` `if` armsEsteban Küber-7/+139
2019-01-13Recover from item trailing semicolonEsteban Küber-6/+78
2019-01-13Auto merge of #57580 - Centril:rollup, r=Centrilbors-28/+123
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2019-01-13Rollup merge of #57538 - dlrobertson:fix_57472, r=zackmdavisMazdak Farrokhzad-0/+55
librustc_mir: Fix ICE with slice patterns If a match arm does not include all fields in a structure and a later pattern includes a field that is an array, we will attempt to use the array type from the prior arm. When calculating the field type, treat a array of an unknown size as a `TyErr`. Fixes: #57472
2019-01-13Rollup merge of #57366 - estebank:point-match-discrim, r=varkorMazdak Farrokhzad-1/+41
Point at match discriminant on type error in match arm pattern ``` error[E0308]: mismatched types --> src/main.rs:5:9 | 4 | let temp: usize = match a + b { | ----- this expression has type `usize` 5 | Ok(num) => num, | ^^^^^^^ expected usize, found enum `std::result::Result` | = note: expected type `usize` found type `std::result::Result<_, _>` ``` Fix #57279.
2019-01-13Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomezMazdak Farrokhzad-27/+27
Simplify foreign type rendering. Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too. Known visual changes (happy to tweak based on feedback): * The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it. * There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly. * "[src]" links are all sized at 17px. A few were 19px in the original. I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing. TODO: - [x] Test on Chrome - [x] Test on Firefox - [ ] ~~Test on UC Android~~ - [x] Test on Edge - [x] Test on iOS safari - [x] Test on desktop safari - [x] Update automated tests - [x] Increase vertical margin - [x] Fix "Important traits for" hover overlap - [x] Wait for #55798 to land & merge it
2019-01-13Auto merge of #51487 - Zoxc:incr-passes, r=michaelwoeristerbors-36/+181
Make more passes incremental r? @michaelwoerister
2019-01-13Auto merge of #57577 - Centril:rollup, r=Centrilbors-127/+217
Rollup of 4 pull requests Successful merges: - #57004 (Make `TokenStream` less recursive.) - #57102 (NLL: Add union justifications to conflicting borrows.) - #57337 (rustc: Place wasm linker args first instead of last) - #57549 (Add #[must_use] message to Iterator and Future) Failed merges: r? @ghost
2019-01-13Rollup merge of #57549 - taiki-e:must_use, r=estebankMazdak Farrokhzad-1/+1
Add #[must_use] message to Iterator and Future ~~Iterator's message is based on current iterator adaptor's #[must_use] message (added in #15561) and https://github.com/rust-lang/rust/pull/56677/files#r241236020~~ Future's message is the same as those used in [futures-rs](https://github.com/rust-lang-nursery/futures-rs/search?q=must_use&unscoped_q=must_use) and [tokio](https://github.com/tokio-rs/tokio/search?q=must_use&unscoped_q=must_use). r? @Centril
2019-01-13Rollup merge of #57102 - davidtwco:issue-57100, r=nikomatsakisMazdak Farrokhzad-126/+216
NLL: Add union justifications to conflicting borrows. Fixes #57100. This PR adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``. r? @pnkfelix
2019-01-13Auto merge of #57567 - Centril:stabilize-transpose, r=alexregbors-2/+0
Stabilize `transpose_result` in 1.33 fixes https://github.com/rust-lang/rust/issues/47338. FCP completed: https://github.com/rust-lang/rust/issues/47338#issuecomment-453762236 r? @alexreg
2019-01-13librustc_mir: Fix ICE with slice patternsDan Robertson-0/+55
If a match arm does not include all fields in a structure and a later pattern includes a field that is an array, we will attempt to use the array type from the prior arm. When calculating the field type, treat a array of an unknown size as a TyErr.
2019-01-13remove extern_in_paths.Mazdak Farrokhzad-152/+49
2019-01-13Auto merge of #57568 - Centril:rollup, r=Centrilbors-49/+147
Rollup of 16 pull requests Successful merges: - #57351 (Don't actually create a full MIR stack frame when not needed) - #57353 (Optimise floating point `is_finite` (2x) and `is_infinite` (1.6x).) - #57412 (Improve the wording) - #57436 (save-analysis: use a fallback when access levels couldn't be computed) - #57453 (lldb_batchmode.py: try `import _thread` for Python 3) - #57454 (Some cleanups for core::fmt) - #57461 (Change `String` to `&'static str` in `ParseResult::Failure`.) - #57473 (std: Render large exit codes as hex on Windows) - #57474 (save-analysis: Get path def from parent in case there's no def for the path itself.) - #57494 (Speed up item_bodies for large match statements involving regions) - #57496 (re-do docs for core::cmp) - #57508 (rustdoc: Allow inlining of reexported crates and crate items) - #57547 (Use `ptr::eq` where applicable) - #57557 (resolve: Mark extern crate items as used in more cases) - #57560 (hygiene: Do not treat `Self` ctor as a local variable) - #57564 (Update the const fn tracking issue to the new metabug) Failed merges: r? @ghost
2019-01-13Change #[must_use] message of IteratorTaiki Endo-1/+1
2019-01-13stabilize transpose_result in 1.33Mazdak Farrokhzad-2/+0
2019-01-13Rollup merge of #57564 - varkor:update-const_fn-tracking-issue, r=CentrilMazdak Farrokhzad-4/+4
Update the const fn tracking issue to the new metabug The new `const fn` tracking issue is #57563. We don't want to point to a closed issue in the diagnostics (or FIXMEs), so these have been updated (from the old issue, #24111). r? @Centril
2019-01-13Rollup merge of #57560 - petrochenkov:selfinmac, r=alexregMazdak Farrokhzad-0/+21
hygiene: Do not treat `Self` ctor as a local variable Fixes https://github.com/rust-lang/rust/issues/57523
2019-01-13Rollup merge of #57557 - petrochenkov:ecused, r=varkorMazdak Farrokhzad-0/+66
resolve: Mark extern crate items as used in more cases Fixes https://github.com/rust-lang/rust/issues/57421
2019-01-13Rollup merge of #57508 - DebugSteven:inline-extern, r=GuillaumeGomezMazdak Farrokhzad-0/+11
rustdoc: Allow inlining of reexported crates and crate items Fixes #46296 This PR checks for when a `pub extern crate` statement has a `#[doc(inline)]` attribute & inlines its contents. Code is based off of the inlining statements for `pub use` statements.
2019-01-13Rollup merge of #57412 - JohnTitor:improve-the-wording-1, r=varkorMazdak Farrokhzad-45/+45
Improve the wording I'm sorry but re-opened the PR because I failed to squash commits(#57397). Fixes #55752. r? @varkor
2019-01-12Don't add label to the match expr when the type is not fully realizedEsteban Küber-13/+1
2019-01-12Reword label as per review commentEsteban Küber-25/+25
2019-01-12Point at the match discriminant when arm pattern has a type mismatchEsteban Küber-2/+54
2019-01-12Suggest correct location for lifetime parameters in useEsteban Küber-38/+39
2019-01-13const stabilize .Mazdak Farrokhzad-2/+0
2019-01-13Update the const fn tracking issue to the new metabugvarkor-4/+4
2019-01-12Remove unrelated errors from parse stderr testsEsteban Küber-105/+35
2019-01-13hygiene: Do not treat `Self` ctor as a local variableVadim Petrochenkov-0/+21
2019-01-13resolve: Mark extern crate items as used in more casesVadim Petrochenkov-0/+66
2019-01-13privacy: Fix private-in-public check for existential typesVadim Petrochenkov-0/+15
2019-01-12Auto merge of #56759 - petrochenkov:prestabuni, r=nikomatsakisbors-236/+158
Stabilize `uniform_paths` Address all the things described in https://github.com/rust-lang/rust/issues/56417. Assign visibilities to `macro_rules` items - `pub` to `macro_export`-ed macros and `pub(crate)` to non-exported macros, these visibilities determine how far these macros can be reexported with `use`. Prohibit use of reexported inert attributes and "tool modules", after renaming (e.g. `use inline as imported_inline`) their respective tools and even compiler passes won't be able to recognize and properly check them. Also turn use of uniform paths in 2015 macros into an error, I'd prefer to neither remove nor stabilize them right away because I still want to make some experiments in this area (uniform path fallback was added to 2015 macros used on 2018 edition in https://github.com/rust-lang/rust/pull/56053#issuecomment-441405140). UPDATE: The last commit also stabilizes the feature `uniform_paths`. Closes https://github.com/rust-lang/rust/issues/53130 Closes https://github.com/rust-lang/rust/issues/55618 Closes https://github.com/rust-lang/rust/issues/56326 Closes https://github.com/rust-lang/rust/issues/56398 Closes https://github.com/rust-lang/rust/issues/56417 Closes https://github.com/rust-lang/rust/issues/56821 Closes https://github.com/rust-lang/rust/issues/57252 Closes https://github.com/rust-lang/rust/issues/57422
2019-01-12Fix a hole in generic parameter import future-proofingVadim Petrochenkov-7/+42
Add some tests for buggy derive helpers
2019-01-12Stabilize `uniform_paths`Vadim Petrochenkov-191/+48
2019-01-12resolve: Prohibit use of imported tool modulesVadim Petrochenkov-6/+44
2019-01-12resolve: Prohibit use of imported non-macro attributesVadim Petrochenkov-4/+23
2019-01-12resolve: Prohibit use of uniform paths in macros originating from 2015 editionVadim Petrochenkov-1/+1
...while still keeping ambiguity errors future-proofing for uniform paths. This corner case is not going to be stabilized for 1.32 and needs some more general experiments about retrofitting 2018 import rules to 2015 edition
2019-01-12resolve: Assign `pub` and `pub(crate)` visibilities to `macro_rules` itemsVadim Petrochenkov-40/+13