about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-06-21Auto merge of #86515 - JohnTitor:rollup-axzb4xh, r=JohnTitorbors-12/+170
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 #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-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-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-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-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-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-88/+121
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-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-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-16Auto merge of #86332 - rylev:fix-ice-docalias, r=GuillaumeGomezbors-4/+11
Fix ICE when doc aliases were put on function params Fixes #86239 r? `@GuillaumeGomez`
2021-06-16Move some typeck-related tests to the typeck dirYuki Okushi-0/+0
2021-06-16Remove invalid suggestions for assoc consts on placeholder type errorYuki Okushi-0/+35
2021-06-15add regression test for issue #78632Yerkebulan Tulibergenov-0/+59
2021-06-16Rollup merge of #86280 - JohnTitor:issue-76510, r=oli-obkYuki Okushi-0/+90
Add a regression test for issue-76510 Fixed by #78407, closes #76510 r? ``@oli-obk``
2021-06-16Do not emit invalid suggestions on multiple mutable borrow errorsYuki Okushi-0/+32
2021-06-15Use better error message for hard errors in CTFESmitty-88/+54
Currently the same message is used for hard errors and soft errors. This makes 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.
2021-06-15Fix ICE when doc aliases were put on function paramsRyan Levick-4/+11
2021-06-14Auto merge of #86275 - lqd:ctfe-validation, r=RalfJungbors-95/+95
Improve CTFE UB validation error messages As mentioned in https://github.com/rust-lang/rust/pull/86245#discussion_r650494012 this PR slightly improves the formatting of validation errors, to move the path to the error prefix. From: `type validation failed: encountered invalid vtable: size is bigger than largest supported object at .0` To: `type validation failed at .0: encountered invalid vtable: size is bigger than largest supported object`.
2021-06-14Auto merge of #86117 - ehuss:force-warns-underscore, r=rylevbors-1/+1
Fix force-warns to allow dashes. The `--force-warns` flag was not allowing lint names with dashes, only supporting underscores. This changes it to allow dashes to match the behavior of the A/W/D/F flags.
2021-06-14Add a regression test for issue-76510Yuki Okushi-0/+90
2021-06-13update tests involving CTFE validationRémy Rakic-95/+95
2021-06-13Auto merge of #86245 - lqd:const-ub-align, r=RalfJungbors-27/+129
Fix ICEs on invalid vtable size/alignment const UB errors The invalid vtable size/alignment errors from `InterpCx::read_size_and_align_from_vtable` were "freeform const UB errors", causing ICEs when reaching validation. This PR turns them into const UB hard errors to catch them during validation and avoid that. Fixes #86193 r? `@RalfJung` (It seemed cleaner to have 2 variants but they can be merged into one variant with a message payload if you prefer that ?)
2021-06-13Test invalid vtable size/alignment const UB errorsRémy Rakic-27/+129
2021-06-13Add a regression test for issue-85113Yuki Okushi-0/+70
2021-06-12Pretty print generator witness only in `-Zverbose` modeTomasz Miąsko-13/+13
In release build of deeply-nested-async benchmark the size of `no-opt.bc` file is reduced from 46MB to 62kB.
2021-06-12Auto merge of #86215 - FabianWolff:unnameable-types, r=jackh726bors-0/+105
Do not suggest to add type annotations for unnameable types Consider this example: ```rust const A = || 42; struct S<T> { t: T } const B: _ = S { t: || 42 }; ``` This currently produces the following output: ``` error: missing type for `const` item --> src/lib.rs:1:7 | 1 | const A = || 42; | ^ help: provide a type for the item: `A: [closure@src/lib.rs:1:11: 1:16]` error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> src/lib.rs:4:10 | 4 | const B: _ = S { t: || 42 }; | ^ | | | not allowed in type signatures | help: replace `_` with the correct type: `S<[closure@src/lib.rs:4:21: 4:26]>` error: aborting due to 2 previous errors ``` However, these suggestions are obviously useless, because the suggested types cannot be written down. With my changes, the suggestion is replaced with a note, because there is no simple fix: ``` error: missing type for `const` item --> test.rs:1:7 | 1 | const A = || 42; | ^ | note: however, the inferred type `[closure@test.rs:1:11: 1:16]` cannot be named --> test.rs:1:11 | 1 | const A = || 42; | ^^^^^ error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> test.rs:4:10 | 4 | const B: _ = S { t: || 42 }; | ^ not allowed in type signatures | note: however, the inferred type `S<[closure@test.rs:4:21: 4:26]>` cannot be named --> test.rs:4:14 | 4 | const B: _ = S { t: || 42 }; | ^^^^^^^^^^^^^^ error: aborting due to 2 previous errors ```