about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-10-30Rollup merge of #90396 - b-naber:type_flags_ices_default_anon_consts, r=lcnrMatthias Krüger-0/+47
Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred Fixes https://github.com/rust-lang/rust/issues/90364 Fixes https://github.com/rust-lang/rust/issues/88997 r? ``@lcnr``
2021-10-30Rollup merge of #90395 - b-naber:const-expr-type-relation, r=oli-obkMatthias Krüger-0/+20
Restrict liveness of mutable borrow of inner infcx in ConstInferUnifier::consts Fixes https://github.com/rust-lang/rust/issues/89304 r? ``@oli-obk``
2021-10-30Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelidMatthias Krüger-2/+2
Unify titles in rustdoc book doc attributes chapter As discussed in https://github.com/rust-lang/rust/pull/90339. I wasn't able to find out where the link to the titles was used so let's see if the CI fails. :) r? ``@camelid``
2021-10-29Unify titles in rustdoc book doc attributes chapterGuillaume Gomez-2/+2
2021-10-29Auto merge of #90373 - tmiasko:union-qualification, r=oli-obkbors-0/+89
Use type based qualification for unions Union field access is currently qualified based on the qualification of a value previously assigned to the union. At the same time, every union access transmutes the content of the union, which might result in a different qualification. For example, consider constants A and B as defined below, under the current rules neither contains interior mutability, since a value used in the initial assignment did not contain `UnsafeCell` constructor. ```rust #![feature(untagged_unions)] union U { i: u32, c: std::cell::Cell<u32> } const A: U = U { i: 0 }; const B: std::cell::Cell<u32> = unsafe { U { i: 0 }.c }; ``` To avoid the issue, the changes here propose to consider the content of a union as opaque and use type based qualification for union types. Fixes #90268. `@rust-lang/wg-const-eval`
2021-10-29ignore type flags insertion in default_anon_const_substs if error occurredb-naber-0/+47
2021-10-29add testb-naber-0/+20
2021-10-29Auto merge of #90214 - tmiasko:indirect-mutation-qualif, ↵bors-0/+93
r=ecstatic-morse,oli-obk Consider indirect mutation during const qualification dataflow Previously a local would be qualified if either one of two separate data flow computations indicated so. First determined if a local could contain the qualif, but ignored any forms of indirect mutation. Second determined if a local could be mutably borrowed (and so indirectly mutated), but which in turn ignored the qualif. The end result was incorrect because the effect of indirect mutation was effectivelly ignored in the all but the final stage of computation. In the new implementation the indirect mutation is directly incorporated into the qualif data flow. The local variable becomes immediately qualified once it is mutably borrowed and borrowed place type can contain the qualif. In general we will now reject additional programs, program that were prevously unintentionally accepted. There are also some cases which are now accepted but were previously rejected, because previous implementation didn't consider whether borrowed place could have the qualif under the consideration. Fixes #90124. r? `@ecstatic-morse`
2021-10-28Auto merge of #90218 - JakobDegen:adt_significant_drop_fix, r=nikomatsakisbors-0/+37
Fixes incorrect handling of ADT's drop requirements Fixes #90024 and a bunch of duplicates. The main issue was just that the contract of `NeedsDropTypes::adt_components` was inconsistent; the list of types it might return were the generic parameters themselves or the fields of the ADT, depending on the nature of the drop impl. This meant that the caller could not determine whether a `.subst()` call was still needed on those types; it called `.subst()` in all cases, and this led to ICEs when the returned types were the generic params. First contribution of more than a few lines, so feedback definitely appreciated.
2021-10-28Use type based qualification for unionsTomasz Miąsko-0/+89
Union field access is currently qualified based on the qualification of a value previously assigned to the union. At the same time, every union access transmutes the content of the union, which might result in a different qualification. For example, consider constants A and B as defined below, under the current rules neither contains interior mutability, since a value used in the initial assignment did not contain `UnsafeCell` constructor. ```rust #![feature(untagged_unions)] union U { i: u32, c: std::cell::Cell<u32> } const A: U = U { i: 0 }; const B: std::cell::Cell<u32> = unsafe { U { i: 0 }.c }; ``` To avoid the issue, the changes here propose to consider the content of a union as opaque and use type based qualification for union types.
2021-10-27Rollup merge of #90304 - vandenheuvel:test_issue_75961, r=Mark-SimulacrumMatthias Krüger-0/+7
Add regression test for #75961 Closes #75961. Closes #21203.
2021-10-27Rollup merge of #90288 - JakobDegen:import_diagnostics, r=davidtwcoMatthias Krüger-0/+108
Add hint for people missing `TryFrom`, `TryInto`, `FromIterator` import pre-2021 Adds a hint anytime a `TryFrom`, `TryInto`, `FromIterator` import is suggested noting that these traits are automatically imported in Edition 2021.
2021-10-27Rollup merge of #90267 - EliseZeroTwo:elisezerotwo/fix_invalid_attrs_ice, ↵Matthias Krüger-0/+46
r=Aaron1011 fix: inner attribute followed by outer attribute causing ICE Fixes #87936, #88938, and #89971. This removes the assertion that validates that there are no outer attributes following inner attributes. Where the inner attribute is invalid you get an actual error.
2021-10-27test: add test for inner attribute followed by outer attribute causing ICEEliseZeroTwo-0/+46
2021-10-27Add regression test for #75961Bram van den Heuvel-0/+7
2021-10-27Auto merge of #89937 - JohnTitor:fix-89875, r=Amanieubors-0/+14
Properly check `target_features` not to trigger an assertion Fixes #89875 I think it should be a condition instead of an assertion to check if it's a register as it's possible that `reg` is a register class. Also, this isn't related to the issue directly, but `is_target_supported` doesn't check `target_features` attributes. Is there any way to check it on rustc_codegen_llvm? r? `@Amanieu`
2021-10-26Reverting switching test to no_std and adjust output after rebase.Jakob Degen-30/+41
2021-10-26Fix line numbers in testJakob Degen-4/+4
2021-10-26Make `ui/suggestions/suggest-tryinto-edition-change.rs` no_std to avoid ↵Jakob Degen-41/+30
getting inconsistent output between local and CI.
2021-10-26Adds hint if a trait fails to resolve and a newly added one in Edition 2021 ↵Jakob Degen-8/+83
is suggested
2021-10-26Add test checking that Edition 2021 is suggested for .try_into() and fix ↵Jakob Degen-0/+33
other test
2021-10-26Rollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-SimulacrumMatthias Krüger-0/+72
Add regression test for #87258 Closes #87258.
2021-10-26Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitorMatthias Krüger-0/+31
Add regression test for issue 90164 Closes #90164 (previously fixed by #90181)
2021-10-26Add regression test for #87258Bram van den Heuvel-0/+72
2021-10-26Add regression test for issue 90164Maybe Waffle-0/+31
2021-10-26Auto merge of #90075 - pierwill:fix-79717, r=petrochenkovbors-76/+150
Edit error messages for `rustc_resolve::AmbiguityKind` variants Edit the language of the ambiguity descriptions for E0659. These strings now appear as notes. Closes #79717.
2021-10-26Consider indirect mutation during const qualification dataflowTomasz Miąsko-0/+93
Previously a local would be qualified if either one of two separate data flow computations indicated so. First determined if a local could contain the qualif, but ignored any forms of indirect mutation. Second determined if a local could be mutably borrowed (and so indirectly mutated), but which in turn ignored the qualif. The end result was incorrect because the effect of indirect mutation was effectivelly ignored in the all but the final stage of computation. In the new implementation the indirect mutation is directly incorporated into the qualif data flow. The local variable becomes immediately qualified once it is mutably borrowed and borrowed place type can contain the qualif. In general we will now reject additional programs, program that were prevously unintentionally accepted. There are also some cases which are now accepted but were previously rejected, because previous implementation didn't consider whether borrowed place could have the qualif under the consideration.
2021-10-26Rollup merge of #90241 - DrMeepster:thiscall_lint_upgrade, r=petrochenkovMatthias Krüger-40/+28
Make thiscall abi on unsupported platforms a hard error As suggested in https://github.com/rust-lang/rust/issues/42202#issuecomment-950205016, this PR makes use of the `thiscall` abi on unsupported a hard error instead of a lint.
2021-10-26Rollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebankMatthias Krüger-74/+161
fix(rustc_typeck): report function argument errors on matching type Fixes #90101
2021-10-26Add a regression test for issue-89875Yuki Okushi-0/+14
2021-10-25Edit error messages for rustc_resolve::AmbiguityKind variantspierwill-76/+150
Emit description of the ambiguity as a note. Co-authored-by: Noah Lev <camelidcamel@gmail.com> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2021-10-25make thiscall on unsupported platforms an errorDrMeepster-40/+28
2021-10-25Rollup merge of #90266 - b-naber:uneval_substs, r=lcnrMatthias Krüger-0/+25
Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated Fixes https://github.com/rust-lang/rust/issues/89334 The changes introduced in https://github.com/rust-lang/rust/pull/87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv. r? `@lcnr`
2021-10-25fix(rustc_typeck): report function argument errors on matching typeMichael Howell-74/+161
Fixes #90101
2021-10-25Rollup merge of #90017 - jackh726:issue-tests, r=nikomatsakisGuillaume Gomez-0/+28
Add a couple tests for normalize under binder issues Closes #56556 Closes #76956 r? ``@nikomatsakis``
2021-10-25add testsb-naber-0/+25
2021-10-25Rollup merge of #90127 - JohnTitor:fix-90113, r=estebankMatthias Krüger-0/+35
Do not mention a reexported item if it's private Fixes #90113 The _actual_ regression was introduced in #73652, then #88838 made it worse. This fixes the issue by not counting such an import as a candidate.
2021-10-25Rollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandryMatthias Krüger-14/+3
Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate Partly address #78543 by making the error quieter. We don't have access to the `typeck` tables from foreign crates, so we used to completely skip the new code when checking foreign crates. Now, we carry on and don't provide as nice output (we don't clarify *what* is making the `Future: !Send`), but at least we no longer emit a sea of derived obligations in the output. [1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html r? `@tmandry`
2021-10-24Auto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726bors-69/+440
Point at overlapping impls when type annotations are needed Address https://github.com/rust-lang/rust/issues/89254.
2021-10-24Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crateEsteban Kuber-14/+3
Partly address #78543 by making the error quieter. We don't have access to the `typeck` tables from foreign crates, so we used to completely skip the new code when checking foreign crates. Now, we carry on and don't provide as nice output (we don't clarify *what* is making the `Future: !Send`), but at least we no longer emit a sea of derived obligations in the output. [1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html
2021-10-24Always sort suggestions before emitting themEsteban Kuber-22/+22
2021-10-24Point at overlapping impls when type annotations are neededEsteban Kuber-49/+420
2021-10-24Fix ICE when forgetting to `Box` a parameter to a `Self::func` callJakob Degen-0/+30
2021-10-23Add regresstion test for #90024.Jakob Degen-0/+37
Uses 2 MCVEs from the issue tracker that test opposite sides of the problem.
2021-10-23Auto merge of #90175 - cuviper:min-llvm-12, r=nagisabors-57/+48
Update the minimum external LLVM to 12 With this change, we'll have stable support for LLVM 12 and 13. For reference, the previous increase to LLVM 10 was #83387, and this replaces the pending increase to LLVM 11 in #90062. r? `@nagisa` `@nikic`
2021-10-23bless the line changes in ui/asm/aarch64/srcloc.rsJosh Stone-23/+23
2021-10-23Auto merge of #90203 - matthiaskrgr:rollup-v215wew, r=matthiaskrgrbors-111/+136
Rollup of 5 pull requests Successful merges: - #85833 (Scrape code examples from examples/ directory for Rustdoc) - #88041 (Make all proc-macro back-compat lints deny-by-default) - #89829 (Consider types appearing in const expressions to be invariant) - #90168 (Reset qualifs when a storage of a local ends) - #90198 (Add caveat about changing parallelism and function call overhead) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-23Rollup merge of #90168 - tmiasko:const-qualif-storage, r=matthewjasperMatthias Krüger-0/+20
Reset qualifs when a storage of a local ends Reset qualifs when a storage of a local ends to ensure that the local qualifs are affected by the state from previous loop iterations only if the local is kept alive. The change should be forward compatible with a stricter handling of indirect assignments, since storage dead invalidates all existing pointers to the local.
2021-10-23Rollup merge of #89829 - voidc:assoc-const-variance, r=lcnrMatthias Krüger-25/+32
Consider types appearing in const expressions to be invariant This is an approach to fix #80977. Currently, a type parameter which is only used in a constant expression is considered bivariant and will trigger error E0392 *"parameter T is never used"*. Here is a short example: ```rust pub trait Foo { const N: usize; } struct Bar<T: Foo>([u8; T::N]) where [(); T::N]:; ``` ([playgound](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=b51a272853f75925e72efc1597478aa5)) While it is possible to silence this error by adding a `PhantomData<T>` field, I think the better solution would be to make `T` invariant. This would be analogous to the invariance constraints added for associated types. However, I'm quite new to the compiler and unsure whether this is the right approach. r? ``@varkor`` (since you authored #60058)
2021-10-23Rollup merge of #88041 - Aaron1011:deny-proc-macro-hack, r=wesleywiserMatthias Krüger-86/+84
Make all proc-macro back-compat lints deny-by-default The affected crates have had plenty of time to update. By keeping these as lints rather than making them hard errors, we ensure that downstream crates will still be able to compile, even if they transitive depend on broken versions of the affected crates. This should hopefully discourage anyone from writing any new code which relies on the backwards-compatibility behavior.