about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-03-11Implement macro meta-variable expressionCaio-83/+689
2022-03-11Rollup merge of #94839 - ↵Dylan DPC-0/+56
TaKO8Ki:suggest-using-double-colon-for-struct-field-type, r=cjgillot Suggest using double colon when a struct field type include single colon #92685
2022-03-11Rollup merge of #94827 - RalfJung:offset-from-ub, r=oli-obkDylan DPC-6/+50
CTFE/Miri: detect out-of-bounds pointers in offset_from Also I became uneasy with aggressively doing `try_to_int` here -- this will always succeed on Miri, leading to the wrong codepath being taken. We should rather try to convert them both to pointers, and use the integer path as a fallback, so that's what I implemented now. Hiding whitespaces helps with the diff. Fixes https://github.com/rust-lang/miri/issues/1950 r? ``@oli-obk``
2022-03-11Rollup merge of #94818 - yoshuawuyts:into-future-associated-type, r=joshtriplettDylan DPC-2/+2
Rename `IntoFuture::Future` to `IntoFuture::IntoFuture` Ref: https://github.com/rust-lang/rust/issues/67644#issuecomment-1051401459 This renames `IntoFuture::Future` to `IntoFuture::IntoFuture`. This adds the `Into*` prefix to the associated type, similar to the [`IntoIterator::IntoIter`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html#associatedtype.IntoIter) associated type. It's my mistake we didn't do so in the first place. This fixes that and brings the two closer together. Thanks! ### References __`IntoIterator` trait def__ ```rust pub trait IntoIterator { type Item; type IntoIter: Iterator<Item = Self::Item>; fn into_iter(self) -> Self::IntoIter; } ``` __`IntoFuture` trait def__ ```rust pub trait IntoFuture { type Output; type IntoFuture: Future<Output = Self::Output>; // Prior to this PR: `type Future:` fn into_future(self) -> Self::IntoFuture; } ``` cc/ `@eholk` `@rust-lang/wg-async`
2022-03-11Add tests for JSON and console outputMark Rousskov-4/+3
2022-03-11fix a suggestion messageTakayuki Maeda-6/+6
2022-03-11suggest using double colon when using single colon in struct field type pathTakayuki Maeda-0/+56
2022-03-11Auto merge of #94276 - scottmcm:primitive-clone, r=oli-obkbors-0/+4
mir-opt: Replace clone on primitives with copy We can't do it for everything, but it would be nice to at least stop making calls to clone methods in debug from things like derived-clones. r? `@ghost`
2022-03-10adjust offset_from logic: check that both pointers are in-boundsRalf Jung-6/+50
2022-03-10Rollup merge of #94728 - compiler-errors:box-allocator-zst-meta, ↵Dylan DPC-1/+24
r=michaelwoerister Only emit pointer-like metadata for `Box<T, A>` when `A` is ZST Basically copy the change in #94043, but for debuginfo. r? ``@michaelwoerister`` Fixes #94725
2022-03-10Rollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=petrochenkovDylan DPC-0/+578
[1/2] Implement macro meta-variable expressions See https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295 The logic behind `length`, `index` and `count` was removed but the parsing code is still present, i.e., everything is simply ignored like `ignored`. r? ``@petrochenkov``
2022-03-10Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandryDylan DPC-68/+266
Treat unstable lints as unknown This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-10Rename `IntoFuture::Future` to `IntoFuture::IntoFuture`Yoshua Wuyts-2/+2
2022-03-10Rollup merge of #94805 - oli-obk:drop_box, r=pnkfelixMatthias Krüger-0/+15
Revert accidental stabilization fixes #94804
2022-03-10Rollup merge of #94440 - compiler-errors:issue-94282, r=lcnrMatthias Krüger-0/+45
Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]` This PR implements a somewhat rudimentary heuristic to suggest using `#![feature(generic_const_exprs)]` in a child crate when a function from a foreign crate (that may have used `#![feature(generic_const_exprs)]`) fails to normalize during codegen. cc: #79018 cc: #94287
2022-03-10Revert accidental stabilizationOli Scherer-0/+15
2022-03-10Auto merge of #94802 - matthiaskrgr:rollup-4plu0fi, r=matthiaskrgrbors-389/+381
Rollup of 5 pull requests Successful merges: - #92150 (Improve suggestion when casting usize to (possibly) wide pointer) - #94635 (Merge `#[deprecated]` and `#[rustc_deprecated]`) - #94657 (Constify `Index{,Mut}` for `[T]`, `str`, and `[T; N]`) - #94746 (diagnostics: use rustc_on_unimplemented to recommend `[].iter()`) - #94788 (Account for suggestions for complete removal of lines) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-10Rollup merge of #94788 - estebank:removal-suggestion, r=petrochenkovMatthias Krüger-0/+113
Account for suggestions for complete removal of lines Fix #94192.
2022-03-10Rollup merge of #94746 - notriddle:notriddle/method-rustc-on-unimplemented, ↵Matthias Krüger-8/+30
r=davidtwco diagnostics: use rustc_on_unimplemented to recommend `[].iter()` To make this work, the `#[rustc_on_unimplemented]` data needs to be used to report method resolution errors, which is most of what this commit does. Fixes #94581
2022-03-10Rollup merge of #94657 - fee1-dead:const_slice_index, r=oli-obkMatthias Krüger-8/+8
Constify `Index{,Mut}` for `[T]`, `str`, and `[T; N]` Several panic functions were rewired (via `const_eval_select`) to simpler implementations that do not require formatting for compile-time usage. r? ```@oli-obk```
2022-03-10Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwcoMatthias Krüger-360/+186
Merge `#[deprecated]` and `#[rustc_deprecated]` The first commit makes "reason" an alias for "note" in `#[rustc_deprecated]`, while still prohibiting it in `#[deprecated]`. The second commit changes "suggestion" to not just be a feature of `#[rustc_deprecated]`. This is placed behind the new `deprecated_suggestion` feature. This needs a tracking issue; let me know if this PR will be approved and I can create one. The third commit is what permits `#[deprecated]` to be used when `#![feature(staged_api)]` is enabled. This isn't yet used in stdlib (only tests), as it would require duplicating all deprecation attributes until a bootstrap occurs. I intend to submit a follow-up PR that replaces all uses and removes the remaining `#[rustc_deprecated]` code after the next bootstrap. `@rustbot` label +T-libs-api +C-feature-request +A-attributes +S-waiting-on-review
2022-03-10Rollup merge of #92150 - compiler-errors:better_usize_to_wide_ptr_cast, ↵Matthias Krüger-13/+44
r=petrochenkov Improve suggestion when casting usize to (possibly) wide pointer I thought #92125 was a wonderful idea, so I went ahead and took a stab at it. Not sure if my approach is the best going forward, but I'm happy with the improvement in the error message. Iwill definitely address any changes if people are more opinionated with the wordings or want more features. Also, do I need to add a new error code? (Fixes #92125)
2022-03-10short-circuit the easy cases in `is_copy_modulo_regions`Scott McMurray-0/+4
This change is somewhat extensive, since it affects MIR -- since this is called to determine Copy vs Move -- so any test that's `no_core` needs to actually have the normal `impl`s it uses.
2022-03-10Auto merge of #94764 - nikic:update-llvm-3, r=nagisabors-1/+0
Update LLVM submodule This merges upstream changes from the 14.x release branch. Fixes #89609. Fixes #93923. Fixes #94032.
2022-03-10Auto merge of #94059 - b-naber:constantkind-val-transformation, r=lcnrbors-2/+2
Treat constant values as mir::ConstantKind::Val Another step that is necessary for the introduction of Valtrees: we don't want to treat `ty::Const` instances of kind `ty::ConstKind::Value` as `mir::ConstantKind::Ty` anymore. r? `@oli-obk`
2022-03-09Account for suggestions for complete removal of linesEsteban Kuber-0/+113
Fix #94192.
2022-03-09better suggestion for int to wide ptr castMichael Goulet-13/+44
2022-03-09suggest enabling generic_const_exprs feature if const is unevaluatableMichael Goulet-0/+45
2022-03-09Rollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkovMatthias Krüger-1/+41
Add miri to the well known conditional compilation names and values This pull request adds `miri` to the list of well known names and values of the conditional compilation checking (`--check-cfg`). This was brought up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/RFC.203013.3A.20Checking.20conditional.20compilation.20at.20compile.20time/near/274513827) when discussing about the future of `--check-cfg`. r? ``@petrochenkov``
2022-03-09Rollup merge of #94754 - c410-f3r:nice-error, r=lcnrMatthias Krüger-55/+110
Warn users about `||` in let chain expressions Or more specifically, warn that `||` operators are forbidden. This PR is simple so I guess anyone can review 🤷 cc #53667 cc ``@matthewjasper``
2022-03-09Rollup merge of #94739 - estebank:suggest-let-else, r=oli-obkMatthias Krüger-51/+83
Suggest `if let`/`let_else` for refutable pat in `let` r? `````@oli-obk`````
2022-03-09Permit `#[deprecated]` in stdlibJacob Pratt-352/+159
2022-03-09New `deprecated_suggestion` feature, use in testsJacob Pratt-3/+22
2022-03-09Implement macro meta-variable expressionsCaio-0/+578
2022-03-09Warn users about || in let chain expressionsCaio-55/+110
2022-03-09diagnostics: use rustc_on_unimplemented to recommend `[].iter()`Michael Howell-8/+30
To make this work, the `#[rustc_on_unimplemented]` data needs to be used to report method resolution errors, which is most of what this commit does. Fixes #94581
2022-03-09Add miri to the well known conditional compilation names and valuesLoïc BRANSTETT-1/+41
2022-03-09keep ERROR in messageb-naber-4/+4
2022-03-09manually bless 32-bit stderrb-naber-1/+0
2022-03-09normalization change and rebaseb-naber-300/+255
2022-03-09bless testsb-naber-254/+300
2022-03-09Enable issue-23036.rs on wasm32Nikita Popov-1/+0
2022-03-09Auto merge of #94515 - estebank:tweak-move-error, r=davidtwcobors-59/+94
Tweak move error Point at method definition that causes type to be consumed. Fix #94056.
2022-03-09Rollup merge of #94686 - ChayimFriedman2:issue-94629, r=jackh726Dylan DPC-3/+16
Do not allow `#[rustc_legacy_const_generics]` on methods It caused an ICE since `item` was `None`. Fixes #94629.
2022-03-08Rollup merge of #94689 - compiler-errors:on-unimplemented-substs, r=petrochenkovDylan DPC-2/+85
Use impl substs in `#[rustc_on_unimplemented]` We were using the trait-ref substs instead of impl substs in `rustc_on_unimplemented`, even when computing the `rustc_on_unimplemented` attached to an impl block. Let's not do that. This PR also untangles impl and trait def-ids in the logic in `on_unimplemented` a bit. Fixes #94675
2022-03-08Update for changes to other lintsDavid Koloski-10/+15
2022-03-08Fix docs, fix incorrect lint source in noteDavid Koloski-7/+5
2022-03-08Switch the primary diagnostic to `unknown_lints`David Koloski-109/+254
This also affects the `non_exhaustive_omitted_patterns` and `must_not_suspend` lints as they are not stable. This also changes the diagnostic level to pull from `unknown_lints` instead of always being allow or deny.
2022-03-08Treat unstable lints as unknownDavid Koloski-0/+50
This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-08Do not suggest `let_else` if no bindings would be introducedEsteban Kuber-44/+0