about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-10-09Rollup merge of #89641 - asquared31415:asm-feature-attr-regs, r=oli-obkMatthias Krüger-34/+84
make #[target_feature] work with `asm` register classes Fixes #89289
2021-10-09Rollup merge of #89634 - hawkw:eliza/enable-err-warn, r=oli-obkMatthias Krüger-0/+1
rustc_driver: Enable the `WARN` log level by default This commit changes the `tracing_subscriber` initialization in `rustc_driver` so that the `WARN` verbosity level is enabled by default when the `RUSTC_LOG` env variable is empty. If the `RUSTC_LOG` env variable is set, the filter string in the environment variable is honored, instead. Fixes #76824 Closes #89623 cc ``@eddyb,`` ``@oli-obk``
2021-10-08Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomezGuillaume Gomez-0/+22
Remove special-casing of never primitive in rustdoc-json-types Fixes https://github.com/rust-lang/rust/issues/89349 r? `@GuillaumeGomez`
2021-10-08Rollup merge of #89538 - notriddle:notriddle/arrow-highlight, r=GuillaumeGomezGuillaume Gomez-12/+6
Make rustdoc not highlight `->` and `=>` as operators It was marking them up as `<span class="op">=</span><span class="op">&gt;</span>`, which is bloaty and wrong (at least, I think `<=` and `=>` should probably be different colors, since they're so different and yet made from the same symbols). Before: ![image](https://user-images.githubusercontent.com/1593513/135939748-f49b0f9e-6a7d-4d65-935a-e31cdf688a81.png) After: ![image](https://user-images.githubusercontent.com/1593513/135940063-5ef1f6b1-7e03-4227-b46b-572b063aba05.png)
2021-10-08Rollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726Guillaume Gomez-4/+39
Don't normalize xform_ret_ty during method candidate assembly Fixes https://github.com/rust-lang/rust/issues/85671 Normalizing the return type of a method candidate together with the expected receiver type of the method can lead to valid method candidates being rejected during probing. Specifically in the example of the fixed issue we have a `self_ty` of the form `&A<&[Coef]>` whereas the `impl_ty` of the method would be `&A<_>`, if we normalize the projection in the return type we unify the inference variable with `Cont`, which will lead us to reject the candidate in the sup type check in `consider_probe`. Since we don't actually need the normalized return type during candidate assembly, we postpone the normalization until we consider candidates in `consider_probe`.
2021-10-08bless warningsEliza Weisman-0/+1
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-08Remove special-casing of never primitive in rustdoc-json-typesLoïc BRANSTETT-0/+22
2021-10-08Auto merge of #89576 - tom7980:issue-89275-fix, r=estebankbors-0/+43
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions Closes #89275 This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait. Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-0/+41
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-08testsb-naber-4/+39
2021-10-07Rollup merge of #89622 - m-ou-se:debug-assert-2021, r=estebankJubilee-0/+125
Use correct edition for panic in [debug_]assert!(). See https://github.com/rust-lang/rust/issues/88638#issuecomment-915472783
2021-10-07Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkovJubilee-0/+11
Correct decoding of foreign expansions during incr. comp. Fixes https://github.com/rust-lang/rust/issues/74946 The original issue was due to a wrong assertion in `expn_hash_to_expn_id`. The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
2021-10-07Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoeristerJubilee-6/+141
Implement `#[link_ordinal(n)]` Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL. Part of #58713.
2021-10-07make #[target_feature] work with `asm` register classesasquared31415-34/+84
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+15
2021-10-07Auto merge of #89629 - GuillaumeGomez:rollup-s4r8me6, r=GuillaumeGomezbors-10/+259
Rollup of 7 pull requests Successful merges: - #89298 (Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers ) - #89461 (Add `deref_into_dyn_supertrait` lint.) - #89477 (Move items related to computing diffs to a separate file) - #89559 (RustWrapper: adapt for LLVM API change) - #89585 (Emit item no type error even if type inference fails) - #89596 (Make cfg imply doc(cfg)) - #89615 (Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-07Rollup merge of #89596 - GuillaumeGomez:implicit-doc-cfg, r=jyn514Guillaume Gomez-0/+126
Make cfg imply doc(cfg) This is a reopening of #79341, rebased and modified a bit (we made a lot of refactoring in rustdoc's types so they needed to be reflected in this PR as well): * `hidden_cfg` is now in the `Cache` instead of `DocContext` because `cfg` information isn't stored anymore on `clean::Attributes` type but instead computed on-demand, so we need this information in later parts of rustdoc. * I removed the `bool_to_options` feature (which makes the code a bit simpler to read for `SingleExt` trait implementation. * I updated the version for the feature. There is only one thing I couldn't figure out: [this comment](https://github.com/rust-lang/rust/pull/79341#discussion_r561855624) > I think I'll likely scrap the whole `SingleExt` extension trait as the diagnostics for 0 and >1 items should be different. How/why should they differ? EDIT: this part has been solved, the current code was fine, just needed a little simplification. cc `@Nemo157` r? `@jyn514` Original PR description: 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; ``` 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-07Rollup merge of #89585 - nbdd0121:issue-89574, r=estebankGuillaume Gomez-10/+41
Emit item no type error even if type inference fails Fix #89574 The stashed error should be emitted regardless whether ty references error or not.
2021-10-07Rollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakisGuillaume Gomez-0/+41
Add `deref_into_dyn_supertrait` lint. Initial implementation of #89460. Resolves #89190. Maybe also worth a beta backport if necessary. r? `@nikomatsakis`
2021-10-07Rollup merge of #89298 - gcohara:issue89193, r=workingjubileeGuillaume Gomez-0/+51
Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers closes #89193 r? `@workingjubilee`
2021-10-07Auto merge of #89534 - camsteffen:diag-name, r=oli-obkbors-0/+11
Introduce `tcx.get_diagnostic_name` Introduces a "reverse lookup" for diagnostic items. This is mainly intended for `@rust-lang/clippy` which often does a long series of `is_diagnostic_item` calls for the same `DefId`. r? `@oli-obk`
2021-10-07Add tests for panic and [debug_]assert in Rust 2021.Mara Bos-0/+125
2021-10-07Auto merge of #86525 - shamatar:array_len_opt, r=oli-obkbors-9/+690
Array `.len()` MIR optimization pass This pass kind-of works back the `[T; N].len()` call that at the moment is first coerced as `&[T; N]` -> `&[T]` and then uses `&[T].len()`. Depends on #86383
2021-10-07Remove untracked vtable-const-allocation cache from tcxMichael Woerister-0/+27
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.