about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-13Fast path some binder relationsMichael Goulet-0/+38
2022-12-13Add tests (currently broken) for unsafe + inline const patGary Guo-0/+39
2022-12-13Add testsGary Guo-0/+80
2022-12-13Rollup merge of #105636 - GuillaumeGomez:extend-gui-test, r=notriddleMatthias Krüger-0/+2
Add check for local-storage value when changing "display line numbers" settings r? `@notriddle`
2022-12-13Rollup merge of #105629 - notriddle:notriddle/method-toggle-trait, ↵Matthias Krüger-0/+7
r=GuillaumeGomez rustdoc: stop treating everything in a trait item as a method This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the spacing on trait pages, but stopped being needed because 791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.
2022-12-13Rollup merge of #105332 - estebank:iterator-chains, r=oli-obkMatthias Krüger-122/+319
Point out the type of associated types in every method call of iterator chains Partially address #105184 by pointing out the type of associated types in every method call of iterator chains: ``` note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@src/test/ui/iterators/invalid-iterator-chain.rs:12:18: 12:21]>` --> src/test/ui/iterators/invalid-iterator-chain.rs:12:14 | 10 | vec![0, 1] | ---------- this expression has type `Vec<{integer}>` 11 | .iter() | ------ associated type `std::iter::Iterator::Item` is `&{integer}` here 12 | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here ``` We also reduce the number of impls we mention when any of the candidates is an "exact match". This benefits the output of cases with numerics greatly. Outstanding work would be to provide a structured suggestion for appropriate changes, like in this case detecting the spurious `;` in the closure.
2022-12-13Rollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebankMatthias Krüger-0/+32
Account for item-local in inner scope for E0425 Fixes #104700
2022-12-12Add check for local-storage value when changing "display line numbers" settingsGuillaume Gomez-0/+2
2022-12-12rustdoc: stop treating everything in a trait item as a methodMichael Howell-0/+7
This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the spacing on trait pages, but stopped being needed because 791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.
2022-12-12Rollup merge of #105561 - TaKO8Ki:fix-105449, r=fee1-deadMatthias Krüger-0/+59
Normalize receiver substs and erase the regions Fixes #105449
2022-12-12Properly calculate best failure in macro matchingNilstrieb-0/+32
Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream. We now try to properly use the location in the token stream.
2022-12-12what is `unstable_features` lolBoxy-1/+1
2022-12-12fold instead of obliterating argsBoxy-0/+29
2022-12-12normalize receiver substs and erase the regionsTakayuki Maeda-0/+59
use a smaller example
2022-12-12Rollup merge of #104997 - c410-f3r:moar-errors, r=petrochenkovMatthias Krüger-18/+0
Move tests r? `@petrochenkov`
2022-12-11fix transmutes between pointers in different address spacesErik Desjardins-1/+23
2022-12-11Point at method call when it is the source of the bound errorEsteban Küber-163/+81
2022-12-11Move testsCaio-18/+0
2022-12-11Rollup merge of #105369 - chenyukang:yukang/fix-105226, r=TaKO8KiMatthias Krüger-0/+53
Detect spurious ; before assoc fn body Fixes #105226 r? ``@TaKO8Ki``
2022-12-11Rollup merge of #105283 - compiler-errors:ty-var-in-hir-wfcheck, r=nagisaMatthias Krüger-0/+50
Don't call `diagnostic_hir_wf_check` query if we have infer variables Fixes #105260
2022-12-11Use `with_forced_trimmed_paths`Esteban Küber-36/+36
2022-12-11KCFI test: Also support LLVM 16 outputTim Neumann-6/+3
2022-12-11fix rebaseEsteban Küber-10/+29
2022-12-11Only point at methods that might be relevantEsteban Küber-17/+64
2022-12-11Add label to method chains where assoc type remains the sameEsteban Küber-5/+5
2022-12-11Remove mention of "assoc type" in label as it is already in the `note` messageEsteban Küber-16/+16
2022-12-11Account for method call chains split across multiple bindingsEsteban Küber-11/+57
2022-12-11Mention only assoc types changesEsteban Küber-25/+23
2022-12-11Expand iterator chain testEsteban Küber-7/+26
2022-12-11Provide associated type information in method chainsMichael Goulet-0/+150
When encountering an unmet obligation that affects a method chain, like in iterator chains where one of the links has the wrong associated type, we point at every method call and mention their evaluated associated type at that point to give context to the user of where expectations diverged from the code as written. ``` note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/invalid-iterator-chain.rs:12:18: 12:21]>` --> $DIR/invalid-iterator-chain.rs:12:14 | LL | vec![0, 1] | ---------- this expression has type `Vec<{integer}>` LL | .iter() | ------ associated type `std::iter::Iterator::Item` is `&{integer}` here LL | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here ```
2022-12-11Auto merge of #102900 - abrachet:master, r=bjorn3bors-0/+10
Don't internalize __llvm_profile_counter_bias Currently, LLVM profiling runtime counter relocation cannot be used by rust during LTO because symbols are being internalized before all symbol information is known. This mode makes LLVM emit a __llvm_profile_counter_bias symbol which is referenced by the profiling initialization, which itself is pulled in by the rust driver here [1]. It is enabled with -Cllvm-args=-runtime-counter-relocation for platforms which are opt-in to this mode like Linux. On these platforms there will be no link error, rather just surprising behavior for a user which request runtime counter relocation. The profiling runtime will not see that symbol go on as if it were never there. On Fuchsia, the profiling runtime must have this symbol which will cause a hard link error. As an aside, I don't have enough context as to why rust's LTO model is how it is. AFAICT, the internalize pass is only safe to run at link time when all symbol information is actually known, this being an example as to why. I think special casing this symbol as a known one that LLVM can emit which should not have it's visbility de-escalated should be fine given how seldom this pattern of defining an undefined symbol to get initilization code pulled in is. From a quick grep, __llvm_profile_runtime is the only symbol that rustc does this for. [1] https://github.com/rust-lang/rust/blob/0265a3e93bf1b89d97cae113ed214954d5c35e22/compiler/rustc_codegen_ssa/src/back/linker.rs#L598
2022-12-11Auto merge of #105554 - matthiaskrgr:rollup-ir60gc7, r=matthiaskrgrbors-99/+255
Rollup of 6 pull requests Successful merges: - #105411 (Introduce `with_forced_trimmed_paths`) - #105532 (Document behaviour of `--remap-path-prefix` with several matches) - #105537 (compiler: remove unnecessary imports and qualified paths) - #105539 (rustdoc: Only hide lines starting with `#` in rust code blocks ) - #105546 (Add some regression tests for #44454) - #105547 (Add regression test for #104582) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-11Rollup merge of #105547 - JohnTitor:issue-104582, r=compiler-errorsMatthias Krüger-0/+30
Add regression test for #104582 Closes #104582 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-11Rollup merge of #105546 - JohnTitor:issue-44454, r=compiler-errorsMatthias Krüger-0/+115
Add some regression tests for #44454 Closes #44454 r? ``@compiler-errors`` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-11Auto merge of #105457 - GuillaumeGomez:prevent-auto-blanket-impl-retrieval, ↵bors-0/+39
r=notriddle rustdoc: Prevent auto/blanket impl retrieval if there were compiler errors Fixes https://github.com/rust-lang/rust/issues/105404. I'm not sure happy about this fix but since it's how passes work (ie, even if there are errors, it runs all passes), I think it's fine as is. Just as a sidenote: I also gave a try to prevent running all passes in case there were compiler errors but then a lot of rustdoc tests were failing so I went for this fix instead. r? `@notriddle`
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-10Auto merge of #105531 - matthiaskrgr:rollup-7y7zbgl, r=matthiaskrgrbors-459/+908
Rollup of 6 pull requests Successful merges: - #104460 (Migrate parts of `rustc_expand` to session diagnostics) - #105192 (Point at LHS on binop type err if relevant) - #105234 (Remove unneeded field from `SwitchTargets`) - #105239 (Avoid heap allocation when truncating thread names) - #105410 (Consider `parent_count` for const param defaults) - #105482 (Fix invalid codegen during debuginfo lowering) Failed merges: - #105411 (Introduce `with_forced_trimmed_paths`) r? `@ghost` `@rustbot` modify labels: rollup
2022-12-10Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiaskoMatthias Krüger-0/+42
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 #105234 - JakobDegen:unneeded-field, r=oli-obkMatthias Krüger-247/+247
Remove unneeded field from `SwitchTargets` This had a fixme already. The only change in behavior is that the mir dumps now no longer contains labels for the types of the integers on the edges of a switchint: Before: ![image](https://user-images.githubusercontent.com/51179609/205467622-34401a68-dca6-43eb-915e-b9fda1988860.png) After: ![image](https://user-images.githubusercontent.com/51179609/205467634-b5b2a259-9cb4-4843-845c-592c500f0f9c.png) I don't think that's a problem though. The information is still available to a user that really cares by checking the type of `_2`, so it honestly feels like a bit of an improvement to me. r? mir
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-26/+36
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-10Auto merge of #105384 - uweigand:s390x-test-codegen, r=Mark-Simulacrumbors-2/+6
Fix failing codegen tests on s390x Several codegen tests are currently failing due to making assumptions that are not valid for the s390x architecture: - catch-unwind.rs: fails due to inlining differences. Already ignored on another platform for the same reason. Solution: Ignore on s390x. - remap_path_prefix/main.rs: fails due to different alignment requirement for string constants. Solution: Do not test for the alignment requirement. - repr-transparent-aggregates-1.rs: many ABI assumptions. Already ignored on many platforms for the same reason. Solution: Ignore on s390x. - repr-transparent.rs: no vector ABI by default on s390x. Already ignored on another platform for a similar reason. Solution: Ignore on s390x. - uninit-consts.rs: hard-coded little-endian constant. Solution: Match both little- and big-endian versions. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2022-12-10Migrate parts of `rustc_expand` to session diagnosticsnils-26/+36
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/+59
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!