about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-06Auto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgrbors-6/+189
Rollup of 7 pull requests Successful merges: - #103012 (Suggest use .. to fill in the rest of the fields of Struct) - #103851 (Fix json flag in bootstrap doc) - #103990 (rustdoc: clean up `.logo-container` layout CSS) - #104002 (fix a comment in UnsafeCell::new) - #104014 (Migrate test-arrow to CSS variables) - #104016 (Add internal descriptions to a few queries) - #104035 (Add 'closure match' test to weird-exprs.rs.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-06Rollup merge of #104035 - m-ou-se:weird-expr-closure-match, r=compiler-errorsMatthias Krüger-0/+11
Add 'closure match' test to weird-exprs.rs. Having fun with patterns that look like closures.
2022-11-06Rollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddleMatthias Krüger-4/+51
Migrate test-arrow to CSS variables There should be no UI changes. I kept both `color` and `background-color` properties even though only the ayu theme is actually completely making use of them on hover. r? ``@notriddle``
2022-11-06Rollup merge of #103990 - notriddle:notriddle/logo-container, r=GuillaumeGomezMatthias Krüger-2/+57
rustdoc: clean up `.logo-container` layout CSS This commit should result in no appearance changes. To make the logo container exactly the desired height, you want to get rid of the part of the box used for typographic descenders (you know, the part of g, y, and j that descends below the baseline). After all, it contains no text, but the space is still left open in the layout by default, because `<img>` is `display:inline`. The CSS used to employ three different tricks to accomplish this: * By making `.sidebar .logo-container` a flex container, the image becomes a flex item and is [blockified], without synthesizing any inline boxes. No inline boxes means no descenders. * By giving `.mobile-topbar .logo-container` a max-height exactly the same as the height of the image plus the padding, the descender area gets cut off. * By setting `.sub-logo-container { line-height: 0 }`, we ensure that the only box that contributes to the height of the line box is the image itself, and not any zero-content text boxes that neighbor it. See the [logical height algorithm]. This commit gets rid of the first two hacks, leaving only the third, since it requires only one line of code to accomplish and doesn't require setting the value based on math. [blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items [logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height
2022-11-06Rollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errorsMatthias Krüger-0/+70
Suggest use .. to fill in the rest of the fields of Struct Fixes #102806
2022-11-06Auto merge of #102618 - aliemjay:simplify-closure-promote, r=compiler-errorsbors-91/+70
rework applying closure requirements in borrowck Previously the promoted closure constraints were registered under the category `ConstraintCategory::ClosureBounds` in `type_check::prove_closure_bounds()` and then mapped back their original category in `regions_infer::best_blame_constraint` using the complicated map `closure_bounds_mapping`. Now we're registering promoted constraints under their original category and span earlier in `type_check::prove_closure_bounds`. See commit messages. Fixes #99245
2022-11-06Add more nonsense to weird-exprs.rs.Mara Bos-0/+11
2022-11-05rustdoc: add test case for huge logoMichael Howell-2/+57
2022-11-05Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obkbors-45/+6
Stabilize the `instruction_set` feature Closes https://github.com/rust-lang/rust/issues/74727 FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253 r? `@pnkfelix` and/or `@nikomatsakis` cc `@xd009642` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-11-05Rollup merge of #103988 - GuillaumeGomez:fix-bottom-border-color, r=notriddleMatthias Krüger-3/+3
Fix search result bottom border color It reverts a color change while keeping the improvement made in #103938. I think it'll need to be backported once merged too. r? `@notriddle`
2022-11-05Rollup merge of #103927 - ↵Matthias Krüger-0/+30
fee1-dead-contrib:E0425-no-typo-when-pattern-matching, r=cjgillot Do not make typo suggestions when suggesting pattern matching Fixes #103909.
2022-11-05Rollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomezMatthias Krüger-14/+14
rustdoc: add hash to filename of toolchain files All static files used by rustdoc are now stored in static.files/ and their filenames include a hash of their contents. Their filenames no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL. Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix. This has a useful side effect: once toolchain files aren't affected by resource suffix, it will become possible for docs.rs to include crate version in the resource suffix. That should fix a caching issue with `/latest/` URLs: https://github.com/rust-lang/docs.rs/issues/1593. My goal is that it should be safe to serve all rustdoc JS, CSS, and fonts with infinite caching headers, even when new versions of a crate are uploaded in the same place as old versions. The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration. Example listing: ``` $ cd build/x86_64-unknown-linux-gnu/doc/ && find . | egrep 'js$|css$' | egrep -v 'sidebar-items|implementors' | sort ./crates1.65.0.js ./rust.css ./search-index1.65.0.js ./source-files1.65.0.js ./static.files/ayu-2bfd0af01c176fd5.css ./static.files/dark-95d11b5416841799.css ./static.files/light-c83a97e93a11f15a.css ./static.files/main-efc63f77fb116394.js ./static.files/normalize-76eba96aa4d2e634.css ./static.files/noscript-5bf457055038775c.css ./static.files/rustdoc-7a422337900fa894.css ./static.files/scrape-examples-3dd10048bcead3a4.js ./static.files/search-47f3c289722672cf.js ./static.files/settings-17b08337296ac774.js ./static.files/settings-3f95eacb845293c0.css ./static.files/source-script-215e9db86679192e.js ./static.files/storage-26d846fcae82ff09.js ``` Fixes #98413
2022-11-05Extend GUI test for run buttonGuillaume Gomez-4/+51
2022-11-05Update GUI test for bottom border colorGuillaume Gomez-3/+3
2022-11-05Do not make typo suggestions when suggesting pattern matchingDeadbeef-0/+30
Fixes #103909.
2022-11-05Auto merge of #103831 - chenyukang:yukang/fix-103751-ice, r=nagisabors-0/+53
Fix capacity overflow issue during transmutability check Fixes #103751
2022-11-05Auto merge of #103691 - ↵bors-29/+29
michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo-names, r=wesleywiser [debuginfo] Make cpp-like debuginfo type names for slices and str consistent. Before this PR, the compiler would emit the debuginfo name `slice$<T>` for all kinds of slices, regardless of whether they are behind a reference or not and regardless of the kind of reference. As a consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>` would end up with the same type name `Foo<slice$<T> >` in debuginfo, making it impossible to disambiguate between them by name. Similarly, `&str` would get the name `str` in debuginfo, so the debuginfo name for `Foo<str>` and `Foo<&str>` would be the same. In contrast, `*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >` and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose information about the type. This PR removes all special handling for slices and `str`. The types `&[bool]`, `&mut [bool]`, and `&str` thus get the names `ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and `ref$<str$>` respectively -- as one would expect. The new special name for slices is `slice2$` to differentiate it from the previous name `slice$`, which has different semantics. The same is true for `str` and `str$`. This kind of versioning already has a precedent with the case of `enum$` and `enum2$` and hopefully will make it easier to transition existing consumers of these names. cc `@rust-lang/wg-debugging` `@vadimcn` r? `@wesleywiser` UPDATE: Here is a table to clarify the changes | Rust type | DWARF name | C++-like name (before) | C++-like name (after) | |-----------|------------|------------------------|------------------------| | `[T]` | `[T]` | `slice$<T>` | `slice2$<T>` | | `&[T]` | `&[T]` | `slice$<T>` | `ref$<slice2$<T> >` | | `&mut [T]` | `&mut [T]` | `slice$<T>` | `ref_mut$<slice2$<T> >`| | `str` | `str` | `str` | `str$` | | `&str` | `&str` | `str` | `ref$<str$>` | | `&mut str` | `&mut str` | `str` | `ref_mut$<str$>`| | `*const [T]` | `*const [T]` | `ptr_const$<slice$<T> >` | `ptr_const$<slice2$<T> >` | | `*mut [T]` | `*mut [T]` | `ptr_mut$<slice$<T> >` | `ptr_mut$<slice2$<T> >` | As you can see, before the PR many types would end up with the same name, making it impossible to distinguish between them in NatVis or other places where types are matched or looked up by name. The DWARF version of names is not changed.
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-05use spans in TypeTest rather than mir::LocationAli MJ Al-Nasrawy-89/+65
Spans are independent of the body being borrow-checked, so they don't need remapping when promoting type-tests and they yield more specific error spans inside bodies of closures/inline consts.
2022-11-05simplify applying closure requirementsAli MJ Al-Nasrawy-2/+5
Don't use `ConstraintCategory::ClosureBounds`! Set the category and the span for the promoted constraints to that of the original constraint earlier than before. This eliminates the need for `closure_bounds_mapping`.
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-04fake a base to suppress later extra error messageyukang-24/+21
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-04fix #102806, suggest use .. to fill in the rest of the fields of Structyukang-0/+73
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