about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-02-07Improve the error messages for missing stability attributesvarkor-11/+26
This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).
2019-02-07Resolve incorrect diagnostic for using a non-const value in a constantvarkor-52/+34
2019-02-07Add a test forbidding the use of const parameters in inner itemsvarkor-0/+37
2019-02-07Make name resolution handle consts in GenericParamsFromOuterFunction properlyvarkor-78/+78
2019-02-07Parse negative literals in const generic argumentsvarkor-0/+4
2019-02-07Add warning for a parameter list with an attribute but no parametersvarkor-3/+9
2019-02-07Add test for generic parameter list solely containing an attributevarkor-0/+5
2019-02-07Adjust generic const param resolutionvarkor-28/+0
2019-02-07Adjust parser generic parameter errorsvarkor-26/+67
2019-02-07Fix ast_validation printing of const genericsvarkor-2/+2
2019-02-07Add test for const parameter before other generic parametersvarkor-0/+39
2019-02-07Add test for const parameter depending on type parametervarkor-0/+28
2019-02-07Add test forbidding const parameters in const fnvarkor-0/+36
2019-02-07Update testsvarkor-257/+182
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Add const generics feature gate testvarkor-0/+31
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Reweork incompatible match arms errorEsteban Küber-43/+45
- Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitely stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error.
2019-02-07Rollup merge of #58033 - euclio:rustdoc-tags, r=QuietMisdreavusGuillaume Gomez-7/+15
rustdoc: wrap stability tags in colored spans A cosmetic change to make the stability tags stand out a bit against the docs. Opening for discussion. Before: ![screen shot 2019-01-31 at 3 29 36 pm](https://user-images.githubusercontent.com/1372438/52083406-54730d80-256d-11e9-8e61-b8caff569434.png) ![screen shot 2019-01-31 at 3 31 32 pm](https://user-images.githubusercontent.com/1372438/52083408-54730d80-256d-11e9-97b7-43e808448f65.png) After: ![screen shot 2019-01-31 at 3 29 18 pm](https://user-images.githubusercontent.com/1372438/52083405-54730d80-256d-11e9-9983-19d9519b2ed8.png) ![screen shot 2019-01-31 at 3 29 46 pm](https://user-images.githubusercontent.com/1372438/52083407-54730d80-256d-11e9-8c32-11a1ad7d3f34.png) r? @QuietMisdreavus
2019-02-07Rollup merge of #58028 - GuillaumeGomez:fix-settings-image-link, ↵Guillaume Gomez-1/+1
r=QuietMisdreavus Fix image link in the settings menu Fixes #57892. r? @QuietMisdreavus
2019-02-07Rollup merge of #57954 - euclio:rustdoc-stability, r=QuietMisdreavusGuillaume Gomez-0/+12
rustdoc: remove blank unstable spans Rustdoc generates blank unstable spans for unstable struct fields: ![screen shot 2019-01-28 at 1 05 04 pm](https://user-images.githubusercontent.com/1372438/51856295-5e8ed500-22fd-11e9-8074-025eddb4ef65.png) This PR removes them: ![screen shot 2019-01-28 at 1 07 22 pm](https://user-images.githubusercontent.com/1372438/51856424-aada1500-22fd-11e9-86f0-34e2aa78b8b1.png) r? @QuietMisdreavus
2019-02-07Auto merge of #58010 - Zoxc:parallel-passes, r=michaelwoeristerbors-40/+59
Move privacy checking later in the pipeline and make some passes run in parallel r? @michaelwoerister
2019-02-07add doc comment and revert angle bracket changeEsteban Küber-2/+2
2019-02-07tweak wording based on in person feedbackEsteban Küber-8/+6
2019-02-07Update test output after rebaseEsteban Küber-3/+3
2019-02-07Add missing trailing newlineEsteban Küber-1/+1
2019-02-07Remove spurious complaint about missing expression for bare semicolonsEsteban Küber-8/+11
2019-02-07Deduplicate mismatched delimiter errorsEsteban Küber-52/+38
Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently.
2019-02-07Auto merge of #58254 - kennytm:rollup, r=kennytmbors-0/+30
Rollup of 23 pull requests Successful merges: - #58118 (Transition libtest to 2018 edition) - #58119 (libproc_macro => 2018) - #58123 (Avoid some bounds checks in binary_heap::{PeekMut,Hole}) - #58124 (libsyntax_pos => 2018) - #58133 (libsyntax_ext => 2018) - #58136 (Improve error message and docs for non-UTF-8 bytes in stdio on Windows) - #58156 (update submodule: rust-installer from 27dec6c to ccdc47b) - #58192 (Do not ICE in codegen when using a extern_type static) - #58193 (Move librustc to 2018) - #58210 (Make an assert debug-only in `find_constraint_paths_between_regions`.) - #58217 (librustc_tsan => 2018) - #58218 (librustc_msan => 2018) - #58219 (librustc_asan => 2018) - #58220 (libprofiler_builtins => 2018) - #58223 (librustc_lsan => 2018) - #58225 (librustc_fs_util => 2018) - #58228 (librustc_plugin => 2018) - #58236 (librustc_resolve => 2018) - #58237 (Fix broken grammar in iter::from_fn() docs) - #58239 (librustc_apfloat => 2018) - #58240 (librustc_errors => 2018) - #58241 (librustc_llvm => 2018) - #58242 (Document the one TyKind that isn't documented) Failed merges: - #58185 (Remove images' url to make it work even without internet connection) r? @ghost
2019-02-06Change RawWaker constructor to const fnMatthias Einwag-8/+2
2019-02-07Rollup merge of #58192 - dlrobertson:fix_57876, r=oli-obkkennytm-0/+30
Do not ICE in codegen when using a extern_type static The layout of a extern_type static is unsized, but may pass the Well-Formed check in typeck (See #55257). As a result, we cannot assume that a static is sized when generating the `Place` for an r-value. Fixes: #57876 r? @oli-obk
2019-02-07Auto merge of #57998 - niklasf:align-enum, r=nagisabors-18/+133
Allow #[repr(align(x))] on enums (#57996) Tracking issue: #57996 Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999. It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs). cc @bitshifter
2019-02-06fix saturating_sub() underflow for unsigned ints #58030Patrick McCarter-0/+4
2019-02-06Allow const assignment for int saturating_sub() for #58030Patrick McCarter-1/+15
2019-02-06Lower 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-06error output updated by ./x.py test --stage 1 src/test/ui --incremental --blessClint Frederickson-38/+38
2019-02-06display sugared return types for async functionsAndy Russell-7/+28
2019-02-06Auto merge of #56123 - oli-obk:import_miri_from_future, r=eddybbors-0/+126
Add a forever unstable opt-out of const qualification checks r? @eddyb cc @RalfJung @Centril basically a forever unstable way to screw with const things in horribly unsafe, unsound and incoherent ways. Note that this does *not* affect miri except by maybe violating assumptions that miri makes. But there's no change in how miri evaluates things.
2019-02-06Auto merge of #58061 - nnethercote:overhaul-syntax-Folder, r=petrochenkovbors-26/+30
Overhaul `syntax::fold::Folder`. This PR changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. This makes the code faster and more concise.
2019-02-05Move ArcWake in common test file.Matthias Einwag-110/+73
2019-02-06Auto merge of #58058 - QuietMisdreavus:use-attr, r=GuillaumeGomezbors-0/+8
rustdoc: don't try to get a DefId for a Def that doesn't have one Fixes https://github.com/rust-lang/rust/issues/58054 The compiler allows you to write a `use` statement for a built-in non-macro attribute, since `use proc_macro` can apply to both the `proc_macro` crate and the `#[proc_macro]` attribute. However, if you write a use statement for something that *doesn't* have this crossover, rustdoc will try to use it the same way as anything else... which resulted in an ICE because it tried to pull a DefId for something that didn't have one. This PR makes rustdoc skip those lookups when it encounters them, allowing it to properly process and render these imports.
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-26/+30
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2019-02-05extend box-maybe-uninit testRalf Jung-0/+3
2019-02-05Do not ICE in codegen given a extern_type staticDan Robertson-0/+30
The layout of a extern_type static is unsized, but may pass the Well-Formed check in typeck. As a result, we cannot assume that a static is sized when generating the `Place` for an r-value.
2019-02-05fix test caseRalf Jung-3/+3
2019-02-05[WIP] add better error message for partial moveClint Frederickson-1/+1
2019-02-05Allow const assignment for int saturating_add() calls for #58030Patrick McCarter-0/+13
2019-02-05allow shorthand syntax for deprecation reasonAndy Russell-4/+39
2019-02-06Rollup merge of #58138 - ishitatsuyuki:stability-delay, r=estebankkennytm-0/+13
Fix #58101
2019-02-05Add more testsOliver Scherer-0/+92
2019-02-05Fix span for closure return type when annotated.David Wood-0/+34
This commit adjusts the span used to label closure return types so that if the user specifies the return type, i.e. `|_| -> X {}` instead of `|_| {}`, we correctly highlight all of it and not just the last character.
2019-02-05Auto merge of #57973 - davidtwco:issue-52891, r=estebankbors-61/+301
Add suggestion for duplicated import. Fixes #52891. This PR adds a suggestion when a import is duplicated (ie. the same name is used twice trying to import the same thing) to remove the second import.