about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-01-12Remove codegen tests for LLLVM-style inline assemblyTomasz Miąsko-14/+0
2022-01-12Remove mir-opt tests for LLVM-style inline assemblyTomasz Miąsko-210/+0
2022-01-12Remove ui tests for LLVM-style inline assemblyTomasz Miąsko-1500/+74
2022-01-12Add new tests, fix up old testsMichael Goulet-0/+44
2022-01-12Rollup merge of #92764 - GuillaumeGomez:fix-rust-logo-style, r=jshaMatthias Krüger-0/+78
Fix rust logo style The style on the rust logo is currently broken: ![Screenshot from 2022-01-11 13-36-30](https://user-images.githubusercontent.com/3050060/148946754-a1a57253-bed0-44cf-a41c-83e0eecbd6b5.png) With this fix, we're back to normal: ![Screenshot from 2022-01-11 13-42-07](https://user-images.githubusercontent.com/3050060/148946778-99f44678-aac1-419f-bb8c-ffa837e0c1ee.png) I also used a GUI test to prevent future silent regressions. r? ```@jsha```
2022-01-12Rollup merge of #92699 - camelid:private-fields, r=jshaMatthias Krüger-6/+6
rustdoc: Display "private fields" instead of "fields omitted" Also: * Always use `/* */` block comments * Use the same message everywhere, rather than sometimes prefixing with "some" When I first read rustdoc docs, I was confused why the fields were being omitted. It was only later that I realized it was because they were private. It's also always bothered me that rustdoc sometimes uses `//` and sometimes uses `/*` comments for these messages, so this change makes them all use `/*`. Technically, I think fields can be omitted if they are public but `doc(hidden)` too, but `doc(hidden)` is analogous to privacy. It's really just used to emulate "doc privacy" when -- because of technical limitations -- an item has to be public. So I think it's fine to include this under the category of "private fields". r? ```@jsha```
2022-01-12Rollup merge of #92432 - fee1-dead:constck-impl-constness, r=oli-obkMatthias Krüger-0/+26
Error when selected impl is not const in constck Catches bad things when checking a `default_method_body_is_const` body, such as: ```rust self.map(/* .. */).is_sorted(); ``` When `Map` does not yet have a `const` `impl` for `Iterator`. r? ```@oli-obk```
2022-01-11Deduplicate box deref and regular deref suggestionsMichael Goulet-18/+30
2022-01-11Deduplicate lines in long const-eval stack traceMichael Goulet-0/+42
2022-01-11rustdoc: do not emit tuple variant fields if none are documentedAndy Russell-2/+17
2022-01-11rustc_pass_by_value: handle inferred generic types (with _)Mahdi Dibaiee-6/+20
2022-01-11Annotate dead code lint with notes about ignored derived implsFabian Wolff-0/+28
2022-01-11rustc_pass_by_value: handle generic and const type parametersMahdi Dibaiee-2/+55
2022-01-11Auto merge of #90948 - oli-obk:🧹, r=nikomatsakisbors-1/+25
Actually instantiate the opaque type when checking bounds Before this change, `instantiate_opaque_types` was a no-op, because it only works relative to the defined opaque type inference anchor. If it is a no-op, the for loop will not actually have anything to iterate over, and thus nothing is checked at all.
2022-01-11Add testDeadbeef-0/+26
2022-01-11Add GUI test for rust logo style in the sidebarsGuillaume Gomez-0/+78
2022-01-11rustc_pass_by_value: allow types with no parameters on selfMahdi Dibaiee-1/+14
includes minor refactorings
2022-01-10Use Res instead of Disambiguator for `resolved` in `report_mismatch`Noah Lev-2/+2
This allows simplifying a lot of code. It also fixes a subtle bug, exemplified by the test output changes.
2022-01-10Add test for disambiguator mismatch with crateNoah Lev-1/+17
This currently calls `std` a "crate" in one part of the message and a "module" in another part. The next commits fix this so it says "crate" in both places.
2022-01-10Enable ignored part of testNoah Lev-4/+5
Inherent associated types *are* supported, just unstable.
2022-01-10Move two intra-doc-link tests into the `intra-doc` folderNoah Lev-1/+1
2022-01-11Add a test for ungated `#[rustc_must_implement_one_of]`Maybe Waffle-0/+24
This test checks that `#[rustc_must_implement_one_of]` is gated behind `#![feature(rustc_attrs)]`.
2022-01-10rustc_pass_by_value remove dependency on rustc_diagnostic_itemMahdi Dibaiee-11/+6
2022-01-10rustc_pass_by_value lint: add test on custom typesMahdi Dibaiee-14/+78
2022-01-10Ignore `unused_mod.rs` file in code coverage resultsWesley Wiser-10/+1
As discussed in https://github.com/rust-lang/rust/pull/92142#issuecomment-1008239473, tests that contain multiple files order their results differently on Windows and Linux which the test runner currently can't handle correctly. For now, ignore the "bin" part of the test and only include the unused library dependency which is what the test really cares about anyway.
2022-01-10Auto merge of #92719 - matthiaskrgr:rollup-tc7oqys, r=matthiaskrgrbors-27/+92
Rollup of 7 pull requests Successful merges: - #92248 (Normalize struct tail type when checking Pointee trait) - #92357 (Fix invalid removal of newlines from doc comments) - #92602 (Make source links look cleaner) - #92636 (Normalize generator-local types with unevaluated constants) - #92693 (Release notes: add `Result::unwrap_{,err_}unchecked`) - #92702 (Clean up lang_items::extract) - #92717 (update miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-10expand: Pick `cfg`s and `cfg_attrs` one by one, like other attributesVadim Petrochenkov-24/+12
2022-01-10Rollup merge of #92636 - compiler-errors:normalize-generator-const-expr, ↵Matthias Krüger-0/+26
r=oli-obk Normalize generator-local types with unevaluated constants Normalize generator-interior types in addition to (i.e. instead of just) erasing regions, since sometimes we collect types with unevaluated const exprs. Fixes #84737 Fixes #88171 Fixes #92091 Fixes #92634 Probably also fixes #73114, but that one has no code I could test. It looks like it's the same issue, though.
2022-01-10Rollup merge of #92602 - jsha:source-link-2, r=GuillaumeGomezMatthias Krüger-25/+32
Make source links look cleaner Change from syntaxy-looking [src] to the plain word "source". Change the syntaxy-looking `[-]` at the top of the page to say "collapse". Reduce opacity of rightside content. Part of #59851 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
2022-01-10Rollup merge of #92357 - GuillaumeGomez:fix-doc-comment-backline-removal, ↵Matthias Krüger-2/+12
r=camelid Fix invalid removal of newlines from doc comments Fixes https://github.com/rust-lang/rust/issues/91201. Before: ![Screenshot from 2021-12-28 17-02-11](https://user-images.githubusercontent.com/3050060/147585187-c8e67531-c1b4-457d-9d30-d5b44bf91fea.png) After: ![Screenshot from 2021-12-28 17-02-25](https://user-images.githubusercontent.com/3050060/147585190-30aa0398-1fc7-4fe7-9e8b-5c475d4f9613.png) r? `@camelid`
2022-01-10Rollup merge of #92248 - compiler-errors:normalize-type-for-pointee, r=jackh726Matthias Krüger-0/+22
Normalize struct tail type when checking Pointee trait Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on `<Ty as Pointee>::Metadata` later. Fixes #92128 Fixes #92577 Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing `<_ as Pointee>::Metadata` to be properly replaced with an infer variable ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/project.rs#L813)) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types. Fixes #91446
2022-01-10Elaborate param_env predicates when checking if type outlives involving ↵Jack Huey-0/+71
projection holds
2022-01-09Make message for &T -> &mut T transmute more accurate5225225-2/+2
2022-01-09Compute most of Public/Exported access level in rustc_resolveLamb-0/+28
Mak DefId to AccessLevel map in resolve for export hir_id to accesslevel in resolve and applied in privacy using local def id removing tracing probes making function not recursive and adding comments Move most of Exported/Public res to rustc_resolve moving public/export res to resolve fix missing stability attributes in core, std and alloc move code to access_levels.rs return for some kinds instead of going through them Export correctness, macro changes, comments add comment for import binding add comment for import binding renmae to access level visitor, remove comments, move fn as closure, remove new_key fmt fix rebase fix rebase fmt fmt fix: move macro def to rustc_resolve fix: reachable AccessLevel for enum variants fmt fix: missing stability attributes for other architectures allow unreachable pub in rustfmt fix: missing impl access level + renaming export to reexport Missing impl access level was found thanks to a test in clippy
2022-01-09Stabilize -Z print-link-args as --print link-argsJosh Triplett-9/+9
We have stable options for adding linker arguments; we should have a stable option to help debug linker arguments.
2022-01-09Mark windows_subsytem and no_builtins as crate-only attributes.Eric Huss-37/+121
These attributes are only checked at the crate root, so they should have a warning if they are used anywhere else.
2022-01-09Display "private fields" instead of "fields omitted"Noah Lev-6/+6
Also: * Always use `/* */` block comments * Use the same message everywhere, rather than sometimes prefixing with "some" When I first read rustdoc docs, I was confused why the fields were being omitted. It was only later that I realized it was because they were private. It's also always bothered me that rustdoc sometimes uses `//` and sometimes uses `/*` comments for these messages, so this change makes them all use `/*`. Technically, I think fields can be omitted if they are public but `doc(hidden)` too, but `doc(hidden)` is analogous to privacy. It's really just used to emulate "doc privacy" when -- because of technical limitations -- an item has to be public. So I think it's fine to include this under the category of "private fields".
2022-01-09Add validation for `link` attribute position.Eric Huss-161/+243
2022-01-09Auto merge of #92534 - Aaron1011:hash-hir, r=petrochenkovbors-2/+2
Hash `Ident` spans in all HIR structures This PR removes all of the `#[stable_hasher(project(name))]` attributes used in HIR structs. While these attributes are not known to be causing any issues in practice, we need to hash these in order for the incremental system to work correctly - a query could be otherwise be incorrectly marked green when a change occures in one of the `Span`s that it uses.
2022-01-09feat: pass_by_value lint attributeMahdi Dibaiee-23/+24
Useful for thin wrapper attributes that are best passed as value instead of reference.
2022-01-09Rollup merge of #92510 - inquisitivecrystal:foreign-block, r=cjgillotMatthias Krüger-0/+33
Don't resolve blocks in foreign functions Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. #74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does. Fixes #91370. r? ``@cjgillot``
2022-01-09Rollup merge of #92490 - jsha:crates-in-results, r=GuillaumeGomezMatthias Krüger-7/+5
Move crate drop-down to search results page This reduces clutter on doc pages. Part of #59840 r? ```@GuillaumeGomez``` Demo: https://rustdoc.crud.net/jsha/crates-in-results/std/index.html?search=str
2022-01-09Apply suggestions from code reviewWaffle Maybe-17/+17
Use "(associated) function" terminology instead of "method". Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2022-01-09Move `#[rustc_must_implement_one_of]` tests to fix tidy checkMaybe Waffle-0/+0
2022-01-09Add test for misused `#[rustc_must_implement_one_of]`Maybe Waffle-0/+120
2022-01-09Implement `#[rustc_must_implement_one_of]` attributeMaybe Waffle-0/+59
2022-01-08Link impl items to corresponding trait items in late resolver.Camille GILLOT-22/+14
2022-01-08Make source links look cleanerJacob Hoffman-Andrews-25/+32
Change from syntaxy-looking [src] to the plain word "source".
2022-01-08mangling_v0: Skip extern blocks during manglingVadim Petrochenkov-2/+2
2022-01-08mangling_v0: Add a test for mangling of foreign typesVadim Petrochenkov-0/+39