about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-07-16add regression test for #70217Bastian Kauschke-0/+16
2020-07-16add regression test for #68596Bastian Kauschke-0/+18
2020-07-16add regression tests for #67144Bastian Kauschke-0/+50
2020-07-16bless ui testsBastian Kauschke-2/+7
2020-07-16update help messageBastian Kauschke-7/+7
2020-07-16don't supply generics to AnonConsts in param listsBastian Kauschke-32/+12
2020-07-16add self dependent const param testBastian Kauschke-1/+24
2020-07-16forbid generic params in the type of const paramsBastian Kauschke-25/+94
2020-07-16Rollup merge of #74037 - JohnTitor:contributing-md, r=Mark-SimulacrumManish Goregaokar-1/+1
Update reference to CONTRIBUTING.md CONTRIBUTING.md has been migrated to the rustc-dev-guide but some still refer there. Update them with the appropriate links. Fixes #74253
2020-07-15Constify most non-trait `Duration` methods as described in #72440marmeladema-0/+57
2020-07-15Rollup merge of #74337 - estebank:ty-parse-recovery, r=varkorManish Goregaokar-51/+10
Handle case of incomplete local ty more gracefully When encountering a local binding with a type that isn't completed, the parser will reach a `=` token. When this happen, consider the type "complete" as far as the parser is concerned to avoid further errors being emitted by parse recovery logic.
2020-07-15Rollup merge of #74276 - lcnr:discriminant-kind-what, r=nagisaManish Goregaokar-2/+2
improve DiscriminantKind handling Adds a lang item `discriminant_type` for the associated type `DiscriminantKind::Discriminant`. Changes the discriminant of generators from `i32` to `u32`, which should not be observable to fix an oversight where MIR was using `u32` and codegen and typeck used `i32`.
2020-07-15Don't panic if the lhs of a div by zero is not statically knownOliver Scherer-4/+21
2020-07-15Catch errors for any new item, not just trait implementationsJoshua Nelson-3/+9
This matches the previous behavior of everybody_loops and is also more consistent than special-casing impls.
2020-07-15Don't ICE on infinitely recursive typesJoshua Nelson-0/+21
`evaluate_obligation` can only be run on types that are already valid. So rustdoc still has to run typeck even though it doesn't care about the result.
2020-07-15--blessJoshua Nelson-6/+18
2020-07-15Don't crash on Vec<DoesNotExist>Joshua Nelson-0/+7
2020-07-15Add test case for #65863Joshua Nelson-0/+15
2020-07-15Recurse into function bodies, but don't typeck closuresJoshua Nelson-67/+126
Previously, rustdoc would issue a delay_span_bug ICE on the following code: ```rust pub fn a() -> impl Fn() -> u32 { || content::doesnt::matter() } ``` This wasn't picked up earlier because having `type Alias = impl Trait;` in the same module caused _all closures_ to be typechecked, even if they wouldn't normally. Additionally, if _any_ error was emitted, no delay_span_bug would be emitted. So as part of this commit all of the tests were separated out into different files.
2020-07-15Don't ICE on errors in function returning impl traitJoshua Nelson-0/+81
Instead, report the error. This emits the errors on-demand, without special-casing `impl Trait`, so it should catch all ICEs of this kind, including ones that haven't been found yet. Since the error is emitted during type-checking there is less info about the error; see comments in the code for details. - Add test case for -> impl Trait - Add test for impl trait with alias - Move EmitIgnoredResolutionErrors to rustdoc This makes `fn typeck_item_bodies` public, which is not desired behavior. That change should be removed once https://github.com/rust-lang/rust/pull/74070 is merged. - Don't visit nested closures twice
2020-07-15Add `rustdoc` tests from #72088Dylan MacKenzie-0/+16
2020-07-15Add an option not to report resolution errors for rustdocJoshua Nelson-3/+110
- Remove unnecessary `should_loop` variable - Report errors for trait implementations These should give resolution errors because they are visible outside the current scope. Without these errors, rustdoc will give ICEs: ``` thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9 15: rustc_hir::def::Res<Id>::def_id at /home/joshua/src/rust/src/librustc_hir/def.rs:382 16: rustdoc::clean::utils::register_res at src/librustdoc/clean/utils.rs:627 17: rustdoc::clean::utils::resolve_type at src/librustdoc/clean/utils.rs:587 ``` - Add much more extensive tests + fn -> impl -> fn + fn -> impl -> fn -> macro + errors in function parameters + errors in trait bounds + errors in the type implementing the trait + unknown bounds for the type + unknown types in function bodies + errors generated by macros - Use explicit state instead of trying to reconstruct it from random info - Use an enum instead of a boolean - Add example of ignored error
2020-07-15Don't run everybody_loops for rustdocJoshua Nelson-1/+3
Instead, ignore resolution errors that occur in item bodies. The reason this can't ignore item bodies altogether is because `const fn` could be used in generic types, for example `[T; f()]`
2020-07-15add lazy normalization regression testsBastian Kauschke-0/+36
2020-07-15improve namingBastian Kauschke-48/+48
2020-07-15cleanupBastian Kauschke-2/+2
2020-07-15update const arg queriesBastian Kauschke-25/+0
2020-07-15update testBastian Kauschke-12/+4
2020-07-15mir opt cross compileBastian Kauschke-12/+12
2020-07-15mir_built is a lieBastian Kauschke-152/+152
2020-07-15ui test diffBastian Kauschke-2/+22
2020-07-15mir opt diffBastian Kauschke-36/+36
2020-07-15continue mir pipelineBastian Kauschke-0/+15
2020-07-15add const generic testsBastian Kauschke-0/+333
2020-07-15Don't render unstable for rustc docsLzu Tao-4/+6
As rustc is permanently unstable. So marking every items with unstable is essential useless.
2020-07-15improve DiscriminantKind handlingBastian Kauschke-2/+2
This now reuses `fn discriminant_ty` in project, removing some code duplication. Doing so made me realize that we previously had a disagreement about the discriminant type of generators, with MIR using `u32` and codegen and trait selection using `i32`. We now always use `u32`.
2020-07-14Handle case of incomplete local ty more gracefullyEsteban Küber-51/+10
When encountering a local binding with a type that isn't completed, the parser will reach a `=` token. When this happen, consider the type "complete" as far as the parser is concerned to avoid further errors being emitted by parse recovery logic.
2020-07-15Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obkbors-1/+4
More static symbols These commits add some more static symbols and convert lots of places to use them. r? @oli-obk
2020-07-15Add and use more static symbols.Nicholas Nethercote-1/+4
Note that the output of `unpretty-debug.stdout` has changed. In that test the hash values are normalized from a symbol numbers to small numbers like "0#0" and "0#1". The increase in the number of static symbols must have caused the original numbers to contain more digits, resulting in different pretty-printing prior to normalization.
2020-07-14Rollup merge of #74340 - ↵Manish Goregaokar-0/+14
davidtwco:issue-73747-improper-ctypes-defns-is-zst-with-params, r=pnkfelix lint: use `transparent_newtype_field` to avoid ICE Fixes #73747. This PR re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE.
2020-07-14Rollup merge of #74336 - ↵Manish Goregaokar-0/+43
davidtwco:issue-73112-cross-crate-packed-type-diagnostic, r=estebank typeck: use `item_name` in cross-crate packed diag Fixes #73112. This PR replaces the use of `expect_local` and `hir().get` to fetch the identifier for a ADT with `item_name` - which works across crates.
2020-07-14Rollup merge of #74272 - davidtwco:issue-73626-multiline-mixed-comments, ↵Manish Goregaokar-0/+34
r=Mark-Simulacrum pprust: support multiline comments within lines Fixes #73626. This PR adds support to `rustc_ast_pretty` for multiline comments that start and end within a line of source code. Fun fact: [the commit which added this assert](https://github.com/rust-lang/rust/commit/d12ea3989649616437a7c1434f5c5a6438235eb7) was from 2011! https://github.com/rust-lang/rust/blob/d12ea3989649616437a7c1434f5c5a6438235eb7/src/comp/pretty/pprust.rs#L1146-L1150
2020-07-14Rollup merge of #74228 - estebank:unsized-param, r=davidtwcoManish Goregaokar-367/+448
Provide structured suggestion on unsized fields and fn params * Suggest borrowing or boxing unsized fields * Suggest borrowing fn parameters * Remove some verbosity of unsized errors * Remove `on_unimplemented` note from `trait Sized` Fix #23286, fix #28653. r? @davidtwco
2020-07-14Rollup merge of #74211 - estebank:struct-pat-as-unit, r=petrochenkovManish Goregaokar-117/+171
Structured suggestion when not using struct pattern r? @petrochenkov
2020-07-14Reword messageEsteban Küber-33/+33
2020-07-14Remove redundant explanatory `note` for type parametersEsteban Küber-97/+0
2020-07-14lint: use `transparent_newtype_field` to avoid ICEDavid Wood-0/+14
This commit re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE. Signed-off-by: David Wood <david@davidtw.co>
2020-07-14Suggest borrowing in more unsized fn param casesEsteban Küber-13/+45
2020-07-14Remove `Sized` `on_unimplemented` noteEsteban Küber-165/+2
2020-07-14Suggest boxing or borrowing unsized fieldsEsteban Küber-86/+383