summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-02-27Permit unwinding through FFI by defaultMark Rousskov-0/+2
See #58794 for context.
2019-02-22partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbcNiko Matsakis-5/+18
This preserves the error you currently get on stable for the old-lub-glb-object.rs test.
2019-02-22update test files to reflect new outputNiko Matsakis-288/+814
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-22restore the actual leak-checkNiko Matsakis-0/+84
2019-02-22make generalization code create new variables in correct universeNiko Matsakis-14/+50
In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out.
2019-02-17avoid committing to autoderef in object method probingAriel Ben-Yehuda-0/+59
2019-02-17add tests to a few edge cases in method lookupAriel Ben-Yehuda-0/+290
These aren't fixed by this PR, but were broken in a few older attempts at it. Make sure they don't regress.
2019-02-17unit test for issue 57673.Felix S. Klock II-0/+21
2019-02-17Address review comments and cleanup codeVadim Petrochenkov-14/+14
2019-02-17#56411 do not suggest a fix for a import conflict in a macroFrançois Mockers-0/+53
2019-02-17Lower constant patterns with ascribed types.David Wood-0/+39
This commit fixes a bug introduced by #55937 which started checking user type annotations for associated type patterns. Where lowering a associated constant expression would previously return a `PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType` with a `PatternKind::Constant` inside, this commit unwraps that to access the constant pattern inside and behaves as before.
2019-02-04Fix bug in integer range matchingvarkor-0/+7
2019-02-04Don't panic when accessing enum variant ctor using `Self` in matchEsteban Küber-0/+24
2019-02-04Pass correct arguments to places_conflictMatthew Jasper-0/+36
The borrow place *must* be a place that we track borrows for, otherwise we will likely ICE.
2019-01-24Fix typo bug in DepGraph::try_mark_green().Michael Woerister-0/+17
2019-01-16Auto merge of #57416 - alexcrichton:remove-platform-intrinsics, r=nagisabors-363/+0
rustc: Remove platform intrinsics crate This was originally attempted in #57048 but it was realized that we could fully remove the crate via the `"unadjusted"` ABI on intrinsics. This means that all intrinsics in stdsimd are implemented directly against LLVM rather than using the abstraction layer provided here. That ends up meaning that this crate is no longer used at all. This crate developed long ago to implement the SIMD intrinsics, but we didn't end up using it in the long run. In that case let's remove it!
2019-01-15Rollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichtonMazdak Farrokhzad-0/+1
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
2019-01-15Rollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obkMazdak Farrokhzad-0/+30
Implement `check_attribute` to forbid `#[allow_internal_unsafe]` Fixes #56768. r? @oli-obk
2019-01-15Rollup merge of #57352 - arielb1:no-manual-markers, r=nikomatsakisMazdak Farrokhzad-0/+132
forbid manually impl'ing one of an object type's marker traits This shouldn't break compatibility for crates that do not use `feature(optin_builtin_traits)`, because as the test shows, it is only possible to impl a marker trait for a trait object in the crate the marker trait is defined in, which must define `feature(optin_builtin_traits)`. Fixes #56934. r? @nikomatsakis
2019-01-15Rollup merge of #56044 - matthewjasper:function-param-drop-order, r=cramertjMazdak Farrokhzad-0/+68
Drop partially bound function parameters in the expected order Given the function ```rust fn foo((_x, _): (LogDrop, LogDrop), (_, _y): (LogDrop, LogDrop)) {} ``` Prior to 1.12.0 we dropped both `_x` and `_y` before the rest of their respective parameters, since then we dropped `_x` and `_y` after. The original order appears to be the correct order, as the value created later is dropped first, so we revert to that order and add a test for it. While this is technically a breaking change, I can't work out how anyone could be relying on this without making their code very brittle. If this is considered to be too likely to break real world code then I can revert the change and change the test to check for the current order.
2019-01-15Fix testsYuki Okushi-32/+11
2019-01-15fix test output changing in rebaseAriel Ben-Yehuda-2/+2
2019-01-15Add error checkYuki Okushi-9/+30
2019-01-15Add testYuki Okushi-0/+30
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-14rustc: Remove platform intrinsics crateAlex Crichton-363/+0
This was originally attempted in #57048 but it was realized that we could fully remove the crate via the `"unadjusted"` ABI on intrinsics. This means that all intrinsics in stdsimd are implemented directly against LLVM rather than using the abstraction layer provided here. That ends up meaning that this crate is no longer used at all. This crate developed long ago to implement the SIMD intrinsics, but we didn't end up using it in the long run. In that case let's remove it!
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-14Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice testAaron Hill-0/+1
This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
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-13forbid manually impl'ing one of an object type's marker traitsAriel Ben-Yehuda-0/+132
This shouldn't break compatibility for crates that do not use `feature(optin_builtin_traits)`, because as the test shows, it is only possible to impl a marker trait for a trait object in the crate the marker trait is defined in, which must define `feature(optin_builtin_traits)`. Fixes #56934
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