about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-06-22Rollup merge of #86297 - GuillaumeGomez:rustdoc-gui-args, r=Mark-SimulacrumYuki Okushi-0/+12
Allow to pass arguments to rustdoc-gui tool Very convenient for testing. This is another part of https://github.com/rust-lang/rust/pull/86293 cc ``@jsha`` r? ``@Mark-Simulacrum``
2021-06-21Auto merge of #86515 - JohnTitor:rollup-axzb4xh, r=JohnTitorbors-16/+192
Rollup of 9 pull requests Successful merges: - #86192 (Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint) - #86248 (Add a regression test for issue-85113) - #86274 (Spaces) - #86349 (Add regression test for issue #78632) - #86424 (rustfmt: load nested out-of-line mods correctly) - #86472 (Fix CI to fetch master on beta channel) - #86473 (Rustdoc: Account for const-unstable functions) - #86495 (Improve `proc_macro::{Punct, Spacing}` documentation) - #86503 (Fix rust.css fonts.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-22Rollup merge of #86473 - fee1-dead:rustdoc-const-unstable, r=jyn514Yuki Okushi-4/+22
Rustdoc: Account for const-unstable functions Fixes #86464
2021-06-22Rollup merge of #86349 - yerke:add-test-for-issue-78632, r=Mark-SimulacrumYuki Okushi-0/+59
Add regression test for issue #78632 Add regression test for issue #78632 Closes #78632 Took this test from #78632 (what was committed to glacier in https://github.com/rust-lang/rust/issues/78632#issuecomment-731843345). Tested that the we get ICE on 1.52.1 on the playground (https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b86d51fee4cded9d24b50d8ecbc48c6a).
2021-06-22Rollup merge of #86248 - JohnTitor:issue-85113, r=Mark-SimulacrumYuki Okushi-0/+70
Add a regression test for issue-85113 Fixed by #86118, closes #85113
2021-06-22Rollup merge of #86192 - hi-rustin:rustin-patch-lint, r=nikomatsakisYuki Okushi-12/+41
Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint close https://github.com/rust-lang/rust/issues/84869 r? `@nikomatsakis`
2021-06-21Readd `unsafe` keyword in testsDeadbeef-6/+6
2021-06-21Auto merge of #86210 - ehuss:rustfix-update, r=Mark-Simulacrumbors-9/+11
Rustfix update This updates to rustfix 0.6.0. One of the key changes here is https://github.com/rust-lang/rustfix/pull/195 which changes rustfix to apply multi-part suggestions. One of the tests needs to updated because there are some overlapping suggestions which rustfix cannot handle. The solution is to only apply the machine-applicable suggestions to avoid the overlapping issue. This also includes a minor change to compiletest to provide better error messages with rustfix.
2021-06-21Removed/Updated some cases and simplified `match`Deadbeef-28/+3
2021-06-21Added some tests for `unsafe` in const-dispay.rsDeadbeef-6/+47
2021-06-21Check for const_unstable before printing `const`Deadbeef-4/+4
2021-06-21Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisabors-2/+2
Do not emit alloca for ZST locals with multiple assignments This extends 35566bfd7dd2e316d190078703de54a4dadda062 to additionally stop emitting unnecessary allocas for zero sized locals that are assigned multiple times. When rebuilding the standard library with `-Zbuild-std` this reduces the number of locals that require an allocation from 62315 to 61767.
2021-06-21Auto merge of #86502 - JohnTitor:rollup-wge0f3x, r=JohnTitorbors-2/+52
Rollup of 8 pull requests Successful merges: - #83739 (Account for bad placeholder errors on consts/statics with trait objects) - #85637 (document PartialEq, PartialOrd, Ord requirements more explicitly) - #86152 (Lazify is_really_default condition in the RustdocGUI bootstrap step) - #86156 (Fix a bug in the linkchecker) - #86427 (Updated release note) - #86452 (fix panic-safety in specialized Zip::next_back) - #86484 (Do not set depth to 0 in fully_expand_fragment) - #86491 (expand: Move some more derive logic to rustc_builtin_macros) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-21Rollup merge of #86484 - fee1-dead:builtin-macro-recursion, r=petrochenkovYuki Okushi-0/+30
Do not set depth to 0 in fully_expand_fragment Fixes #84632.
2021-06-21Rollup merge of #83739 - JohnTitor:issue-75889, r=estebankYuki Okushi-2/+22
Account for bad placeholder errors on consts/statics with trait objects Fixes #75889 r? ``@estebank``
2021-06-20Update rustfix for compiletest.Eric Huss-9/+11
2021-06-20Auto merge of #85980 - ssomers:btree_cleanup_LeafRange, r=Mark-Simulacrumbors-35/+148
BTree: encapsulate LeafRange better & some debug asserts Looking at iterators again, I think #81937 didn't house enough code in `LeafRange`. Moving the API boundary a little makes things more local in navigate.rs and less complicated in map.rs. r? `@Mark-Simulacrum`
2021-06-20Auto merge of #85538 - r00ster91:iterrepeat, r=Mark-Simulacrumbors-3/+1
Replace some `std::iter::repeat` with `str::repeat` I noticed that there were some instances where `std::iter::repeat` would be used to repeat a string or a char to take a specific count of it and then collect it into a `String` when `str::repeat` is actually much faster and better for that. See also: https://github.com/rust-lang/rust-clippy/issues/7260.
2021-06-21Do not set depth to 0 in fully_expand_fragmentDeadbeef-0/+30
2021-06-20Auto merge of #86468 - GuillaumeGomez:update-browser-ui-test-version, r=jshabors-100/+100
Update browser-ui-test version It greatly improves the test readability (thanks to `@jsha` for the suggestions!). r? `@jsha`
2021-06-20"(const: unstable)" for stable-but-const-unstableDeadbeef-0/+2
2021-06-19Auto merge of #86460 - JohnTitor:use-static-in-pattern-err, r=oli-obkbors-49/+46
Refactor `PatternError` structure Now we emit the `StaticInPattern` error precisely. Fixes #68395 r? `@oli-obk`
2021-06-19Auto merge of #86034 - nagisa:nagisa/rt-soundness, r=m-ou-sebors-0/+30
Change entry point to 🛡️ against 💥 💥-payloads Guard against panic payloads panicking within entrypoints, where it is UB to do so. Note that there are a number of tradeoffs to consider. For instance, I considered guarding against accidental panics inside the `rt::init` and `rt::cleanup` code as well, as it is not all that obvious these may not panic, but doing so would mean that we initialize certain thread-local slots unconditionally, which has its own problems. Fixes #86030 r? `@m-ou-se`
2021-06-19Update browser-ui-test versionGuillaume Gomez-100/+100
2021-06-19Change entry point to 🛡️ against 💥 💥-payloadsSimonas Kazlauskas-0/+30
Guard against panic payloads panicking within entrypoints, where it is UB to do so. Note that there are a number of implementation approaches to consider. Some simpler, some more complicated. This particular solution is nice in that it also guards against accidental implementation issues in various pieces of runtime code, something we cannot prevent statically right now. Fixes #86030
2021-06-19Auto merge of #86426 - hi-rustin:rustin-patch-lint-warn, r=Aaron1011bors-20/+97
Lint for unused borrows as part of UNUSED_MUST_USE close https://github.com/rust-lang/rust/issues/76264 base on https://github.com/rust-lang/rust/pull/76894 r? `@RalfJung`
2021-06-19Refactor `PatternError` structureYuki Okushi-49/+46
2021-06-19Auto merge of #86456 - JohnTitor:rollup-jjzupny, r=JohnTitorbors-0/+40
Rollup of 9 pull requests Successful merges: - #86136 (Stabilize span_open() and span_close().) - #86359 (Use as_secs_f64 in JunitFormatter) - #86370 (Fix rustdoc stabilized versions layout) - #86397 (Alter std::cell::Cell::get_mut documentation) - #86407 (Use `map_or` instead of open-coding it) - #86425 (Update rustversion to 1.0.5) - #86440 (Update library tracking issue for libs-api rename.) - #86444 (Fix ICE with `#[repr(simd)]` on enum) - #86453 (stdlib: Fix typo in internal RefCell docs ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-18Fix ICE with `#[repr(simd)]` on enumFabian Wolff-0/+40
2021-06-18improve test by using intrinsic directlyRalf Jung-54/+26
2021-06-18bless youRalf Jung-836/+340
2021-06-18Auto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, ↵bors-0/+44
r=jyn514 fix rustdoc stack overflow on mutually recursive Deref fix #85095 fix #85037
2021-06-18Lint for unused borrows as part of UNUSED_MUST_USEhi-rustin-20/+97
2021-06-17Rollup merge of #86401 - FabianWolff:issue-83512, r=LeSeulArtichautMara Bos-1/+15
Fix ICE when using `#[doc(keyword = "...")]` on non-items This pull request fixes #83512. The code for checking attributes calls `expect_item()` when it shouldn't, thus causing an ICE. I have implemented a proper check for the node kind, so that an error is reported instead of the ICE.
2021-06-17Move regression test for #83512 into doc_keyword.rsFabian Wolff-19/+15
2021-06-17Auto merge of #86399 - JohnTitor:rollup-qlm2dvz, r=JohnTitorbors-123/+125
Rollup of 7 pull requests Successful merges: - #85663 (Document Arc::from) - #85802 (Rename IoSlice(Mut)::advance to advance_slice and add IoSlice(Mut)::advance) - #85970 (Remove methods under Implementors on trait pages) - #86340 (Use better error message for hard errors in CTFE) - #86343 (Do not emit invalid suggestions on multiple mutable borrow errors) - #86355 (Remove invalid suggestions for assoc consts on placeholder type error) - #86389 (Make `sum()` and `product()` documentation hyperlinks refer to `Iterator` methods.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-17Fix ICE when using `#[doc(keyword = "...")]` on non-itemsFabian Wolff-0/+18
2021-06-17Rollup merge of #86355 - JohnTitor:issue-82158, r=estebankYuki Okushi-0/+35
Remove invalid suggestions for assoc consts on placeholder type error Fixes #82158 This also moves some tests to typeck. r? ``@estebank``
2021-06-17Rollup merge of #86343 - JohnTitor:issue-85581, r=estebankYuki Okushi-0/+32
Do not emit invalid suggestions on multiple mutable borrow errors Fixes #85581
2021-06-17Rollup merge of #86340 - Smittyvb:ctfe-hard-error-message, r=RalfJungYuki Okushi-88/+54
Use better error message for hard errors in CTFE I noticed this while working on #86255: currently the same message is used for hard errors and soft errors in CTFE. This changes the error messages to make hard errors use a message that indicates the reality of the situation correctly, since usage of the constant is never allowed when there was a hard error evaluating it. This doesn't affect the behaviour of these error messages, only the content. This changes the error logic to check if the error should be hard or soft where it is generated, instead of where it is emitted, to allow this distinction in error messages.
2021-06-17Rollup merge of #85970 - jsha:remove-methods-implementors, r=GuillaumeGomezYuki Okushi-35/+4
Remove methods under Implementors on trait pages As discussed at https://github.com/rust-lang/rust/issues/84326#issuecomment-842652412. On a trait page, the "Implementors" section currently lists all methods of each implementor. That duplicates the method definitions on the trait itself, and is usually not very useful. So the implementors are collapsed by default. This PR changes rustdoc to just not render them at all. Any documentation specific to an implementor can be found by clicking through to the implementor's page. This moves the "portability" info inside the `<summary>` tags so it is still visible on trait pages (as originally implemented in #79201). That also means it will be visible on struct/enum pages when methods are collapsed. Add `#[doc(hidden)]` to all implementations of `Iterator::__iterator_get_unchecked` that didn't already have it. Otherwise, due to #86145, the structs/enums with those implementations would generate documentation for them, and that documentation would have a broken link into the Iterator page. Those links were already "broken" but not detected by the link-checker, because they pointed to one of the Implementors on the Iterator page, which happened to have the right anchor name. This reduces the Read trait's page size from 128kB to 68kB (uncompressed) and from 12,125 bytes to 9,989 bytes (gzipped Demo: https://hoffman-andrews.com/rust/remove-methods-implementors/std/string/struct.String.html#trait-implementations https://hoffman-andrews.com/rust/remove-methods-implementors/std/io/trait.Read.html#implementors r? `@GuillaumeGomez`
2021-06-17Auto merge of #85755 - b-naber:unexpected_concrete_region, r=nikomatsakisbors-46/+38
Replace parent substs of associated types with inference vars in borrow checker Fixes https://github.com/rust-lang/rust/issues/83190 Fixes https://github.com/rust-lang/rust/issues/78450 When we normalize an associated type that refers to an opaque type, it can happen that the substs of the associated type do not occur in the projection (they are parent substs). We previously didn't replace those substs with inference vars, which left a concrete region after all regions should have already been replaced with inference vars and triggered a `delay_span_bug`. After we normalize the opaque type, we now try to replace any remaining concrete regions with inference vars.
2021-06-17Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwcobors-42/+182
Handle C-variadic arguments properly when reporting region errors This pull request fixes #86053. The issue is that for a C-variadic function ```rust #![feature(c_variadic)] unsafe extern "C" fn foo(_: (), ...) {} ``` `foo`'s signature will contain only the first parameter (and have `c_variadic` set to `true`), whereas its body has a second argument (a `hir::Pat` for the `...`). The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the `...` (though not in the example above, because there are no region errors to report). I have simply restricted the iteration over the body parameters to exclude `...`, which is fine because `...` cannot cause a region error.
2021-06-16Fix target highlighting in rustdoc.Jacob Hoffman-Andrews-9/+1
Also factor out outer_version and const_outer_version into render_rightside.
2021-06-16Factor out render_rightsideJacob Hoffman-Andrews-3/+0
This covers rendering of stability_since and the srclink across methods and trait implementations, so their DOM representation is consistent.
2021-06-16Make portability part of the summary.Jacob Hoffman-Andrews-3/+3
That means it will be visible under "Implementors" on trait pages, and under "Implementations" on struct/enum pages, even when all methods are collapsed. Switch to a float layout for rightside elements.
2021-06-16Remove methods under Implementors on trait pagesJacob Hoffman-Andrews-20/+0
These were hidden by default, and duplicated information already on the page anyhow. Also remove the "Auto-hide trait implementors of a trait" setting, which is not needed anymore.
2021-06-17Rollup merge of #86260 - jsha:expand-methods, r=GuillaumeGomezYuki Okushi-0/+5
Open trait implementations' toggles by default. This makes it possible to use Ctrl-F to find methods defined in traits. As discussed in #85923. This modifies the approach suggested in #40363, but still achieves the goal of skimmability. For new users who aren't familiar with all the traits, their methods are readily visible and searchable. For experienced users who prefer to skim the list of all traits, there are two options: the "collapse all" shortcut, and the "auto hide trait implementations" setting. Demo https://hoffman-andrews.com/rust/expand-methods/std/string/struct.String.html#trait-implementations r? `@GuillaumeGomez`
2021-06-17Rollup merge of #86104 - FabianWolff:issue-86085, r=davidtwcoYuki Okushi-0/+43
Fix span calculation in format strings This pull request fixes #86085. The ICE described there is due to an error in the span calculation inside format strings, if the format string is the result of a macro invocation: ```rust fn main() { format!(concat!("abc}")); } ``` currently produces: ``` error: invalid format string: unmatched `}` found --> test.rs:2:17 | 2 | format!(concat!("abc}")); | ^ unmatched `}` in format string ``` which is obviously incorrect. This happens because the span of the entire `concat!()` is combined with the _relative_ location of the unmatched `` `}` `` in the _result_ of the macro invocation (i.e. 4). In #86085, this has led to a span that starts or ends in the middle of a multibyte character, but the root cause was the same. This pull request fixes the problem.
2021-06-16Open trait implementations' toggles by default.Jacob Hoffman-Andrews-0/+5
This makes it possible to use Ctrl-F to find methods defined in traits.