about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-05Rollup merge of #103994 - clubby789:break-unlabeled, r=TaKO8KiDylan DPC-27/+27
Specify that `break` cannot be used outside of loop *or* labeled block Closes #103981 `@rustbot` label +A-diagnostics
2022-11-05Rollup merge of #103867 - compiler-errors:no-has-errors, r=cjgillotDylan DPC-5/+19
Remove `has_errors` from `FnCtxt` It doesn't seem like this `has_errors` flag actually suppresses any errors (at least in the UI test suite) --- except for one test (`E0767.rs`), and I think that error really should be considered legitimate, since it has nothing to do with the error code and continues to exist after you fix the first error... This flag was added by ```@eddyb``` in 6b3cc0b8c8094407a3b5ea75f946c682d6d0142a, and it's likely that it was made redundant due to subsequent restructuring of the compiler. It only affects block type-checking anyways, so its effect does seem limited these days anyway.
2022-11-05Rollup merge of #103621 - fee1-dead-contrib:iat-fix-use, r=cjgillotDylan DPC-71/+50
Correctly resolve Inherent Associated Types I don't know if this is the best way to do this, but at least it is one way.
2022-11-05Auto merge of #103991 - matthiaskrgr:rollup-tj53nte, r=matthiaskrgrbors-7/+9
Rollup of 7 pull requests Successful merges: - #103868 (Use `TraitEngine` (by itself) less) - #103878 (Fix artifact version/channel detection for stable) - #103946 (Cleanup bind_pattern args) - #103956 (Make mir opt unused file check blessable) - #103977 (LLVM 16: Switch to using MemoryEffects) - #103980 (rustdoc: simplify search results CSS and DOM) - #103984 (Refactor tcx mk_const parameters.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-05Specify that `break` cannot be used outside of loop *or* labeled blockclubby789-27/+27
2022-11-05Rollup merge of #103980 - notriddle:notriddle/search-results, r=GuillaumeGomezMatthias Krüger-5/+5
rustdoc: simplify search results CSS and DOM Preview: http://notriddle.com/notriddle-rustdoc-demos/search-results/std/index.html?search=vec There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it. ## Before ![image](https://user-images.githubusercontent.com/1593513/200060877-05ae4135-db8d-4d24-8dfa-4c06b8ef671c.png) ## After ![image](https://user-images.githubusercontent.com/1593513/200061474-b0ea9e8d-72c3-401f-9106-072307d9e2ff.png)
2022-11-05Rollup merge of #103977 - TimNN:memory-effects, r=nikicMatthias Krüger-2/+4
LLVM 16: Switch to using MemoryEffects This adapts the compiler to the changes required by https://github.com/llvm/llvm-project/commit/304f1d59ca41872c094def3aee0a8689df6aa398. AFAICT, `WriteOnly` isn't used by the compiler, all `ReadNone` uses were migrated and the remaining use of `ReadOnly` is only for function parameters. To simplify the FFI, this PR uses an enum to represent `MemoryEffects` across the FFI boundary, which then gets mapped to the matching static factory method when constructing the attribute. Fixes #103961. `@rustbot` label +llvm-main r? `@nikic`
2022-11-04Auto merge of #103298 - ferrocene:pa-compile-flags-last, r=jyn514bors-0/+9
Ensure that compile-flags arguments are the last in UI tests Before this PR, compiletest would add `-L path/to/aux` at the end of the rustc flags, even after the custom ones set with the compile-flags header comment. This made it impossible to check how rustc would behave when a flag requiring an argument was passed without the argument, because the argument would become `-L`. This PR fixes that by adding the `-L path/to/aux` before the arguments defined in compile-flags, at least for UI tests. Other test suites might either be fixed as well by this change, or still present the old behavior (`-L` is now always passed before, but other tests suites might add additional flags after the custom ones).
2022-11-04rustdoc: get rid of CSS/DOM `div.desc span`, which isn't really neededMichael Howell-4/+4
2022-11-04rustdoc: simplify search results CSS and DOMMichael Howell-1/+1
There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it.
2022-11-04LLVM 16: Switch to using MemoryEffectsTim Neumann-2/+4
2022-11-04Rollup merge of #103964 - clubby789:lint-enclosing-unsafe, r=compiler-errorsMatthias Krüger-0/+50
Give a specific lint for unsafety not being inherited In cases like ```rs static mut FOO: u64 = 0; fn main() { unsafe {static BAR: u64 = FOO;} } ``` and ```rs fn foo() { unsafe { fn bar() { unsafe_call(); } } } ``` Specifically inform the user that the unsafety is not inherited for the seperate enclosing items Fixes #94077 r? compiler-errors `@rustbot` label +A-diagnostics
2022-11-04Rollup merge of #103897 - Amanieu:llvm-58384, r=davidtwcoMatthias Krüger-0/+16
asm: Work around LLVM bug on AArch64 Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
2022-11-04Rollup merge of #103681 - RalfJung:libtest-thread, r=thomccMatthias Krüger-5/+5
libtest: run all tests in their own thread, if supported by the host This reverts the threading changes of https://github.com/rust-lang/rust/pull/56243, which made it so that with `-j1`, the test harness does not spawn any threads. Those changes were done to enable Miri to run the test harness, but Miri supports threads nowadays, so this is no longer needed. Using a thread for each test is useful because the thread's name can be set to the test's name which makes panic messages consistent between `-j1` and `-j2` runs and also a bit more readable. I did not revert the HashMap changes of https://github.com/rust-lang/rust/pull/56243; using a deterministic map seems fine for the test harness and the more deterministic testing is the better. Fixes https://github.com/rust-lang/rust/issues/59122 Fixes https://github.com/rust-lang/rust/issues/70492
2022-11-04Rollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwcoMatthias Krüger-6/+6
Port `dead_code` lints to be translatable. This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`. r? `@davidtwco`
2022-11-04Formatting changes + add UI testclubby789-0/+50
2022-11-04Rollup merge of #103950 - nbdd0121:master, r=tmiaskoMatthias Krüger-0/+12
Fix ICE when negative impl is collected during eager mono ```rust trait Foo { fn foo() {} } impl !Foo for () {} ``` This code will currently cause an ICE when mono collection mode is "eager" (with `-C link-dead-code=y` or `-Z print-mono-items=eager`.
2022-11-04Rollup merge of #103780 - compiler-errors:bound-closure-lifetimes, r=jackh726Matthias Krüger-0/+63
Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck During HIR typeck, we need to teach astconv to treat late-bound regions within a closure body as free, fixing escaping bound vars ICEs in both of the issues below. However, this then gets us to MIR borrowck, which itself needs to be taught how to instantiate free region vids for late-bound regions that come from items that _aren't_ the typeck root (for now, just closures). Fixes #103771 Fixes #103736
2022-11-04Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, ↵Matthias Krüger-0/+18
r=GuillaumeGomez rustdoc: clean up hardcoded CSS border color on search results Hardcoded colors in rustdoc.css should usually be avoided. Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
2022-11-04Rollup merge of #103930 - fee1-dead-contrib:mv-from-root, r=jyn514Matthias Krüger-7/+7
Move some tests from `src/test/ui` to more reasonable places
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-0/+14
Properly render asyncness for trait fns without default body We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl). cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04Fix ICE when negative impl is collected during eager monoGary Guo-0/+12
2022-11-03rustdoc: clean up hardcoded CSS border color on search resultsMichael Howell-0/+18
Hardcoded colors in rustdoc.css should usually be avoided.
2022-11-03Move some tests from `src/test/ui` to more reasonable placesDeadbeef-7/+7
2022-11-03Elaborate supertrait obligations when deducing closure signatureMichael Goulet-28/+30
2022-11-03roll another resolution logic in rustdocDeadbeef-19/+1
2022-11-03Correctly resolve Inherent Associated TypesDeadbeef-52/+49
2022-11-03move compiletest's own ui tests into a subdirectoryPietro Albini-0/+0
2022-11-03check for pattern in compiletest-compile-flags-lastPietro Albini-0/+1
2022-11-03Auto merge of #103904 - JakobDegen:mir-opt-dash, r=oli-obkbors-3259/+3259
Ban dashes in miropt test file names Dashes in miropt test file names are annoying - specifically, they cause the test files to not be sorted next to their outputs, which makes it very difficult to tell what goes with what. This PR changes all files to use underscores and adds a blessable tidy check that enforces this. r? `@jyn514` This PR is obviously going to bitrot very quickly. Because of this, I'm going to wait at least 48 hours and until review comes back to allow people from `@rust-lang/wg-mir-opt` or elsewhere to lodge complaints if there are any. If not, I'll rebase the branch on Friday afternoon PST and ask that it be `r+`'d with `p=1` at that time.
2022-11-02Ban dashes in miropt test file namesJakob Degen-3259/+3259
2022-11-02Rollup merge of #103886 - GuillaumeGomez:local-reexport-doc, r=notriddleMatthias Krüger-0/+16
rustdoc: Fix merge of attributes for reexports of local items Fixes https://github.com/rust-lang/rust/issues/84619. The problem was that we didn't merge attributes between the the reexport and the item. r? `@notriddle`
2022-11-02Rollup merge of #103870 - TaKO8Ki:fix-103790, r=fee1-deadMatthias Krüger-0/+75
Fix `inferred_kind` ICE Fixes #103790
2022-11-02Rollup merge of #99801 - ↵Matthias Krüger-0/+33
Neo-Zhixing:fix/generic_const_exprs_parent_opaque_predicates, r=oli-obk fix(generic_const_exprs): Fix predicate inheritance for children of opaque types Fixes #99705 We currently have a special case to perform predicate inheritance when the const item is in the generics. I think we're also going to need this for opaque return types. When evaluating the predicates applied to the associated item, it'll inherit from its parent, the opaque type, which will never have predicates applied. This PR bypass the opaque typed parent and inherit predicates directly from the function itself.
2022-11-02asm: Work around LLVM bug on AArch64Amanieu d'Antras-0/+16
Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
2022-11-02Properly render asyncness for traits without default bodyMichael Goulet-0/+14
2022-11-02Rollup merge of #103774 - compiler-errors:dyn-trait-in-type-name, r=eholkDylan DPC-4/+1
Format `dyn Trait` better in `type_name` intrinsic Noticed this in #103764 (though not related to that PR at all!) ```rust trait Foo { type Bar; } fn main() { println!( "`dyn Fn(i32, i32) -> i32` => `{}`", std::any::type_name::<dyn Fn(i32, i32) -> i32>() ); println!( "`dyn Foo<Bar = i32> + Send + Sync` => `{}`", std::any::type_name::<dyn Foo<Bar = i32> + Send + Sync>() ); } ``` ``` `dyn Fn(i32, i32) -> i32` => `dyn core::ops::function::Fn<(i32, i32)>+Output = i32` `dyn Foo<Bar = i32> + Send + Sync` => `dyn playground::Foo+Bar = i32+core::marker::Sync+core::marker::Send` ``` Just reuse `pretty_print_dyn_existential` which already makes an attempt to make its output stable.
2022-11-02Remove has_errors from FnCtxtMichael Goulet-5/+19
2022-11-02Add regression test for doc of reexport of local itemsGuillaume Gomez-0/+16
2022-11-02Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomezbors-0/+12
rustdoc: Do not add external traits to the crate in `register_res` It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits. Fixes https://github.com/rust-lang/rust/issues/103463
2022-11-02return const_error when ty has errorsTakayuki Maeda-0/+75
2022-11-01Rollup merge of #103839 - Nilstrieb:print-list, r=compiler-errorsManish Goregaokar-0/+6
Print valid `--print` requests if request is invalid When someone makes a typo, it can be useful to see the valid options. This is also useful if someone wants to find out about all the options.
2022-11-01Rollup merge of #103837 - ↵Manish Goregaokar-225/+162
GuillaumeGomez:migrate-sidebar-links-color-gui-test, r=notriddle Migrate sidebar-links-color GUI test to functions r? `@notriddle`
2022-11-01Rollup merge of #103781 - JakobDegen:mir-opt-tidy, r=jyn514Manish Goregaokar-404/+0
Detect unused files in `src/test/mir-opt` and error on them in tidy. Closes #97564 . Determining which files are generated by a given mir opt test is somewhat difficult. Because of this, we extract the logic for doing it out into a common crate that both compiletest and tidy can depend on. This avoids making compiletest a dependency of tidy which would negatively impact compile times for tidy. Testing for this is that it catches 5 files that violated this lint (and removes them).
2022-11-01Rollup merge of #103575 - Xiretza:suggestions-style-attr, r=davidtwcoManish Goregaokar-78/+229
Change #[suggestion_*] attributes to use style="..." As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20tool_only_span_suggestion), this changes `#[(multipart_)suggestion_{short,verbose,hidden}(...)]` attributes to plain `#[(multipart_)suggestion(...)]` attributes with a `style = "{short,verbose,hidden}"` parameter. It also adds a new style, `tool-only`, that corresponds to `tool_only_span_suggestion`/`tool_only_multipart_suggestion` and causes the suggestion to not be shown in human-readable output at all. Best reviewed commit-by-commit, there's a bit of noise in there. cc #100717 `@compiler-errors` r? `@davidtwco`
2022-11-01fix(generic_const_exprs): Fix predicate inheritance for children of opaque typesZhixing Zhang-0/+33
2022-11-01Auto merge of #103217 - mejrs:track, r=eholkbors-0/+180
Track where diagnostics were created. This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`. For example, the following code... ```rust struct A; struct B; fn main(){ let _: A = B; } ``` ...now emits the following error message: ``` error[E0308]: mismatched types --> src\main.rs:5:16 | 5 | let _: A = B; | - ^ expected struct `A`, found struct `B` | | | expected due to this -Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31 ```
2022-11-01Format dyn Trait better in type_name intrinsicMichael Goulet-4/+1
2022-11-01Remove unneeded "rustdoc-preferred-dark-theme" settingGuillaume Gomez-1/+0
2022-11-01Migrate sidebar-links-color GUI test to functionsGuillaume Gomez-224/+162