summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-06-01change `PointerKind::Implicit` to a noteNiko Matsakis-0/+39
`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-05-25prohibit turbofish in `impl Trait` methodsNiko Matsakis-0/+36
2018-05-24Fix 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-24Fix issue #50811 (`NaN > NaN` was true).kennytm-0/+65
Fix #50811 Make sure the float comparison output is consistent with the expected behavior when NaN is involved. ---- Note: This PR is a **BREAKING CHANGE**. If you have used `>` or `>=` to compare floats, and make the result as the length of a fixed array type, like: ```rust use std::f64::NAN; let x: [u8; (NAN > NAN) as usize] = [1]; ``` then the code will no longer compile. Previously, all float comparison involving NaN will just return "Greater", i.e. `NAN > NAN` would wrongly return `true` during const evaluation. If you need to retain the old behavior (why), you may replace `a > b` with `a != a || b != b || a > b`.
2018-05-24Fix `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-06Fix assertion message generationShotaro Yamada-0/+19
2018-05-06rustdoc: Resolve nested `impl Trait`sShotaro Yamada-0/+7
2018-04-30Adapt ui test of #50092 to betaPietro Albini-27/+10
* Changed `// compile-pass` to `// must-compile-successfully` * Removed checks on unstable features
2018-04-30Do not ICE on generics mismatch with non-local traitsShotaro Yamada-0/+11
Fixes #49841
2018-04-30Warn 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
2018-04-28Don't ICE on tuple struct ctor with incorrect arg countEsteban Küber-1/+22
2018-04-27add regression testNiko Matsakis-0/+22
Fixes #49685
2018-04-27Feature gate where clauses on associated typesMatthew Jasper-3/+26
2018-04-26Allow variant discriminant initializers to refer to other initializers of ↵Oliver Schneider-34/+50
the same enum
2018-04-25Rename ui test flag compile-pass to must-compile-successfullyPietro Albini-6/+6
2018-04-25Warn on all erroneous constantsOliver Schneider-75/+164
2018-04-25always optimize testOliver Schneider-1/+1
The error messages differ between optimized and nonoptimized mode
2018-04-25Only warn on erroneous promoted constantsOliver Schneider-20/+114
2018-04-21Add back missing `#![feature(never_type)]`skennytm-0/+11
2018-04-21Revert "Stabilize the TryFrom and TryInto traits"Felix S. Klock II-3/+5
This reverts commit e53a2a72743810e05f58c61c9d8a4c89b712ad2e.
2018-04-21Bring back old fallback semantics: Without feature(never_type), fallback to ↵Felix S. Klock II-3/+7
`()`, not `!`. Note that this commit, since it is trying to be minimal in order to ease backporting to the beta and release channels, does *not* include the old future-proofing warnings that we used to have associated with such fallback to `()`; see discussion at this comment: https://github.com/rust-lang/rust/issues/49691#issuecomment-381266730
2018-04-21Revert stabilization of `feature(never_type)`.Felix S. Klock II-8/+107
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-20Properly handle ranges of signed enums using both extremums (fixes #49973)Anthony Ramine-0/+20
2018-04-20Disallow `impl Trait` in unsupported positionShotaro Yamada-0/+38
2018-04-20Fix ICE with impl TraitShotaro Yamada-0/+22
2018-04-20do not propagate `Err` when determing causal infoNiko Matsakis-0/+35
In intercrate mode, if we determine that a particular `T: Trait` is unknowable, we sometimes also go and get extra causal information. An errant `?` was causing us to propagate an error found in that process out as if `T: Trait` was not unknowable but rather not provable. This led to an ICE.
2018-04-20make mem-categorization use adjusted type for patternsNiko Matsakis-0/+47
Fixes #49631
2018-04-20add `failure-status: 1` to the testNiko Matsakis-0/+1
2018-04-20Fix ICE with `main`'s return type containing lifetimesShotaro Yamada-0/+66
2018-04-17Sign extend constants in range patternsOliver Schneider-0/+19
2018-04-17Don't recurse into allocations, use a global table insteadOliver Schneider-0/+19
2018-04-14Auto merge of #49880 - oli-obk:backport_allocation_hashing, r=petrochenkovbors-0/+64
[beta] [incremental] Hash `Allocation`s backport of #49752 cc @matklad @sinkuu
2018-04-11[incremental] Hash `Allocation`sShotaro Yamada-0/+64
2018-04-10Fix #49344leonardo.yvens-0/+4
2018-04-02Auto merge of #49124 - abonander:attr-macro-stmt-expr, r=abonanderbors-2/+225
Expand Attributes on Statements and Expressions This enables attribute-macro expansion on statements and expressions while retaining the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356 @petrochenkov @jseyfried r? @nrc
2018-04-02Expand attribute macros on statements and expressions.Austin Bonander-2/+225
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356
2018-04-01Auto merge of #49545 - alexcrichton:proc-macro-fixes, r=eddybbors-3/+84
proc_macro: Tweak doc comments and negative literals This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]` like `macro_rules!` does (instead of treating it as a `Literal` token). Additionally it fixes treatment of negative literals in the compiler, for exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the current compiler implementation, providing a fix at the proc-macro layer rather than the libsyntax layer. Closes #48889
2018-03-31proc_macro: Tweak doc comments and negative literalsAlex Crichton-3/+84
This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]` like `macro_rules!` does (instead of treating it as a `Literal` token). Additionally it fixes treatment of negative literals in the compiler, for exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the current compiler implementation, providing a fix at the proc-macro layer rather than the libsyntax layer.
2018-03-31Auto merge of #49500 - oli-obk:mir_dep_graph, r=michaelwoeristerbors-0/+20
Introduce an edge from a const eval to the MIR of all statics it depends on r? @michaelwoerister
2018-03-31Auto merge of #49459 - GuillaumeGomez:primitive-intra-links, r=QuietMisdreavusbors-0/+19
Add primitive intra-links Part of #43466. r? @QuietMisdreavus
2018-03-30Auto merge of #49425 - alexcrichton:disallow-inline-always, r=petrochenkovbors-1/+12
rustc: Forbid #[inline(always)] with #[target_feature] Once a target feature is enabled for a function that means that it in general can't be inlined into other functions which don't have that target feature enabled. This can cause both safety and LLVM issues if we were to actually inline it, so `#[inline(always)]` both can't be respected and would be an error if we did so! Today LLVM doesn't inline functions with different `#[target_feature]` annotations, but it turns out that if one is tagged with `#[inline(always)]` it'll override this and cause scary LLVM error to arise! This commit fixes this issue by forbidding these two attributes to be used in conjunction with one another. Closes rust-lang-nursery/stdsimd#404
2018-03-30Auto merge of #49403 - oli-obk:try2, r=eddybbors-0/+7
Trim discriminants to their final type size r? @eddyb fixes #49181
2018-03-30Introduce an edge from a const eval to the MIR of all statics it depends onOliver Schneider-0/+20
2018-03-30Auto merge of #49424 - oli-obk:stable_allocid_hash, r=michaelwoeristerbors-0/+28
Fix stable hashing of AllocIds r? @michaelwoerister fixes #49081
2018-03-30Auto merge of #49489 - kennytm:rollup, r=kennytmbors-2/+7
Rollup of 10 pull requests - Successful merges: #49443, #49445, #49446, #49463, #49464, #49466, #49468, #49473, #49484, #49486 - Failed merges:
2018-03-30Rollup merge of #49484 - cuviper:ignore-ibm-stack-probes, r=alexcrichtonkennytm-0/+5
Ignore stack-probes tests on powerpc/s390x too We only support stack probes on x86 and x86_64. Other arches are already ignored.
2018-03-30Rollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=GuillaumeGomezkennytm-2/+2
Explicitly mention `Option` in `?` error message. Save users the time/effort of having to lookup what types implement the `Try` trait.
2018-03-29rustc: Group linked libraries where neededAlex Crichton-0/+63
This commit fixes a longstanding issue with the compiler with circular dependencies between libcore and libstd. The `core` crate requires at least one symbol, the ability to unwind. The `std` crate is the crate which actually defines this symbol, but the `std` crate also depends on the `core` crate. This circular dependency is in general disallowed in Rust as crates cannot have cycles amongst them. A special exception is made just for core/std, but this is also unfortunately incompatible with how GNU linkers work. GNU linkers will process undefined symbols in a left-to-right fashion, only actually linking an rlib like libstd if there are any symbols used from it. This strategy is incompatible with circular dependencies because if we otherwise don't use symbols from libstd we don't discover that we needed it until we're later processing libcore's symbols! To fix this GNU linkers support the `--start-group` and `--end-group` options which indicate "libraries between these markers may have circular dependencies amongst them. The linker invocation has been updated to automatically pass these arguments when we're invoking a GNU linker and automatically calculate where the arguments need to go (around libstd and libcore) Closes #18807 Closes #47074
2018-03-29Ignore stack-probes tests on powerpc/s390x tooJosh Stone-0/+5
We only support stack probes on x86 and x86_64. Other arches are already ignored.
2018-03-29Add primitive intra-linksGuillaume Gomez-0/+19