about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-07Modify comment syntax errorwanghaha-dev-1/+1
2022-11-07return `None` when def_kind is `DefKind::Use`Takayuki Maeda-0/+16
2022-11-07Rollup merge of #104065 - GuillaumeGomez:css-migrate-logo-filter, r=notriddleYuki Okushi-0/+9
Migrate rust logo filter to CSS variables
2022-11-07Rollup merge of #103914 - nnethercote:close-42326, r=petrochenkovYuki Okushi-9/+21
Make underscore_literal_suffix a hard error. It's been a warning for 5.5 years. Time to make it a hard error. Closes #42326. r? ``@pnkfelix``
2022-11-07Rollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, ↵Yuki Okushi-4/+57
r=cjgillot,GuillaumeGomez rustdoc: various cross-crate reexport fixes Fixes for various smaller cross-crate reexport issues. The PR is split into several commits for easier review. Will be squashed after approval. Most notable changes: * We finally render late-bound lifetimes in the generic parameter list of cross-crate functions & methods. Previously, we would display the re-export of `pub fn f<'s>(x: &'s str) {}` as `pub fn f(x: &'s str)` * We now render unnamed parameters of cross-crate functions and function pointers as underscores since that's exactly what we do for local definitions, too. Mentioned as a bug in #44306. * From now on, the rendering of cross-crate trait-object types is more correct: * `for<>` parameter lists (for higher-ranked lifetimes) are now shown * the return type of `Fn{,Mut,Once}` trait bounds is now displayed Regarding the last list item, here is a diff for visualization (before vs. after): ```patch - dyn FnOnce(&'any str) + 'static + dyn for<'any> FnOnce(&'any str) -> bool + 'static ``` The redundant `+ 'static` will be removed in a follow-up PR that will hide trait-object lifetime-bounds if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) (see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097)). `FIXME(fmease)`s were added. ``@rustbot`` label A-cross-crate-reexports r? ``@GuillaumeGomez``
2022-11-06Use aapcs for efiapi calling convention on armNicholas Bishop-1/+1
On arm, llvm treats the C calling convention as `aapcs` on soft-float targets and `aapcs-vfp` on hard-float targets [1]. UEFI specifies in the arm calling convention that floating point extensions aren't used [2], so always translate `efiapi` to `aapcs` on arm. [1]: https://github.com/rust-lang/compiler-builtins/issues/116#issuecomment-261057422 [2]: https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention https://github.com/rust-lang/rust/issues/65815
2022-11-07Make underscore_literal_suffix a hard error.Nicholas Nethercote-9/+21
It's been a warning for 5.5 years. Time to make it a hard error. Closes #42326.
2022-11-06Limit efiapi calling convention to supported archesNicholas Bishop-99/+127
Supported architectures in UEFI are described here: https://uefi.org/specs/UEFI/2.10/02_Overview.html#calling-conventions Changes to tests modeled on 8240e7aa101815e2009c7d03b33dd2566d843e73. https://github.com/rust-lang/rust/issues/65815
2022-11-06Add a codegen test for rust-lang/rust#96152Ben Kimock-0/+37
2022-11-06Extend rust-logo GUI test to check there is no filter for other logosGuillaume Gomez-0/+9
2022-11-06Auto merge of #99943 - compiler-errors:tuple-trait, r=jackh726bors-193/+320
Implement `std::marker::Tuple`, use it in `extern "rust-call"` and `Fn`-family traits Implements rust-lang/compiler-team#537 I made a few opinionated decisions in this implementation, specifically: 1. Enforcing `extern "rust-call"` on fn items during wfcheck, 2. Enforcing this for all functions (not just ones that have bodies), 3. Gating this `Tuple` marker trait behind its own feature, instead of grouping it into (e.g.) `unboxed_closures`. Still needing to be done: 1. Enforce that `extern "rust-call"` `fn`-ptrs are well-formed only if they have 1/2 args and the second one implements `Tuple`. (Doing this would fix ICE in #66696.) 2. Deny all explicit/user `impl`s of the `Tuple` trait, kinda like `Sized`. 3. Fixing `Tuple` trait built-in impl for chalk, so that chalkification tests are un-broken. Open questions: 1. Does this need t-lang or t-libs signoff? Fixes #99820
2022-11-06make uninit_mask a unit testRalf Jung-28/+0
2022-11-06fixyfixfixBoxy-24/+54
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-06Normalize signature when deducing closure signature from supertraitsMichael Goulet-0/+17
2022-11-06Add more nonsense to weird-exprs.rs.Mara Bos-0/+11
2022-11-05Rebase and update testclubby789-1/+1
2022-11-05Update UI testclubby789-2/+2
2022-11-05Split non-fixable case to different testclubby789-11/+38
2022-11-05Attempt to fix arguments of associated functionsclubby789-56/+69
2022-11-05Use `FmtPrinter` instead of creating `Instance`clubby789-5/+115
2022-11-05Update UI testclubby789-1/+1
2022-11-05rustdoc: add test case for huge logoMichael Howell-2/+57
2022-11-05Fix unused_must_use warning for Box::from_rawAnett Seeker-1/+1
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-05Bless more testsMichael Goulet-15/+11
2022-11-05Merge conflicts and rebase onto masterMichael Goulet-27/+26
2022-11-05Bless chalk testsMichael Goulet-12/+42
2022-11-05Adjust diagnostics, bless testsMichael Goulet-148/+250
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-05Move some tests to more reasonable directoriesCaio-0/+0
2022-11-05privacy: Print effective visibilities of constructorsVadim Petrochenkov-16/+30
2022-11-05resolve: More detailed effective visibility tracking for importsVadim Petrochenkov-2/+49
Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.
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`.