about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-04-28Update *.stderr filesflip1995-1/+101
2019-04-28Add testsflip1995-0/+99
2019-04-26Make "Implementations on Foreign Types" items in sidebar link to specific implsDmitry Murzin-0/+16
2019-04-26Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasperbors-0/+4
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
2019-04-26Rollup merge of #60289 - tmandry:allow-features-include-std, r=cramertjMazdak Farrokhzad-2/+18
Make `-Z allow-features` work for stdlib features r? @cramertj
2019-04-26Rollup merge of #60284 - varkor:const-param-of-type-param, r=cramertjMazdak Farrokhzad-0/+62
Do not allow const generics to depend on type parameters Fixes https://github.com/rust-lang/rust/issues/60264. In https://github.com/rust-lang/rust/pull/58191/files/b534cf992d0189032207f395c27ed092c89b40c7#diff-aeb0880081a991f34aef2ab889e1fb7a, it was suggested that there might be a better place for this error, but as this bug already affects stable, it's probably worth merging this now, and refactoring afterwards (I can open an issue for this).
2019-04-26Rollup merge of #60267 - gnzlbg:f16c_target_feature, r=alexcrichtonMazdak Farrokhzad-1/+2
Add feature-gate for f16c target feature r? @alexcrichton
2019-04-26Rollup merge of #60183 - tmandry:chalk-builtin-copy-clone, r=scalexmMazdak Farrokhzad-0/+43
Chalkify: Add builtin Copy/Clone r? @nikomatsakis
2019-04-26Rollup merge of #60134 - GuillaumeGomez:fix-index-page, r=ManishearthMazdak Farrokhzad-0/+3
Fix index-page generation Fixes #60096. The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons. r? @rust-lang/rustdoc
2019-04-26Rollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27Mazdak Farrokhzad-0/+25
Set cfg(test) when rustdoc is running with --test option Following a [discussion on twitter](https://twitter.com/burntsushi5/status/1117091914199785473), I proposed this change. What do you think about it? r? @QuietMisdreavus cc @BurntSushi
2019-04-25Add comment explaining restrictionvarkor-4/+10
2019-04-25Make `-Z allow-features` work for stdlib featuresTyler Mandry-2/+18
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+4
2019-04-25Auto merge of #59111 - gilescope:generator-better-errors, r=nikomatsakisbors-0/+30
Improved error message when type must be bound due to generator. Fixes #58930. Keen to get some feedback - is this as minimal as we can get it or is there an existing visitor I could repurpose?
2019-04-25Add a test for const parameters with type parameters as typesvarkor-0/+31
2019-04-25Make sure const params with type params don't cause errors without a feature ↵varkor-0/+25
gate
2019-04-25Improved error message when type must be bound due to generator.Giles Cope-0/+30
Error now mentions type var name and span is highlighted.
2019-04-25Add feature-gate for f16c target featuregnzlbg-1/+2
2019-04-25Auto merge of #60248 - estebank:macro-comma, r=oli-obkbors-7/+23
Add guard for missing comma in macro call suggestion Fix #60233. Follow up to #58796. r? @oli-obk
2019-04-25Rollup merge of #60243 - davidtwco:issue-53249, r=cramertjMazdak Farrokhzad-0/+47
Add regression test for #53249. Fixes #53249. r? @cramertj
2019-04-25Rollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, ↵Mazdak Farrokhzad-18/+9
r=estebank Fix #58270, fix off-by-one error in error diagnostics. This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.
2019-04-25Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichtonMazdak Farrokhzad-41/+48
Add codegen test for PGO instrumentation. This PR adds a codegen test that makes sure that LLVM actually generates instrumentation code when we enable PGO instrumentation in `rustc`. The second commit updates a test case to the new commandline option syntax introduced in #59874. Without the fix the test still works, but it confusingly creates a directory called `test.profraw`, which usually is the name of the _file_ where profiling data is collected.
2019-04-25Rollup merge of #59697 - euclio:label-fixes, r=zackmdavisMazdak Farrokhzad-7/+19
tweak unresolved label suggestion Only suggest label names in the same hygiene context, and use a structured suggestion. Question for reviewer: Is this the right way to check for label hygiene?
2019-04-24Add guard for missing comma in macro call suggestionEsteban Küber-7/+23
2019-04-24chalkify: Add Copy/Clone builtinsTyler Mandry-0/+43
2019-04-24Remove useless code and update index page testGuillaume Gomez-0/+3
2019-04-24Add test for rustdoc cfg(test) featureGuillaume Gomez-0/+25
2019-04-24Add regression test for #53249.David Wood-0/+47
2019-04-24Evaluate hair::ExprKind::Use in intoMatthew Jasper-18/+17
This avoids some unnecessary moves
2019-04-24Allow subtyping of the final expression of a constantMatthew Jasper-0/+8
Fixes an ICE for the following code: fn foo(_ : &()) {} static X: fn(&'static ()) = foo;
2019-04-24Fix ignore-logic for sanitizer run-make tests.Michael Woerister-9/+6
2019-04-24Rollup merge of #59739 - cramertj:stabilize, r=withoutboatsMazdak Farrokhzad-33/+87
Stabilize futures_api cc https://github.com/rust-lang/rust/issues/59725. Based on https://github.com/rust-lang/rust/pull/59733 and https://github.com/rust-lang/rust/pull/59119 -- only the last two commits here are relevant. r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.
2019-04-24Rollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakisMazdak Farrokhzad-27/+27
Future-proof MIR for dedicated debuginfo. This is #56231 without the last commit (the one that actually moves to `VarDebuginfo`). Nothing should be broken, but it should no longer depend on debuginfo for anything else. r? @nikomatsakis
2019-04-24Auto merge of #58623 - Amanieu:hashbrown3, r=alexcrichtonbors-3/+3
Replace HashMap implementation with SwissTable (as an external crate) This is the same as #56241 except that it imports `hashbrown` as an external crate instead of copying the implementation into libstd. This includes a few API changes (all unstable): - `try_reserve` is added to `HashSet`. - Some trait bounds have been changed in the `raw_entry` API. - `search_bucket` has been removed from the `raw_entry` API (doesn't work with SwissTable).
2019-04-23Stabilize futures_apiTaylor Cramer-34/+26
2019-04-23Add rustc_allow_const_fn_ptrTaylor Cramer-0/+62
2019-04-24Fix testAmanieu d'Antras-3/+3
2019-04-23rustc_mir: create the `let` and "remainder" scopes in source order.Eduard-Mihai Burtescu-8/+8
2019-04-23rustc_mir: pretty-print all locals into their respective scopes.Eduard-Mihai Burtescu-22/+22
2019-04-23Rollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytmMazdak Farrokhzad-225/+107
Warn when ignore-tidy-linelength is present, but no lines are too long It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.
2019-04-23Rollup merge of #59839 - KodrAus:must-use-num, r=sfacklerMazdak Farrokhzad-1/+1
Warn on unused results for operation methods on nums From a suggestion by @llogiq Adds a `#[must_use]` attribute to operation methods on integers that take self by value as the first operand and another value as the second. It makes it clear that these methods return the result of the operation instead of mutating `self`, which is the source of a rather embarrassing bug I had in a codebase of mine recently... As an example: ```rust struct Int { value: i64, } impl Int { fn add(&mut self, other: i64) { self.value.wrapping_add(other); } } ``` Will produce a warning like: ``` warning: unused return value of `core::num::<impl i64>::wrapping_add` that must be used --> src/main.rs:7:7 | 7 | self.value.wrapping_add(other); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_must_use)] on by default = note: this returns the result of the operation, without modifying the original ``` If this is something we're on board with, we could do something similar for `f32` and `f64` too. There are probably other methods on integers that make sense.
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-2/+186
[wg-async-await] Drop `async fn` arguments in async block Fixes #54716. This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body. ``` async fn foo(<pattern>: <type>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern>: <ty> = __arg0; } // <-- dropped as you "exit" the async block } ``` However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this. r? @cramertj cc @nikomatsakis
2019-04-23Reduce noise and document test case.David Wood-91/+83
This commit introduces a `assert_drop_order_after_poll` helper function to the test case for this case to reduce repetitive noise and documents what each function aims to test.
2019-04-23Auto merge of #60155 - davidtwco:issue-59819, r=oli-obkbors-0/+109
Suggest dereferencing when `Deref` is implemented. Fixes #59819. r? @oli-obk cc @estebank
2019-04-23Fix regression in line ending testvarkor-2/+2
2019-04-23Remove unnecessary tidy ignore directivesvarkor-12/+7
2019-04-23Update ui testsvarkor-98/+98
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-113/+0
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-104/+416
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-23Auto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytmbors-211/+4
Disallow double trailing newlines in tidy This wasn't done previously in https://github.com/rust-lang/rust/pull/47064#issuecomment-354533010 as it affected too many files, but I think it's best to fix it now so that the number of files with double trailing newlines doesn't keep increasing. r? kennytm