about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-12-30Auto merge of #57185 - petrochenkov:impice4, r=estebankbors-26/+29
resolve: Fix one more ICE in import validation So if you have an unresolved import ```rust mod m { use foo::bar; } ``` error recovery will insert a special item with `Def::Err` definition into module `m`, so other things depending on `bar` won't produce extra errors. The issue was that erroneous `bar` was overwriting legitimate `bar`s coming from globs, e.g. ```rust mod m { use baz::*; // imports real existing `bar` use foo::bar; } ``` causing some unwanted diagnostics talking about "unresolved items", and producing inconsistent resolutions like https://github.com/rust-lang/rust/issues/57015. This PR stops overwriting real successful resolutions with `Def::Err`s. Fixes https://github.com/rust-lang/rust/issues/57015
2018-12-29Do not complain about missing crate named as a keywordEsteban Küber-0/+25
2018-12-29Auto merge of #56843 - csmoe:non-copy, r=davidtwcobors-48/+65
Add a note describing the type of the non-Copy moved variable Closes #56654 r?@davidtwco
2018-12-30Improve error recovery for some built-in macrosVadim Petrochenkov-25/+42
2018-12-29Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkovbors-315/+946
Implement RFC 2338, "Type alias enum variants" This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following. ```rust #![feature(type_alias_enum_variants)] enum Foo { Bar(i32), Baz { i: i32 }, } type Alias = Foo; fn main() { let t = Alias::Bar(0); let t = Alias::Baz { i: 0 }; match t { Alias::Bar(_i) => {} Alias::Baz { i: _i } => {} } } ``` Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern. Fixes issues #56199 and #56611. N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible. ```rust Option::<u8>::None; // OK Option::None::<u8>; // OK, but lint in near future (hard error next edition?) Alias::<u8>::None; // OK Alias::None::<u8>; // Error ``` I do not know if this will need an FCP, but let's start one if so.
2018-12-29Auto merge of #57197 - kennytm:rollup, r=kennytmbors-20/+20
Rollup of 7 pull requests Successful merges: - #57149 (Fix typo in pin documentation) - #57153 (Small: Fix span in char documentation) - #57159 (Update references to closed issue) - #57163 (Give the crate select chevron room to breathe.) - #57168 (Removed aligned ZST requirement from docs of read_/write_unaligned.) - #57174 (Update link to rustc guide) - #57177 (Fix warning when compiling rustc) Failed merges: r? @ghost
2018-12-29resolve: Simplify treatment of ambiguity errorsVadim Petrochenkov-23/+15
2018-12-29Auto merge of #57181 - petrochenkov:impice3, r=estebankbors-0/+12
resolve: Fix another ICE in import validation Imports are allowed to have ambiguous resolutions as long as all of them have same `Def`. As it turned out, it's possible for different `Module`s to have same `Def` when `extern crate` items are involved. Fixes https://github.com/rust-lang/rust/issues/56596
2018-12-29Rollup merge of #57159 - ids1024:closed-issue, r=Centrilkennytm-20/+20
Update references to closed issue Issue #28979 was closed with a link to #55467.
2018-12-29Auto merge of #57160 - petrochenkov:impice2, r=estebankbors-0/+33
resolve: Fix an ICE in import validation Fixes ICE reported in the comment https://github.com/rust-lang/rust/issues/56596#issuecomment-449866807
2018-12-29update tests line numbersMatthias Krüger-13/+13
2018-12-29Auto merge of #57140 - estebank:str-err, r=varkorbors-31/+49
Tweaks to format string diagnostics Add label spans and fix incorrect spans. Fix #55155, fix #55350.
2018-12-29Fixed stderr files for ui tests.Alexander Regueiro-12/+3
2018-12-29add non-copy note to stderrcsmoe-45/+62
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-0/+16
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus
2018-12-29resolve: Never override real bindings with `Def::Err`s from error recoveryVadim Petrochenkov-26/+29
2018-12-29resolve: Fix another ICE in import validationVadim Petrochenkov-0/+12
2018-12-28remove remaining copyright headersMatthias Krüger-158/+0
2018-12-28Add specific diagnostic for transmuting between equal associated typesvarkor-0/+20
2018-12-28Clarify wording of E0512varkor-113/+113
2018-12-28Suggest `.as_ref()` when appropriate for `Option` and `Result`Esteban Küber-47/+91
2018-12-28Update src/test/ui/consts/const-nonzero.rsOliver Scherer-1/+1
Co-Authored-By: Dylan-DPC <dylan.dpc@gmail.com>
2018-12-28Make the getter for NonZero types into a const fndylan_DPC-0/+9
2018-12-27Simplify foreign type rendering.John Heitmann-27/+27
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on std::iter::Iterator by 30%.
2018-12-28Auto merge of #57155 - petrochenkov:dcrate3, r=dtolnaybors-0/+113
Resolve `$crate`s for pretty-printing at more appropriate time Doing it in `BuildReducedGraphVisitor` wasn't a good idea, identifiers wasn't actually visited half of the time. As a result some `$crate`s weren't resolved and were therefore pretty-printed as `$crate` literally, which turns into two tokens during re-parsing of the pretty-printed text. Now we are visiting and resolving `$crate` identifiers in an item right before sending that item to a proc macro attribute or derive. Fixes https://github.com/rust-lang/rust/issues/57089
2018-12-28resolve: Fix an ICE in import validationVadim Petrochenkov-0/+33
2018-12-27Update references to closed issueIan Douglas Scott-20/+20
Issue #28979 was closed with a link to #55467.
2018-12-27Auto merge of #56999 - petrochenkov:macrecov2, r=estebankbors-219/+579
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
2018-12-28Resolve `$crate`s for pretty-printing at more appropriate timeVadim Petrochenkov-27/+12
2018-12-28Add test demonstrating disintegration of `$crate` into `$` and `crate`Vadim Petrochenkov-0/+128
2018-12-27Set a `def_id` in `ParamEnv` only with `-Z chalk`scalexm-2/+2
2018-12-27Add testsscalexm-0/+278
2018-12-27Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakisbors-0/+34
Call poly_project_and_unify_type on types that contain inference types Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes #56822
2018-12-27Fix rebase and more CI failuresVadim Petrochenkov-130/+136
2018-12-27Address review comments and CI failuresVadim Petrochenkov-29/+5
2018-12-27Make sure feature gate errors are recoverableVadim Petrochenkov-44/+30
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-11/+2
2018-12-27Do not abort compilation if expansion produces errorsVadim Petrochenkov-87/+488
Fix a number of uncovered deficiencies in diagnostics
2018-12-27panic when calling MaybeUninhabited::into_inner on uninhabited typeRalf Jung-7/+34
2018-12-27Auto merge of #57133 - SimonSapin:zero, r=oli-obkbors-2/+0
Remove the private generic NonZero<T> wrapper type Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly on relevant libcore types.
2018-12-27retrieve ty info from place_tycsmoe-5/+5
describe index with _
2018-12-26Add span label to unused string formatting argumentEsteban Küber-30/+40
Fix #55350.
2018-12-26Point at correct span for arguments in format stringsEsteban Küber-1/+9
When a format string has escaped whitespace characters format arguments were shifted by one per each escaped character. Account for these escaped characters when synthesizing the spans. Fix #55155.
2018-12-26Various changes to string format diagnosticsEsteban Küber-10/+240
- Point at opening mismatched formatting brace - Account for differences between raw and regular strings - Account for differences between the code snippet and `InternedString` - Add more tests
2018-12-26Changed resolution of enum variants to low priority.Alexander Regueiro-2/+2
2018-12-26Fixed ICE when type arguments are specified on `Self` type.Alexander Regueiro-28/+56
2018-12-26Fixed type inference for tuple struct variants.Alexander Regueiro-14/+5
2018-12-26Fixed handling of unit variants of aliased enums in type NS.Alexander Regueiro-159/+66
2018-12-26Added regression test for using generic parameters on modules.Alexander Regueiro-274/+301
2018-12-26Fixed several ICEs.Alexander Regueiro-0/+29