about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-11Add some regression tests for #44454Yuki Okushi-0/+115
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-11Add regression test for #104582Yuki Okushi-0/+30
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-10fix rebaseEsteban Küber-2/+2
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-97/+108
2022-12-10Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiaskoMatthias Krüger-0/+20
Fix invalid codegen during debuginfo lowering In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization. However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go. r? `@tmiasko` but feel free to reassign if you want 🙂 Fixes #105386
2022-12-10Rollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwUMatthias Krüger-0/+23
Consider `parent_count` for const param defaults Fixes #105257
2022-12-10Rollup merge of #105192 - estebank:point-at-lhs-on-binop, r=fee1-deadMatthias Krüger-186/+560
Point at LHS on binop type err if relevant
2022-12-10Rollup merge of #104460 - Nilstrieb:expand-the-translation, r=davidtwcoMatthias Krüger-24/+34
Migrate parts of `rustc_expand` to session diagnostics This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
2022-12-10Migrate parts of `rustc_expand` to session diagnosticsnils-24/+34
This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
2022-12-10Rollup merge of #105514 - estebank:is_visible, r=oli-obkMatthias Krüger-4/+0
Introduce `Span::is_visible` r? `@oli-obk`
2022-12-10Rollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee1-deadMatthias Krüger-20/+34
Don't warn about unused parens when they are used by yeet expr Don't even get me started on how I've found this.
2022-12-10Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger-1/+1
Add LLVM KCFI support to the Rust compiler This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
2022-12-10Rollup merge of #104019 - compiler-errors:print-generator-sizes, r=wesleywiserMatthias Krüger-0/+83
Compute generator sizes with `-Zprint_type_sizes` Fixes #103887 r? `@pnkfelix`
2022-12-10fix #105366, suggest impl in the scenario of typo with fnyukang-0/+37
2022-12-09Fix process-panic-after-fork.rs to pass on newer versions of Android.Peter Collingbourne-36/+41
The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.
2022-12-09Account for macros in const genericsEsteban Küber-0/+6
2022-12-09Introduce `Span::is_visible`Esteban Küber-4/+0
2022-12-09Rollup merge of #105506 - estebank:rustc_must_implement_one_of, ↵Matthias Krüger-28/+28
r=compiler-errors Tweak `rustc_must_implement_one_of` diagnostic output
2022-12-09Rollup merge of #105265 - aDotInTheVoid:sum-product-on-unimplemented, r=estebankMatthias Krüger-0/+48
Add `rustc_on_unimplemented` to `Sum` and `Product` trait. Helps with #105184, but I don't think it fully fixes it.
2022-12-09Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiserMatthias Krüger-0/+35
Make `missing_copy_implementations` more cautious - Fixes https://github.com/rust-lang/rust/issues/98348 - Also makes the lint not fire on large types and types containing raw pointers. Thoughts?
2022-12-09Tweak `rustc_must_implement_one_of` diagnostic outputEsteban Küber-28/+28
2022-12-09Don't warn about unused parens when they are used by yeet exprMaybe Waffle-20/+34
2022-12-09Illegal sized bounds: only suggest mutability change if neededRobin Schroer-0/+110
In a scenario like ``` struct Type; pub trait Trait { fn function(&mut self) where Self: Sized; } impl Trait for Type { fn function(&mut self) {} } fn main() { (&mut Type as &mut dyn Trait).function(); } ``` the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied. Fixes #103622.
2022-12-09Auto merge of #105486 - matthiaskrgr:rollup-o7c4l1c, r=matthiaskrgrbors-0/+52
Rollup of 10 pull requests Successful merges: - #105216 (Remove unused GUI test) - #105245 (attempt to clarify align_to docs) - #105387 (Improve Rustdoc scrape-examples UI) - #105389 (Enable profiler in dist-powerpc64le-linux) - #105427 (Dont silently ignore rustdoc errors) - #105442 (rustdoc: clean up docblock table CSS) - #105443 (Move some queries and methods) - #105455 (use the correct `Reveal` during validation) - #105470 (Clippy: backport ICE fix before beta branch) - #105474 (lib docs: fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-09Rollup merge of #105455 - lcnr:correct-reveal-in-validate, r=jackh726Matthias Krüger-0/+52
use the correct `Reveal` during validation supersedes #105454. Deals with https://github.com/rust-lang/rust/issues/105009#issuecomment-1342395333, not closing #105009 as the ICE may leak into beta The issue was the following: - we optimize the mir, using `Reveal::All` - some optimization relies on the hidden type of an opaque type - we then validate using `Reveal::UserFacing` again which is not able to observe the hidden type r? `@jackh726`
2022-12-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-713/+2025
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-09Add testsGary Guo-0/+93
2022-12-08Don't generate pointer loads to spills unless necessaryWesley Wiser-0/+20
In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization. However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go.
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-1/+1
This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-12-08Point at LHS on binop type err if relevantEsteban Küber-186/+560
2022-12-08Add `rustc_on_unimplemented` to `Sum` and `Product` trait.Nixon Enraght-Moony-0/+48
2022-12-08Support `#[track_caller]` on async closuresGary Guo-1/+65
2022-12-08Rollup merge of #105408 - cuviper:help-rpitirpit, r=compiler-errorsMatthias Krüger-0/+6
Add help for `#![feature(impl_trait_in_fn_trait_return)]` This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`. cc #99697
2022-12-08Rollup merge of #105255 - cjgillot:issue-105197, r=compiler-errorsMatthias Krüger-0/+17
Make nested RPIT inherit the parent opaque's generics. Fixes https://github.com/rust-lang/rust/issues/105197 r? ```@compiler-errors```
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-11/+179
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-08add regression test for #105009lcnr-0/+52
2022-12-08add a test for #103095Takayuki Maeda-0/+30
2022-12-08add a test case for `generic_const_exprs` in trait itemsTakayuki Maeda-1/+8
2022-12-07Properly print generator interior type sizesMichael Goulet-11/+28
2022-12-07Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obkMatthias Krüger-0/+12
normalize before handling simple checks for evaluatability of `ty::Const` `{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
2022-12-07Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-0/+54
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-07Add tests for #41731Steven Tang-0/+106
Closes #41731
2022-12-07Make -Zsimulate-remapped-rust-src-base reproducible on CIOli Scherer-9/+9
2022-12-07Auto merge of #104799 - pcc:linkage-fn, r=tmiaskobors-30/+15
Support Option and similar enums as type of static variable with linkage attribute Compiler MCP: rust-lang/compiler-team#565
2022-12-07Avoid remapping paths back to `$SRC_DIR` in CIOli Scherer-6/+6
2022-12-07fix #105226, Detect spurious ; before assoc fn bodyyukang-0/+53
2022-12-07consider `parent_count` for const param defaultsTakayuki Maeda-0/+16
2022-12-07Compute generator sizes with -Zprint_type_sizesMichael Goulet-0/+66
2022-12-06Add help for `#![feature(impl_trait_in_fn_trait_return)]`Josh Stone-0/+6
This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`.
2022-12-06normalize before matching on `ConstKind`Boxy-0/+12