about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-04Use (actually) dummy place for let-else divergenceMichael Goulet-0/+15
2022-08-04Auto merge of #100120 - matthiaskrgr:rollup-g6ycykq, r=matthiaskrgrbors-12/+225
Rollup of 6 pull requests Successful merges: - #98771 (Add support for link-flavor rust-lld for iOS, tvOS and watchOS) - #98835 (relate `closure_substs.parent_substs()` to parent fn in NLL) - #99746 (Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`) - #99786 (Recover from C++ style `enum struct`) - #99795 (Delay a bug when failed to normalize trait ref during specialization) - #100029 (Prevent ICE for `doc_alias` on match arm, statement, expression) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-04Resolve vars before emitting coerce errorMichael Goulet-11/+100
2022-08-04Don't point out return span on every E0308Michael Goulet-5/+37
2022-08-04link_ordinal is available for foreign staticyukang-5/+18
2022-08-04Add ui test for #99910Obei Sideg-0/+30
2022-08-03Rollup merge of #100111 - estebank:missing-let, r=compiler-errorsMatthias Krüger-0/+26
Provide suggestion on missing `let` in binding statement Fix #78907. Fallout from the type ascription syntax.
2022-08-03Rollup merge of #100107 - klensy:tr-w, r=compiler-errorsMatthias Krüger-1/+1
fix trailing whitespace in error message
2022-08-03Rollup merge of #100105 - TaKO8Ki:add-regression-test-for-90871, ↵Matthias Krüger-0/+28
r=compiler-errors Add regression test for #90871 closes #90871
2022-08-03Rollup merge of #100068 - dcsommer:master, r=petrochenkovMatthias Krüger-3/+30
Fix backwards-compatibility check for tests with `+whole-archive` Fixes #100066
2022-08-03Rollup merge of #100029 - hdelc:master, r=cjgillotMatthias Krüger-12/+36
Prevent ICE for `doc_alias` on match arm, statement, expression Fixes #99777. This is a pretty minimal fix that should be safe, since rustdoc doesn't generate documentation for match arms, statements, or expressions. I mentioned in the linked issue that the `doc_alias` target checking should probably be improved to avoid future ICEs, but as a new contributor, I'm not confident enough with the HIR types to make a larger change.
2022-08-03Rollup merge of #99795 - ↵Matthias Krüger-0/+58
compiler-errors:delay-specialization-normalize-error, r=spastorino Delay a bug when failed to normalize trait ref during specialization The error messages still kinda suck here but they don't ICE anymore... Fixes #45814 Fixes #43037 r? types
2022-08-03Rollup merge of #99786 - obeis:issue-99625, r=compiler-errorsMatthias Krüger-0/+34
Recover from C++ style `enum struct` Closes #99625
2022-08-03Rollup merge of #98835 - aliemjay:relate_closure_substs, r=nikomatsakisMatthias Krüger-0/+97
relate `closure_substs.parent_substs()` to parent fn in NLL Fixes #98589 The discrepancy between early- and late-bound lifetimes is because we map early-bound lifetimes into those found in the `closure_substs` while late-bound lifetimes are mapped into liberated free regions: https://github.com/rust-lang/rust/blob/5f98537eb7b5f42c246a52c550813c3cff336069/compiler/rustc_borrowck/src/universal_regions.rs#L255-L261 r? `@rust-lang/types`
2022-08-03Bless ui tests.Camille GILLOT-58/+45
2022-08-03Bless incremental tests.Camille GILLOT-12/+12
2022-08-03Provide suggestion on missing `let` in binding statementEsteban Küber-0/+26
Fix #78907.
2022-08-03Auto merge of #100064 - RalfJung:disaligned, r=petrochenkovbors-1/+150
fix is_disaligned logic for nested packed structs https://github.com/rust-lang/rust/pull/83605 broke the `is_disaligned` logic by bailing out of the loop in `is_within_packed` early. This PR fixes that problem and adds suitable tests. Fixes https://github.com/rust-lang/rust/issues/99838
2022-08-03fix is_disaligned logic for nested packed structsRalf Jung-1/+150
2022-08-03Rustdoc-Json: Document HRTB's on DynTraitNixon Enraght-Moony-19/+35
Closes #99118
2022-08-03fix trailing whitespace in error messageklensy-1/+1
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-168/+249
2022-08-03add regression test for #90871Takayuki Maeda-0/+28
2022-08-03Rollup merge of #99738 - notriddle:notriddle/multiple-modules-w-same-name, ↵Dylan DPC-0/+41
r=camelid rustdoc: avoid inlining modules with duplicate names Fixes rust-lang/rust#99734
2022-08-03Skip over structs with no private fields that impl DerefMichael Goulet-0/+49
2022-08-03Don't suggest field method if it's just missing some boundsMichael Goulet-16/+0
2022-08-03Consider privacy more carefully when suggesting accessing fieldsMichael Goulet-50/+0
2022-08-03Suggest expressions' fields even if they're not ADTsMichael Goulet-0/+74
2022-08-03Auto merge of #100082 - matthiaskrgr:rollup-ywu4iux, r=matthiaskrgrbors-104/+220
Rollup of 6 pull requests Successful merges: - #99933 (parallelize HTML checking tool) - #99958 (Improve position named arguments lint underline and formatting names) - #100008 (Update all pre-cloned submodules on startup) - #100049 (:arrow_up: rust-analyzer) - #100070 (Clarify Cargo.toml comments) - #100074 (rustc-docs: Be less specific about the representation of `+bundle`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-03check link ordinal make sure target is foreign functionyukang-0/+41
2022-08-02Add items to `DocAliasBadLocation` check error match armhdelc-10/+10
- Added `Impl`, `Closure`, ForeignMod` targets - `Target::name` changed for `Target::Impl` - Error output for `Target::ForeignMod` changed to "foreign module"
2022-08-03add tests for `Debug` formatters and precision formattersTakayuki Maeda-1/+40
2022-08-03suggest a positional formatting argument instead of a captured argumentTakayuki Maeda-0/+76
2022-08-02Avoid invalidating the CFG in MirPatch.Jakob Degen-172/+0
As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
2022-08-03Delay a bug when failed to normalize trait ref during specializationMichael Goulet-0/+58
2022-08-02Stabilize backtraceTheodore Dubois-5/+0
2022-08-02Fix backwards-compatibility check for tests with `+whole-archive`Daniel Sommermann-3/+30
Fixes #100066
2022-08-02rustdoc: avoid inlining foreigns with duplicate namesMichael Howell-0/+20
2022-08-02Auto merge of #92268 - jswrenn:transmute, r=oli-obkbors-0/+4128
Initial implementation of transmutability trait. *T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!* This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`. What this PR provides is: - [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives) - [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays) - [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs) - [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums) - [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions) - [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`) - [x] visibility checking What isn't yet implemented: - [ ] transmutability options passed using the `Assume` struct - [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs) - [ ] smarter error messages These features will be implemented in future PRs.
2022-08-02never consider unsafe blocks unused if they would be required with ↵Ralf Jung-599/+109
unsafe_op_in_unsafe_fn
2022-08-02Rollup merge of #99958 - PrestonFrom:issue_99907, r=compiler-errorsMatthias Krüger-104/+220
Improve position named arguments lint underline and formatting names For named arguments used as implicit position arguments, underline both the opening curly brace and either: * if there is formatting, the next character (which will either be the closing curl brace or the `:` denoting the start of formatting args) * if there is no formatting, the entire arg span (important if there is whitespace like `{ }`) This should make it more obvious where the named argument should be. Additionally, in the lint message, emit the formatting argument names without a dollar sign to avoid potentially confusion. Fixes #99907
2022-08-02Rollup merge of #100052 - TimNN:patch-1, r=nikicMatthias Krüger-1/+1
RISC-V ASM test: relax label name constraint. The test is currently [broken at LLVM Head](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12425#01825d5b-c3d1-4fdc-a98d-5956b246aee2), likely since https://github.com/llvm/llvm-project/commit/260a64106854986a981e49ed87ee740460a23eb5: ```plain /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/src/test/assembly/asm/riscv-types.rs:59:11: error: CHECK: expected string not found in input --   | // CHECK: lb t0, %pcrel_lo(.Lpcrel_hi0)(t0)   | ^   | /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/build/x86_64-unknown-linux-gnu/test/assembly/asm/riscv-types.riscv64/riscv-types.s:24:36: note: scanning from here   | auipc t0, %pcrel_hi(extern_static)   | ^   | /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/build/x86_64-unknown-linux-gnu/test/assembly/asm/riscv-types.riscv64/riscv-types.s:25:2: note: possible intended match here   | lb t0, %pcrel_lo(.Lpcrel_hi18)(t0)   | ^ ``` As far as I can tell, the exact index in the label probably doesn't matter for the test, especially if LLVM can change it to ~arbitrary values, though I'm not an ASM or RISC-V expert. This [fixes the test](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12427).
2022-08-02Rollup merge of #100045 - Amanieu:global_asm_may_unwind, r=tmiaskoMatthias Krüger-36/+36
Properly reject the `may_unwind` option in `global_asm!` This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
2022-08-02NLL: relate closure to parent fnAli MJ Al-Nasrawy-0/+97
2022-08-02RISC-V ASM test: relax label name constraint.Tim Neumann-1/+1
2022-08-02Improve position named arguments lint underline and formatting namesPreston From-104/+220
For named arguments used as implicit position arguments, underline both the opening curly brace and either: * if there is formatting, the next character (which will either be the closing curl brace or the `:` denoting the start of formatting args) * if there is no formatting, the entire arg span (important if there is whitespace like `{ }`) This should make it more obvious where the named argument should be. Additionally, in the lint message, emit the formatting argument names without a dollar sign to avoid potentially confusion. Fixes #99907
2022-08-02Rollup merge of #100011 - compiler-errors:let-chain-restriction, r=fee1-deadMatthias Krüger-248/+332
Use Parser's `restrictions` instead of `let_expr_allowed` This also means that the `ALLOW_LET` flag is reset properly for subexpressions, so we can properly deny things like `a && (b && let c = d)`. Also the parser is a tiny bit smaller now. It doesn't reject _all_ bad `let` expr usages, just a bit more. cc `@c410-f3r`
2022-08-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-8/+35
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
2022-08-02Properly reject the `may_unwind` option in `global_asm!`Amanieu d'Antras-36/+36
This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
2022-08-01Auto merge of #95884 - cjgillot:assoc-item, r=lcnrbors-31/+47
Thin `AssocItem` This PR removes a few fields from `AssocItem` that should be easily computed using other queries. This simplifies some of the metadata decoding.