summary refs log tree commit diff
path: root/src/test/ui
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 `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-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-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-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-15/+100
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-19/+147
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/+3
`()`, 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/+79
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-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-17Sign extend constants in range patternsOliver Schneider-0/+19
2018-04-02Expand attribute macros on statements and expressions.Austin Bonander-2/+2
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356
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-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-29Stabilize underscore lifetimesTaylor Cramer-60/+18
2018-03-28Explicitly mention `Option` in `?` error message.Corey Farwell-2/+2
Save users the time/effort of having to lookup what types implement the `Try` trait.
2018-03-28Stabilize match_default_bindingsTaylor Cramer-171/+16
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-27rustc: Forbid #[inline(always)] with #[target_feature]Alex Crichton-1/+12
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. cc rust-lang-nursery/stdsimd#404
2018-03-28Rollup merge of #49426 - lukaslueg:patch-1, r=kennytmkennytm-5/+3
Update CONTRIBUTING.md The current link is a 404, just link to the main repo page
2018-03-27Rollup merge of #49223 - GuillaumeGomez:propose-variant-for-E0599, r=cramertjkennytm-0/+4
Propose a variant if it is an enum for E0599 Fixes #49192.
2018-03-26Stabilize the TryFrom and TryInto traitsSimon Sapin-5/+3
Tracking issue: https://github.com/rust-lang/rust/issues/33417
2018-03-26Fix e0658 ui testMark Mansi-7/+12
2018-03-26update testMark Mansi-7/+7
2018-03-26Fix missed i128 feature gatesMark Mansi-47/+0
2018-03-26Stabilize i128 feature tooMark Mansi-1/+1
2018-03-26Stabilize i128_typeMark Mansi-76/+5
2018-03-26Auto merge of #49255 - cramertj:stable-impl-trait, r=nikomatsakisbors-113/+41
Stabilize impl Trait Blocked on: - [x] https://github.com/rust-lang/rust/pull/49041 and - [ ] completion of FCP in https://github.com/rust-lang/rust/issues/34511#issuecomment-373207183 (3 days from now). I have not yet done any docs work for this-- I probably won't get to it until this weekend (might be a project for the flight to the all-hands).
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-74/+35
2018-03-26Stabilize universal_impl_traitTaylor Cramer-41/+8
2018-03-25Modify testsAlexander Ronald Altman-1/+1
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-69/+8
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25Rollup merge of #49268 - ordovicia:dotdot-pattern-diag, r=petrochenkovkennytm-0/+37
Better diagnostics for '..' pattern fragment not in the last position Fixes #49257.
2018-03-25Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertjkennytm-48/+20
Make resuming generators unsafe instead of the creation of immovable generators cc @withoutboats Fixes #47787
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-0/+24
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-15/+64
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-24Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertjbors-0/+399
support elision in impl headers You can now do things like: ``` impl MyTrait<'_> for &u32 { ... } ``` Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138). We do not support elision with deprecated forms: ``` impl MyTrait for std::cell::Ref<u32> { } // ERROR ``` Builds on the in-band lifetime stuff. r? @cramertj Fixes #15872
2018-03-24Auto merge of #48552 - kennytm:lower-unstable-priority, r=nikomatsakisbors-9/+157
Lower the priority of unstable methods when picking a candidate. Previously, when searching for the impl of a method, we do not consider the stability of the impl. This leads to lots of insta-inference-regressions due to method ambiguity when a popular name is chosen. This has happened multiple times in Rust's history e.g. * `f64::from_bits` #40470 * `Ord::{min, max}` #42496 * `Ord::clamp` #44095 (eventually got reverted due to these breakages) * `Iterator::flatten` #48115 (recently added) This PR changes the probing order so that unstable items are considered last. If a stable item is found, the unstable items will not be considered (but a future-incompatible warning will still be emitted), thus allowing stable code continue to function without using qualified names. Once the unstable feature is stabilized, the ambiguity error will still be emitted, but the user can also use newly stable std methods, while the current situation is that downstream user is forced to update the code without any immediate benefit. (I hope that we could bring back `Ord::clamp` if this PR is merged.)
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+30
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-24Fix test for PR #49268Hidehito Yabuuchi-11/+4
2018-03-24Filed a proper tracking issue.kennytm-1/+1
2018-03-24Specialize future-incompatibility warning for UNSTABLE_NAME_COLLISION.kennytm-4/+4
2018-03-24When picking a candidate, consider the unstable ones last.kennytm-0/+154
If there is potential ambiguity after stabilizing those candidates, a warning will be emitted.
2018-03-24Provide a proper span when demanding for the return type of `box x`.kennytm-9/+3