about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-05-16Add regression test for #81804Yuki Okushi-0/+50
2022-05-15rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crateVadim Petrochenkov-17/+17
2022-05-15Auto merge of #96885 - petrochenkov:linkstrict2, r=cjgillot,luqmanabors-190/+425
rustc: Stricter checking for #[link] attributes A subset of https://github.com/rust-lang/rust/pull/94962 that doesn't touch library renaming/reordering/deduplication. `#[link]` attributes are checked for all kinds of unexpected arguments inside them. I also tried to make wording for these errors more consistent, that's why some existing errors are changed, including errors for command line `-l` options. Spans are also made more precise where possible.
2022-05-15Rollup merge of #96958 - GuillaumeGomez:settings-menu-display, r=jshaMatthias Krüger-34/+20
Improve settings menu display and remove theme menu We talked about improving the settings menu and we mentioned that firefox pocket was a nice inspiration so I implemented it. The result looks like this: ![Screenshot from 2022-05-11 23-59-53](https://user-images.githubusercontent.com/3050060/167954743-438c0a06-4628-478c-bf0c-d20313c1fdfc.png) You can test it [here](https://rustdoc.crud.net/imperio/settings-menu-display/doc/foo/index.html). Only question I have is: should I re-assign the shortcut `T` to this setting menu now that the theme menu is gone? For now I simply removed it. Important to be noted: the full settings page (at `settings.html`) is still rendered the same as currently. r? ``@jsha``
2022-05-15rustc: Stricter checking for #[link] attributesVadim Petrochenkov-190/+425
2022-05-14Auto merge of #97039 - cjgillot:no-rpit-hrtb, r=jackh726bors-98/+221
Forbid nested opaque types to reference HRTB from opaque types. Avoids https://github.com/rust-lang/rust/issues/96194 Alternative to https://github.com/rust-lang/rust/pull/96970 r? `@oli-obk`
2022-05-14Update GUI testsGuillaume Gomez-34/+20
2022-05-14Add a test with both passing and erroneous cases.Camille GILLOT-0/+146
2022-05-14Auto merge of #95826 - carbotaniuman:miri-permissive-provenance, r=RalfJungbors-2/+2
Initial work on Miri permissive-exposed-provenance Rustc portion of the changes for portions of a permissive ptr-to-int model for Miri. The main changes here are changing `ptr_get_alloc` and `get_alloc_id` to return an Option, and also making ptr-to-int casts have an expose side effect.
2022-05-14Forbid nested opaque types to reference HRTB from opaque types.Camille GILLOT-98/+75
2022-05-14Auto merge of #97035 - JohnTitor:rollup-00ko07z, r=JohnTitorbors-0/+25
Rollup of 6 pull requests Successful merges: - #95365 (Use default alloc_error_handler for hermit) - #96986 ([save-analysis] Reference the variant not enum at struct-literal cons…) - #96998 (rustdoc: remove weird, unused variable from source-files.js) - #97005 (Two small improvements of rustc_expand) - #97018 (Ensure that test fail if a JS error occurs) - #97031 (Drop tracking: handle invalid assignments better) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-14Rollup merge of #97031 - eholk:drop-tracking-type-error, r=compiler-errorsYuki Okushi-0/+25
Drop tracking: handle invalid assignments better Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
2022-05-14Auto merge of #95602 - scottmcm:faster-array-intoiter-fold, r=the8472bors-0/+54
Fix `array::IntoIter::fold` to use the optimized `Range::fold` It was using `Iterator::by_ref` in the implementation, which ended up pessimizing it enough that, for example, it didn't vectorize when we tried it in the <https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/Reducing.20sum.20into.20wider.20types> conversation. Demonstration that the codegen test doesn't pass on the current nightly: <https://rust.godbolt.org/z/Taxev5eMn>
2022-05-13Drop tracking: handle invalid assignments betterEric Holk-0/+25
Previously this test case was crashing with an index out of bounds error deep in the call to `needs_drop`. We avoid this by detecting clearly invalid assignees in the `mutate` callback and ignoring these.
2022-05-13Test RefCell aliasingJosh Stone-0/+50
2022-05-13Don't hardcode attribute id in codegen testGary Guo-4/+4
2022-05-13Rustc changes for permissive provenancecarbotaniuman-2/+2
2022-05-13Extend ptr::null and null_mut to all thin (including extern) typesSimon Sapin-1/+1
Fixes https://github.com/rust-lang/rust/issues/93959 This change was accepted in https://rust-lang.github.io/rfcs/2580-ptr-meta.html Note that this changes the signature of **stable** functions. The change should be backward-compatible, but it is **insta-stable** since it cannot (easily, at all?) be made available only through a `#![feature(…)]` opt-in. The RFC also proposed the same change for `NonNull::dangling`, which makes sense it terms of its signature but not in terms of its implementation. `dangling` uses `align_of()` as an address. But what `align_of()` should be for extern types or whether it should be allowed at all remains an open question. This commit depends on https://github.com/rust-lang/rust/pull/93977, which is not yet part of the bootstrap compiler. So `#[cfg]` is used to only apply the change in stage 1+. As far a I know bounds cannot be made conditional with `#[cfg]`, so the entire functions are duplicated. This is unfortunate but temporary. Since this duplication makes it less obvious in the diff, the new definitions differ in: * More permissive bounds (`Thin` instead of implied `Sized`) * Different implementation * Having `rustc_allow_const_fn_unstable(ptr_metadata)`
2022-05-13remove HirVisitorMiguel Guarniz-33/+27
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13optimize find_item to fetch Item only when neededMiguel Guarniz-3/+3
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13Rollup merge of #97011 - JohnTitor:issue-28935, r=compiler-errorsMatthias Krüger-0/+9
Add regression test for #28935 Closes #28935, one of the ancient issues can be closed :) r? `@compiler-errors`
2022-05-13Rollup merge of #96615 - JohnTitor:test-54779, r=compiler-errorsMatthias Krüger-0/+62
Add a regression test for #54779 Closes #54779 r? `@jackh726`
2022-05-13Add regression test for #28935Yuki Okushi-0/+9
2022-05-13For non-defining opaque type usage errors, don't try to also prove all trait ↵Oli Scherer-184/+6
bounds
2022-05-13Check that closures satisfy their where boundsOli Scherer-14/+327
2022-05-13Rollup merge of #96993 - notriddle:notriddle/prototype, r=GuillaumeGomezMatthias Krüger-0/+20
rustdoc: fix GUI crash when searching for magic JS property values
2022-05-13Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwcoMatthias Krüger-24/+100
Be more precise than DefPathData::Misc. This variant was used for two unrelated things. Let's make this cleaner.
2022-05-13Rollup merge of #96948 - ludfo774:macro-trailing-comma-test, r=joshtriplettMatthias Krüger-0/+6
Add test of matches macro for trailing commas Almost all macros are tested for trailing commas. The macro matches! was however not tested. This PR adds that test case. Related to #46238
2022-05-12rustdoc: fix GUI crash when searching for magic JS property valuesMichael Howell-0/+20
2022-05-12Bless mir-opt tests.Camille GILLOT-18/+94
2022-05-12Bless tests.Camille GILLOT-6/+6
2022-05-12Rollup merge of #96968 - cjgillot:codegen-fulfill-nice, r=oli-obkMatthias Krüger-0/+346
Add tests for #96806 I messed up the rebase in https://github.com/rust-lang/rust/pull/96806. I took the opportunity to add an extra mir-opt test from https://github.com/rust-lang/rust/pull/91743. r? `@oli-obk`
2022-05-12Rollup merge of #96939 - GuillaumeGomez:settings-css, r=notriddleMatthias Krüger-0/+5
Fix settings page CSS In https://github.com/rust-lang/rust/pull/96741, I moved the CSS loading outside of `settings.js`. The result was that on the settings page, there isn't the settings CSS anymore: ![Screenshot from 2022-05-11 11-09-24](https://user-images.githubusercontent.com/3050060/167817969-6750931b-3e6e-4178-b5a9-ee3851e983be.png) I also used this opportunity to remove unused CSS rules (we don't have `<select>` elements anymore in the settings). cc `@jsha` r? `@notriddle`
2022-05-12Expand c-unwind-abi-panic-abort testGary Guo-4/+9
2022-05-12Add mir-opt test.Camille GILLOT-0/+157
2022-05-12Auto merge of #96853 - ↵bors-8/+39
davidtwco:diagnostic-translation-unit-and-more-porting, r=oli-obk diagnostics: port more diagnostics to derive + support for `()` fields - Extend diagnostic derive so that spanless subdiagnostics (e.g. some uses of `help`/`note`) can be applied via attributes to fields of type `()` (currently spanless subdiagnostics are applied via attributes on the diagnostic struct itself). A consequence of this is that `Option<()>` fields can be used to represent optional spanless subdiagnostics, which are sometimes useful (e.g. for a `help` that should only show on nightly builds). - Simplify the "explicit generic args with impl trait" diagnostic struct (from #96760) using support for `Option<()>` spanless subdiagnostics. - Change `DiagnosticBuilder::set_arg`, used to provide context for Fluent messages, so that it takes anything that implements `IntoDiagnosticArg`, rather than `DiagnosticArgValue` - this improves the ergonomics of manual implementations of `SessionDiagnostic` which are translatable. - Port "the type parameter `T` must be explicitly specified", "manual implementations of `X` are experimental", "could not resolve substs on overridden impl" diagnostics to diagnostic structs. - When testing macros from `rustc_macros` in `ui-fulldeps` tests, sometimes paths from the compiler source tree can be shown in error messages - these need to be normalized in `compiletest`. r? `@oli-obk` cc `@pvdrz`
2022-05-12Add tests.Camille GILLOT-0/+189
2022-05-12Auto merge of #96940 - TaKO8Ki:stop-suggesting-wrong-fully-qualified-path, ↵bors-0/+59
r=estebank Stop suggesting non-existing fully qualified paths This patch fixes a part of #96295. r? `@estebank`
2022-05-12errors: `set_arg` takes `IntoDiagnosticArg`David Wood-8/+17
Manual implementors of translatable diagnostics will need to call `set_arg`, not just the derive, so make this function a bit more ergonomic by taking `IntoDiagnosticArg` rather than `DiagnosticArgValue`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-12macros: spanless subdiagnostics from `()` fieldsDavid Wood-0/+22
Type attributes could previously be used to support spanless subdiagnostics but these couldn't easily be made optional in the same way that spanned subdiagnostics could by using a field attribute on a field with an `Option<Span>` type. Spanless subdiagnostics can now be specified on fields with `()` type or `Option<()>` type. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-12Auto merge of #95837 - scottmcm:ptr-offset-from-unsigned, r=oli-obkbors-3/+77
Add `sub_ptr` on pointers (the `usize` version of `offset_from`) We have `add`/`sub` which are the `usize` versions of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`. As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change. This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
2022-05-11Apply CR suggestions; add real tracking issueScott McMurray-1/+2
2022-05-11Rename `unsigned_offset_from` to `sub_ptr`Scott McMurray-1/+1
2022-05-11Add `unsigned_offset_from` on pointersScott McMurray-3/+76
Like we have `add`/`sub` which are the `usize` version of `offset`, this adds the `usize` equivalent of `offset_from`. Like how `.add(d)` replaced a whole bunch of `.offset(d as isize)`, you can see from the changes here that it's fairly common that code actually knows the order between the pointers and *wants* a `usize`, not an `isize`. As a bonus, this can do `sub nuw`+`udiv exact`, rather than `sub`+`sdiv exact`, which can be optimized slightly better because it doesn't have to worry about negatives. That's why the slice iterators weren't using `offset_from`, though I haven't updated that code in this PR because slices are so perf-critical that I'll do it as its own change. This is an intrinsic, like `offset_from`, so that it can eventually be allowed in CTFE. It also allows checking the extra safety condition -- see the test confirming that CTFE catches it if you pass the pointers in the wrong order.
2022-05-12Auto merge of #96150 - est31:unused_macro_rules, r=petrochenkovbors-46/+209
Implement a lint to warn about unused macro rules This implements a new lint to warn about unused macro rules (arms/matchers), similar to the `unused_macros` lint added by #41907 that warns about entire macros. ```rust macro_rules! unused_empty { (hello) => { println!("Hello, world!") }; () => { println!("empty") }; //~ ERROR: 1st rule of macro `unused_empty` is never used } fn main() { unused_empty!(hello); } ``` Builds upon #96149 and #96156. Fixes #73576
2022-05-12Prevent unwinding when `-C panic=abort` is used regardless declared ABIGary Guo-3/+3
2022-05-11Auto merge of #96806 - cjgillot:codegen-fulfill-nice, r=oli-obkbors-10/+47
Gracefully fail to resolve associated items instead of `delay_span_bug`. `codegen_fulfill_obligation` is used during instance resolution for trait items. In case of insufficient normalization issues during MIR inlining, it caused ICEs. It's better to gracefully refuse to resolve the associated item, and let the caller decide what to do with this. Split from https://github.com/rust-lang/rust/pull/91743 Closes #69121 Closes #73021 Closes #88599 Closes #93008 Closes #93248 Closes #94680 Closes #96170 r? `@oli-obk`
2022-05-12Add regression test for #96395Yuki Okushi-0/+3
2022-05-11Add test of matches macro for trailing commasludfo774-0/+6
2022-05-11stop suggesting non-existing fully qualified pathsTakayuki Maeda-0/+59