about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-10-06Rollup merge of #89591 - infinity0:master, r=AmanieuManish Goregaokar-0/+1
fix: alloc-optimisation is only for rust llvm As discussed at the bottom of #83485. On a separate note I'll take this chance ask, is it worth pulling in that patch (to recognise `__rust_dealloc`) into Debian's system LLVM? The main factors for us to consider would be (1) is the optimisation significant and (2) is there not any significant negative impact to non-rust packages that use LLVM.
2021-10-06Rollup merge of #89588 - BoxyUwU:add_a_test_uwu, r=lcnrManish Goregaokar-0/+29
Add a test for generic_const_exprs Test that const_eval_resolve evaluates consts with unused inference vars in substs r? ``@lcnr``
2021-10-06Rollup merge of #89528 - FabianWolff:issue-89497, r=jackh726Manish Goregaokar-6/+44
Fix suggestion to borrow when casting from pointer to reference Fixes #89497.
2021-10-06Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomezManish Goregaokar-8/+37
librustdoc: Use correct heading levels. Closes #89309 This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy. - I ran a script to manually check that we don't have any files with multiple `<h1>` tags. - Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`. - I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
2021-10-06Rollup merge of #89501 - Aaron1011:escaping-name-regions, r=davidtwcoManish Goregaokar-39/+188
Note specific regions involved in 'borrowed data escapes' error Fixes #67007 Currently, a 'borrowed data escapes' error does not mention the specific lifetime involved (except indirectly through a suggestion about adding a lifetime bound). We now explain the specific lifetime relationship that failed to hold, which improves otherwise vague error messages.
2021-10-06Rollup merge of #89329 - tmiasko:print-type-sizes-no-fields, r=jackh726Manish Goregaokar-1/+2
print-type-sizes: skip field printing for primitives Fixes #86528.
2021-10-06Simplify AttributesExt::cfg function and remove error emissions since they ↵Guillaume Gomez-0/+35
are not useful
2021-10-06Bless testsCameron Steffen-0/+11
2021-10-06opt-level >= 4Alexander-1/+1
2021-10-06Do not re-hash foreign spans.Camille GILLOT-0/+11
2021-10-06run remaining testsAlexander-9/+17
2021-10-06tidyAlexander-1/+1
2021-10-06add MIR artifactsAlexander-3/+626
2021-10-06reset and cleanupAlexander-0/+50
2021-10-06fix: alloc-optimisation is only for rust llvmXimin Luo-0/+1
2021-10-06Auto merge of #89323 - estebank:derive-binop, r=petrochenkovbors-39/+458
Consider unfulfilled obligations in binop errors When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Fix #84515.
2021-10-06testEllen-0/+29
2021-10-06Add regression test for ice 89574Gary Guo-10/+41
2021-10-05Consider unfulfilled obligations in binop errorsEsteban Kuber-39/+458
When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Point at trait(s) that needs to be `impl`emented.
2021-10-05Issue 89275 fix and testTom Farmer-0/+43
Issue 89275 fix and test Fix librustdoc OverflowError usage rust tidy run Issue 89275 fix and test
2021-10-05Rollup merge of #89532 - ecstatic-morse:maybe-live-locals-enum, ↵Manish Goregaokar-0/+32
r=oli-obk,tmiasko Document behavior of `MaybeLiveLocals` regarding enums and field-senstivity This arose from a [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/MaybeLiveLocals.20and.20Discriminants) where a new contributor attempted to implement a dead-store elimination pass using this analysis. They ran into a nasty hack around `SetDiscriminant` the effect of which is to lets handle assignments of literals to enum-typed locals (e.g. `x = Some(4)`) correctly. This took me a while to figure out. Document this oddity, so the next person will have an easier time, and add a test to enshrine the current behavior. r? ``@tmiasko``
2021-10-05Rollup merge of #89523 - Aaron1011:derive-future-compat, r=wesleywiserManish Goregaokar-0/+72
Make `proc_macro_derive_resolution_fallback` a future-breakage lint When `cargo report future-incompatibilities` is stabilized (see #71249), this will cause dependencies that trigger this lint to be included in the report.
2021-10-05Rollup merge of #89442 - GuillaumeGomez:duplicated-doc-alias, r=estebankManish Goregaokar-0/+33
Add check for duplicated doc aliases r? ``@estebank``
2021-10-05Rollup merge of #89317 - JulianKnodt:precise_errors, r=BoxyUwUManish Goregaokar-9/+17
Move generic error message to separate branches This decomposes an error message in generic constants into more specific branches, for better readability. r? ``@lcnr``
2021-10-05Rollup merge of #88871 - FabianWolff:issue-88403, r=jackh726Manish Goregaokar-0/+60
Fix suggestion for nested struct patterns Fixes #88403, and also a similar problem where the unused binding is in a function parameter pattern.
2021-10-05Rollup merge of #88706 - ThePuzzlemaker:issue-88609, r=jackh726Manish Goregaokar-0/+19
Normalize associated type projections when checking return type of main This fixes #88609. Previously, the return type of `fn main()` would not have any associated type projections within normalized before checking if it implements the standard library trait `std::process::Termination`. This commit appears to fix it. This feels vaguely symptomatic of a problem in the underlying trait solving engine, but I am not sure how I would solve that. I am unsure why the example in #88609 with `assert_impl_termination` and `fn foo()` work, but simply `fn main()` doesn't. The way that I solved this is also probably not the best way to do this, so please let me know if there is a better way to do this. I have added a build-pass regression test for this issue.
2021-10-05Note specific regions involved in 'borrowed data escapes' errorAaron Hill-39/+188
Fixes #67007 Currently, a 'borrowed data escapes' error does not mention the specific lifetime involved (except indirectly through a suggestion about adding a lifetime bound). We now explain the specific lifetime relationship that failed to hold, which improves otherwise vague error messages.
2021-10-05Add test case for `doc_cfg_hide` feature gateJoshua Nelson-0/+21
2021-10-05Allow adding a set of cfg's to hide from being implicitly doc(cfg)'dWim Looman-0/+32
By adding #![doc(cfg_hide(foobar))] to the crate attributes the cfg #[cfg(foobar)] (and _only_ that _exact_ cfg) will not be implicitly treated as a doc(cfg) to render a message in the documentation.
2021-10-05Make cfg implicitly imply doc(cfg)Wim Looman-0/+38
This is only active when the `doc_cfg` feature is active. The implicit cfg can be overridden via #[doc(cfg(...))], so e.g. to hide a #[cfg] you can use something like: ```rust #[cfg(unix)] #[doc(cfg(all()))] pub struct Unix; ``` (since `all()` is always true, it is never shown in the docs)
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-5/+5
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-04Rollup merge of #89504 - Aaron1011:rpit-nll-static, r=nikomatsakisManish Goregaokar-211/+24
Don't suggest replacing region with 'static in NLL Fixes #73159 This is similar to #69350 - if the user didn't initially write out a 'static lifetime, adding 'static in response to a lifetime error is usually the wrong thing to do.
2021-10-04Rollup merge of #89482 - hkmatsumoto:patch-diagnostics, r=joshtriplettManish Goregaokar-12/+12
Follow the diagnostic output style guide Detected by #89455.
2021-10-04Rollup merge of #89423 - DevinR528:reachable-fields, r=NadrierilManish Goregaokar-3/+15
Fix ICE caused by non_exaustive_omitted_patterns struct lint fixes #89382 Add check that a list of `Pat`s is non empty to prevent ICE in `FnCtxt::lint_non_exhaustive_omitted_patterns`. Is related to #89374 and #89105
2021-10-04Rollup merge of #88816 - dns2utf8:rustdoc_test_gui_2k_constants, ↵Manish Goregaokar-0/+26
r=GuillaumeGomez Rustdoc migrate to table so the gui can handle >2k constants Closes #88545. This PR adds a test for overlapping entries in the `item-table` https://github.com/rust-lang/rust/issues/88545 It currently includes the commit with the workaround from https://github.com/rust-lang/rust/pull/88776
2021-10-04Rollup merge of #88234 - hkmatsumoto:rustdoc-impls-for-primitive, r=jyn514Manish Goregaokar-0/+14
rustdoc-json: Don't ignore impls for primitive types Fix the issue discussed at [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Json.20output.20lacks.20some.20item.20which.20are.20supposed.20to.20be.20there) r? ``@jyn514``
2021-10-04Rollup merge of #89494 - FabianWolff:issue-84075, r=davidtwcoJubilee-34/+99
Deny `where` clauses on `auto` traits Fixes #84075.
2021-10-04Rollup merge of #89487 - FabianWolff:issue-89396, r=petrochenkovJubilee-0/+52
Try to recover from a `=>` -> `=` or `->` typo in a match arm Fixes #89396.
2021-10-04Rollup merge of #89480 - hameerabbasi:issue-89118-test, r=jackh726Jubilee-0/+95
Add test for issue 89118. This PR adds a test for issue 89118. Closes #89118.
2021-10-04Rollup merge of #89478 - zvavybir:master, r=jyn514Jubilee-3/+3
Fixed numerus of error message When there are redundant trait requirements and these are hidden, a message is generated by the following code snippet: `format!("{} redundant requirements hidden", count)` But if there is only a single hidden requirement, it will still print this message in plural instead of singular.
2021-10-04Rollup merge of #89473 - FabianWolff:issue-89469, r=joshtriplettJubilee-0/+20
Fix extra `non_snake_case` warning for shorthand field bindings Fixes #89469. The problem is the innermost `if` condition here: https://github.com/rust-lang/rust/blob/d14731cb3ced8318d7fc83cbe838f0e7f2fb3b40/compiler/rustc_lint/src/nonstandard_style.rs#L435-L452 This code runs for every `PatKind::Binding`, so if a struct has multiple fields, say A and B, and both are bound in a pattern using shorthands, the call to `self.check_snake_case()` will indeed be skipped in the `check_pat()` call for `A`; but when `check_pat()` is called for `B`, the loop will still iterate over `A`, and `field.ident (= A) != ident (= B)` will be true. I have fixed this by only looking at non-shorthand bindings, and only the binding that `check_pat()` was actually called for.
2021-10-04Rollup merge of #89413 - matthewjasper:spec-marker-fix, r=nikomatsakisJubilee-0/+42
Correctly handle supertraits for min_specialization Supertraits of specialization markers could circumvent checks for min_specialization. Elaborating predicates prevents this. r? ````@nikomatsakis````
2021-10-04Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakisJubilee-12/+66
Perform type inference in range pattern Fix #88074
2021-10-04Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplettJubilee-17/+0
Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](https://github.com/rust-lang/rust/issues/48043#issuecomment-898040475).
2021-10-04Add tests for ensuring docblock headings.Mukund Lakshman-0/+29
2021-10-04Fix rustdoc test caseMichael Howell-12/+6
2021-10-04Re-bless src/test/ui/simdJubilee Young-84/+84
2021-10-04Rearrange test/ui/{simd,simd-intrinsic}Jubilee Young-0/+0
Mostly test/ui/simd-intrinsic -> test/ui/simd/intrinsic Intrinsics-per-se tests moved into that folder Repetitive names were cut short. Duplicate names given -pass annotations.
2021-10-04Use arrays over tuples in SIMD testsJubilee Young-222/+69
Simd([u8; 64]) is now valid for repr(simd), so simplify tests with huge tuples instead. This also found some completely untested code, so let's just ditch that.
2021-10-04Ensure that `MaybeLiveLocals` works with simple sum-type assignmentsDylan MacKenzie-0/+32