about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-07-24Rollup merge of #87403 - LeSeulArtichaut:assign-dropping-union, r=oli-obkManish Goregaokar-3/+19
Implement `AssignToDroppingUnionField` in THIR unsafeck r? ``@oli-obk`` cc rust-lang/project-thir-unsafeck#7
2021-07-24Rollup merge of #87359 - jyn514:bless-rustup, r=estebankManish Goregaokar-2/+5
Remove detection of rustup and cargo in 'missing extern crate' diagnostics Previously, this would change the test output when RUSTUP_HOME was set: ``` ---- [ui] ui/issues/issue-49851/compiler-builtins-error.rs stdout ---- diff of stderr: 1 error[E0463]: can't find crate for `core` 2 | 3 = note: the `thumbv7em-none-eabihf` target may not be installed + = help: consider downloading the target with `rustup target add thumbv7em-none-eabihf` 4 5 error: aborting due to previous error 6 ``` Originally, I fixed it by explicitly unsetting RUSTUP_HOME in compiletest. Then I realized that almost no one has RUSTUP_HOME set, since rustup doesn't set it itself. It does set RUST_RECURSION_COUNT whenever it launches a proxy, though - use that instead. r? ```@estebank``` cc ```@petrochenkov``` ```@kinnison```
2021-07-24Rollup merge of #87348 - SkiFire13:fix-87261, r=oli-obkManish Goregaokar-0/+337
Fix span when suggesting to add an associated type bound Fixes #87261 Note that this fix is not perfect, it ~~will still give incorrect~~ won't give suggestions in some situations: - If the associated type is defined on a supertrait of those contained in the opaque type, it will fallback to the previous behaviour, e.g. if `AssocTy` is defined on the trait `Foo`, `Bar` has `Foo` as supertrait and the opaque type is a `impl Bar + Baz`. - If the the associated type is defined on a generic trait and the opaque type includes two versions of that generic trait, e.g. the opaque type is `impl Foo<A> + Foo<B>`
2021-07-24Auto merge of #87296 - Aaron1011:inert-warn, r=petrochenkovbors-8/+70
Warn on inert attributes used on bang macro invocation These attributes are currently discarded. This may change in the future (see #63221), but for now, placing inert attributes on a macro invocation does nothing, so we should warn users about it. Technically, it's possible for there to be attribute macro on the same macro invocation (or at a higher scope), which inspects the inert attribute. For example: ```rust #[look_for_inline_attr] #[inline] my_macro!() #[look_for_nested_inline] mod foo { #[inline] my_macro!() } ``` However, this would be a very strange thing to do. Anyone running into this can manually suppress the warning.
2021-07-24Auto merge of #86461 - crlf0710:rich_vtable, r=nikomatsakisbors-0/+522
Refactor vtable format for upcoming trait_upcasting feature. This modifies vtable format: 1. reordering occurrence order of methods coming from different traits 2. include `VPtr`s for supertraits where this vtable cannot be directly reused during trait upcasting. Also, during codegen, the vtables corresponding to these newly included `VPtr` will be requested and generated. For the cases where this vtable can directly used, now the super trait vtable has exactly the same content to some prefix of this one. r? `@bjorn3` cc `@RalfJung` cc `@rust-lang/wg-traits`
2021-07-24Remove detection of rustup and cargo in 'missing extern crate' diagnosticsJoshua Nelson-2/+5
Previously, this would change the test output when RUSTUP_HOME was set: ``` ---- [ui] ui/issues/issue-49851/compiler-builtins-error.rs stdout ---- diff of stderr: 1 error[E0463]: can't find crate for `core` 2 | 3 = note: the `thumbv7em-none-eabihf` target may not be installed + = help: consider downloading the target with `rustup target add thumbv7em-none-eabihf` 4 5 error: aborting due to previous error 6 ``` Originally, I fixed it by explicitly unsetting RUSTUP_HOME in compiletest. Then I realized that almost no one has RUSTUP_HOME set, since rustup doesn't set it itself; although it does set RUST_RECURSION_COUNT whenever it launches a proxy. Then it was pointed out that this runtime check doesn't really make sense and it's fine to make it unconditional.
2021-07-24Rollup merge of #87398 - GuillaumeGomez:test-font-module-items, r=notriddleYuki Okushi-0/+4
Add test for fonts used for module items Fixes #85632. r? `@notriddle`
2021-07-24Rollup merge of #87322 - chazkiker2:fix/suggestion-ref-sync-send, r=estebankYuki Okushi-0/+48
fix: clarify suggestion that `&T` must refer to `T: Sync` for `&T: Send` ### Description - [x] fix #86507 - [x] add UI test for relevant code from issue - [x] change `rustc_trait_selection/src/traits/error_reporting/suggestions.rs` to include a more clear suggestion when `&T` fails to satisfy `Send` bounds due to the fact that `T` fails to implement `Sync` - [x] update UI test in Clippy: `src/tools/tests/ui/future_not_send.stderr`
2021-07-24Rollup merge of #87266 - hellow554:issue87076, r=Mark-SimulacrumYuki Okushi-0/+20
Add testcase for 87076 Closes #87076 I also moved the issue tests into the issues subfolder, nothing changed there.
2021-07-23Implement `AssignToDroppingUnionField` in THIR unsafeckLeSeulArtichaut-3/+19
2021-07-23Rollup merge of #87383 - Alexendoo:impl_trait_in_bindings-tests, r=oli-obkYuki Okushi-0/+221
Add regression tests for the impl_trait_in_bindings ICEs Closes #54600, closes #54840, closes #58504, closes #58956, closes #70971, closes #79099, closes #84919, closes #86201, closes #86642, closes #87295 r? ``@oli-obk``
2021-07-23Rollup merge of #87373 - Aaron1011:hir-wf-field, r=estebankYuki Okushi-8/+8
Extend HIR WF checking to fields r? ``@estebank``
2021-07-23Rollup merge of #87332 - camelid:dont-hide-fields, r=GuillaumeGomezYuki Okushi-4/+2
Don't hide fields of enum struct variants * The toggle adds visual clutter * It's easy to miss that there are fields * Tuple variant fields are always shown, so it is inconsistent to hide struct variant fields * It's annoying to have to click the toggle every time
2021-07-23Rollup merge of #87298 - boringcactus:patch-2, r=steveklabnikYuki Okushi-0/+3
memorialize Anna Harren in the bastion of the turbofish this seems fitting, at least to me.
2021-07-23Add test for fonts used for module itemsGuillaume Gomez-0/+4
2021-07-23Add regression testGiacomo Stevanato-0/+337
2021-07-23Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorinobors-194/+136
Make mir borrowck's use of opaque types independent of the typeck query's result fixes #87218 fixes #86465 we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result. When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information. We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead. r? `@spastorino`
2021-07-22Squash all commits.chaz-kiker-0/+48
add test for issue 86507 add stderr for issue 86507 update issue-86507 UI test add comment for the expected error in UI test file add proper 'refers to <ref_type>' in suggestion update diagnostic phrasing; update test to match new phrasing; re-organize logic for checking T: Sync evaluate additional obligation to figure out if T is Sync run './x.py test tidy --bless' incorporate changes from review; reorganize logic for readability
2021-07-22Don't hide fields of enum struct variantsNoah Lev-4/+2
* The toggle adds visual clutter * It's easy to miss that there are fields * Tuple variant fields are always shown, so it is inconsistent to hide struct variant fields * It's annoying to have to click the toggle every time
2021-07-22Add regression tests for the impl_trait_in_bindings ICEsAlex Macleod-0/+221
2021-07-22Auto merge of #86212 - ↵bors-114/+2
pnkfelix:mainline-targetted-revert-81473-warn-write-only-fields, r=simulacrum Revert PR 81473 to resolve (on mainline) issues 81626 and 81658. This is a nightly-targetted variant of PR #83171 The intent is to just address issue #81658 on all release channels, rather that keep repeatedly reverting PR #83171 on beta. However, our intent is *also* to reland PR #83171 after we have addressed issue #81658 , most likely by coupling the re-landing of PR #83171 with an enhancement like PR #83004
2021-07-22Add comment and more tests.Charles Lew-0/+384
2021-07-22Extend HIR WF checking to fieldsAaron Hill-8/+8
2021-07-22Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisaGuillaume Gomez-61/+1
Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC. The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support. Fixes https://github.com/rust-lang/rust/issues/61002. r? ``@nagisa`` (or anyone else from ``@rust-lang/wg-llvm)``
2021-07-22Rollup merge of #87288 - ijackson:rustdoc-theme, r=GuillaumeGomezGuillaume Gomez-11/+47
rustdoc: Restore --default-theme, etc, by restoring varname escaping In #86157 cd0f93193c84ddc6698f9b65909da71c084dcb74 Use Tera templates for rustdoc. dropped the following transformation from the keys of the default settings element's `data-` attribute names: .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v))) The `Escape` part is indeed no longer needed, because Tera does that for us. But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments. I have tested that the default theme function works again for me. I have also verified that passing (in shell syntax) '--default-theme="zork&"' escapes the value in the HTML. Closes #87263
2021-07-22Rollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakisGuillaume Gomez-0/+19
Normalize generic_ty before checking if bound is met Fixes #81487 r? `@nikomatsakis`
2021-07-22Rollup merge of #87270 - GuillaumeGomez:item-summary-table, r=notriddleGuillaume Gomez-0/+13
Don't display <table> in item summary Fixes #87231. r? `@notriddle`
2021-07-22bless nll testsOli Scherer-20/+16
2021-07-22Add a regression testOli Scherer-0/+24
2021-07-22Make mir borrowck's use of opaque types independent of the typeck query's resultOli Scherer-174/+96
2021-07-22Move implementors directly into lib2Guillaume Gomez-1/+1
2021-07-22Add tests for default-settingsGuillaume Gomez-0/+60
2021-07-22Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebankbors-44/+68
Support HIR wf checking for function signatures During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).
2021-07-22Auto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakisbors-0/+56
Fix implicit Sized relaxation when attempting to relax other, unsupported trait Fixes #87199. Do note that this bug fix causes code like the `ref_arg::<[i32]>(&[5]);` line in the test case in combination with an affected function to no longer compile.
2021-07-21temporarily ignore a test until we reland PR 83171.Felix S. Klock II-0/+2
2021-07-21Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.Felix S. Klock II-114/+0
Revert "Add missing brace" This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655. Revert "Simplify base_expr" This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c. Revert "Warn write-only fields" This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.
2021-07-22Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakisbors-10/+10
When pretty printing, name placeholders as bound regions Split from #85499 When we see a placeholder that we are going to print, treat it as a bound var (and add it to a `for<...>`
2021-07-21Remove cargo workspace to build rustdoc-gui test crates because of cargo ↵Guillaume Gomez-24/+0
config not being applied
2021-07-21Add test to ensure tables are not inside items summaryGuillaume Gomez-0/+13
2021-07-21Rollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakisEric Huss-32/+32
Rename force-warns to force-warn The renames the `--force-warns` option to `--force-warn`. This mirrors other lint options like `--warn` and `--deny` which are in the singular. r? `@nikomatsakis` cc `@ehuss` - this option is being used by Cargo. How do we make sure the transition to using the new name is as smooth as possible?
2021-07-21Rollup merge of #87024 - weihanglo:issue-85494, r=ManishearthEric Huss-7/+38
rustdoc: show count of item contents when hidden Resolves #85494
2021-07-21Rollup merge of #87342 - midgleyc:add-E0757-long, r=GuillaumeGomezGuillaume Gomez-0/+1
Add long explanation for E0757 Helps with #61137
2021-07-21Rollup merge of #87321 - midgleyc:add-E0722-long, r=GuillaumeGomezGuillaume Gomez-1/+2
Add long explanation for E0722 Helps with #61137
2021-07-21Rollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebankGuillaume Gomez-8/+8
Get back the more precise suggestion spans of old regionck I noticed that when you turn on nll, the structured suggestion replaces a snippet instead of appending a snippet. It seems clearer to the user to only highlight the newly added characters instead of the entire `impl Trait` (and old regionck already does it this way). r? ``@estebank``
2021-07-21Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obkGuillaume Gomez-0/+15
Recognize bounds on impls as const bounds r? ```@oli-obk```
2021-07-21Rollup merge of #87230 - GuillaumeGomez:docblock-table-overflow, r=notriddleGuillaume Gomez-7/+18
Fix docblock <table> overflow Before: ![Screenshot from 2021-07-18 00-05-23](https://user-images.githubusercontent.com/3050060/126050272-ce08bc5f-74ff-4135-bc12-d708d87470cc.png) After: ![Screenshot from 2021-07-18 00-03-55](https://user-images.githubusercontent.com/3050060/126050273-42f41b4d-ad57-4a87-91de-18e63f8504ec.png) cc `@SergioBenitez` r? `@notriddle`
2021-07-21Rename force-warns to force-warnRyan Levick-32/+32
2021-07-21Add long explanation for E0757Chris Midgley-0/+1
2021-07-20Add long explanation for E0722Chris Midgley-1/+2
2021-07-20Support HIR wf checking for function signaturesAaron Hill-44/+68
During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).