about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-03-27Rollup merge of #93469 - compiler-errors:issue-93450, r=estebankDylan DPC-43/+17
Skip pointing out ambiguous impls in alloc/std crates too in inference errors This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`. While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that? Fixes #93450 r? `@estebank` feel free to reassign
2022-03-27Rollup merge of #91981 - estebank:tweakaroo, r=lcnrDylan DPC-56/+158
Recover suggestions and useful information lost in previous PR Follow up to #91898.
2022-03-27Change wording of missing return type suggestionEsteban Kuber-14/+19
2022-03-27Point (again) to more expressions with their type, even if not fully resolvedEsteban Kuber-30/+123
2022-03-27Eagerly replace `{integer}`/`{float}` with `i32`/`f64` for suggestionEsteban Kuber-12/+16
2022-03-26Auto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011bors-414/+21
proc-macro: Stop wrapping `ident` matchers into groups `ident` is always a single token and can be treated in the same way as `tt`. r? `@Aaron1011`
2022-03-26Auto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPCbors-12/+14
add #[must_use] to functions of slice and its iterators. Continuation of #92853. Tracking issue: #89692.
2022-03-26proc-macro: Stop wrapping `ident` matchers into groupsVadim Petrochenkov-414/+21
2022-03-26Auto merge of #95149 - cjgillot:once-diag, r=estebankbors-103/+52
Remove `Session::one_time_diagnostic` This is untracked mutable state, which modified the behaviour of queries. It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes). It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter. A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics. As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.
2022-03-25Replace wait-for instructions for rustdoc GUI tests with wait-for-cssGuillaume Gomez-36/+19
2022-03-25Bless rustdoc tests.Camille GILLOT-30/+0
2022-03-25Auto merge of #95255 - petrochenkov:suggresolve, r=michaelwoeristerbors-190/+19
resolve: Do not build expensive suggestions if they are not actually used And remove a bunch of (conditionally) unused parameters from path resolution functions. This helps with performance issues in https://github.com/rust-lang/rust/pull/94857, and should be helpful in general even without that.
2022-03-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-0/+47
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-25Rollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, ↵Dylan DPC-4/+15
r=wesleywiser debuginfo: Fix debuginfo for Box<T> where T is unsized. Before this fix, the debuginfo for the fields was generated from the struct defintion of Box<T>, but (at least at the moment) the compiler pretends that Box<T> is just a (fat) pointer, so the fields need to be `pointer` and `vtable` instead of `__0: Unique<T>` and `__1: Allocator`. This is meant as a temporary mitigation until we can make sure that simply treating Box as a regular struct in debuginfo does not cause too much breakage in the ecosystem. r? ````@wesleywiser````
2022-03-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-189/+114
Try to evaluate in try unify and postpone resolution of constants that contain inference variables We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables. r? `@lcnr`
2022-03-25Rollup merge of #94391 - light4:issue-90319, r=estebankDylan DPC-0/+26
Fix ice when error reporting recursion errors Fixes: #90319, #92148, #93955
2022-03-25resolve: Do not build expensive suggestions if they are not actually usedVadim Petrochenkov-190/+19
Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.
2022-03-24Where bounds are checked on inherent implsSantiago Pastorino-0/+25
2022-03-24Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obkbors-62/+238
Separate const prop lints from optimizations r? `@oli-obk` Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup. Thanks to `@oli-obk` for mentoring me.
2022-03-25Fix ice when error reporting recursion errorslightning1141-0/+26
Fixes: #90319, #92148, #93955
2022-03-24add #[must_use] to functions of slice and its iterators.Jendrik-12/+14
2022-03-24Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnrbors-0/+42
Change Thir to lazily create constants To allow `AbstractConst`s to work with the previous thir changes we made and those we want to make, i.e. to avoid problems due to `ValTree` and `ConstValue` conversions, we instead switch to a thir representation for constants that allows us to lazily create constants. r? `@oli-obk`
2022-03-24Auto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obkbors-47/+84
Properly track `ImplObligations` Instead of probing for all possible `impl`s that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow to #89580. Addresses #89418.
2022-03-24debuginfo: Fix debuginfo for Box<T> where T is unsized.Michael Woerister-4/+15
Before this fix, the debuginfo for the fields was generated from the struct defintion of Box<T>, but (at least at the moment) the compiler pretends that Box<T> is just a (fat) pointer, so the fields need to be `pointer` and `vtable` instead of `__0: Unique<T>` and `__1: Allocator`. This is meant as a temporary mitigation until we can make sure that simply treating Box as a regular struct in debuginfo does not cause too much breakage in the ecosystem.
2022-03-24Properly track `ImplObligation`sEsteban Kuber-47/+84
Instead of probing for all possible impls that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow up to #89580. Addresses #89418. Remove some unnecessary clones. Tweak output for auto trait impl obligations.
2022-03-23Rollup merge of #95238 - ↵Matthias Krüger-0/+36
TaKO8Ki:stop-emitting-E0026-for-struct-enum-with-underscore, r=estebank Stop emitting E0026 for struct enums with underscores This patch resolves a part of #83263; r? `@estebank`
2022-03-23Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obkMatthias Krüger-18/+18
remove `[async output]` from `impl Future` pretty-printing self-explanatory, guess it's not as helpful as I thought when I added it 4 months ago re https://github.com/rust-lang/rust/issues/95089#issuecomment-1075482851
2022-03-23Rollup merge of #95221 - RalfJung:check_and_deref_ptr, r=oli-obkMatthias Krüger-9/+9
interpret/memory: simplify check_and_deref_ptr *Finally* I saw a way to make this code simpler. The odd preprocessing in `let ptr_or_addr =` has bothered me since forever, but it actually became unnecessary in the last provenance refactoring. :) This also leads to slightly more explicit error messages as a nice side-effect. :tada: r? `@oli-obk`
2022-03-23Rollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obkMatthias Krüger-0/+8
Fix auto traits in rustdoc Fixes #90324. cc `@matthewjasper` r? `@Aaron1011`
2022-03-23Rollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwcoMatthias Krüger-0/+64
Better errors when a Copy impl on a Struct is not self-consistent As discovered in a Zulip thread with `@nnethercote` and `@Mark-Simulacrum,` it's not immediately obvious why a field on an ADT doesn't implement `Copy`. This PR attempts to give slightly more detailed information by spinning up a fulfillment context to try to dig down and discover transitive fulfillment errors that cause `is_copy_modulo_regions` to fail on a ADT field. The error message still kinda sucks, but should only show up in the case that an existing error message was totally missing... so I think it's a good compromise for now?
2022-03-23Auto merge of #95220 - rust-lang:notriddle/ast-validation-semicolon, r=Dylan-DPCbors-3/+1
diagnostics: do not suggest `fn foo({ <body> }` Instead of suggesting that the body always replace the last character on the line, presuming it must be a semicolon, the parser should instead check what the last character is, and append the body if it is anything else. Fixes #83104
2022-03-23Update allocation idOli Scherer-1/+1
2022-03-23Remove line instead of just commenting outCarl Scherer-1/+0
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-03-23separate const prop lint from optimizationsCarl Scherer-61/+238
2022-03-23Auto merge of #94901 - fee1-dead:destructable, r=oli-obkbors-68/+69
Rename `~const Drop` to `~const Destruct` r? `@oli-obk` Completely switching to `~const Destructible` would be rather complicated, so it seems best to add it for now and wait for it to be backported to beta in the next release. The rationale is to prevent complications such as #92149 and #94803 by introducing an entirely new trait. And `~const Destructible` reads a bit better than `~const Drop`. Name Bikesheddable.
2022-03-23stop emitting E0026 for struct enums with underscoresTakayuki Maeda-0/+36
2022-03-23add test for treating ExprKind::ConstParam as tempb-naber-0/+42
2022-03-22remove [async output] from impl FutureMichael Goulet-18/+18
2022-03-22bless 32bitRalf Jung-1/+1
2022-03-23Rollup merge of #95219 - ojeda:update-alloc-no-oom-handling-test, r=Dylan-DPCDylan DPC-1/+1
Modernize `alloc-no-oom-handling` test - The edition should be 2021 to avoid warnings. - The `external_crate` feature was removed in commit 45bf1ed1a112 ("rustc: Allow changing the default allocator"). Note that commit d620ae10709c ("Auto merge of #84266") removed the old test, but the new one introduced passed the `--cfg` like in the old one. Signed-off-by: Miguel Ojeda <ojeda@kernel.org> --- This is intended to align this test to the new `no_rc` and `no_sync` ones being added in https://github.com/rust-lang/rust/pull/89891, but it makes sense on its own too.
2022-03-23Rollup merge of #91608 - workingjubilee:fold-neon-fp, r=nagisa,AmanieuDylan DPC-2/+147
Fold aarch64 feature +fp into +neon Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64: The Neon unit, which handles both floating point and SIMD instructions. Moreover, a configuration for AArch64 must include both or neither. Arm says "entirely proprietary" toolchains may omit floating point: https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point In the Programmer's Guide for Armv8-A, Arm says AArch64 can have both FP and Neon or neither in custom implementations: https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON In "Bare metal boot code for Armv8-A", enabling Neon and FP is just disabling the same trap flag: https://developer.arm.com/documentation/dai0527/a In an unlikely future where "Neon and FP" become unrelated, we can add "[+-]fp" as its own feature flag. Until then, we can simplify programming with Rust on AArch64 by folding both into "[+-]neon", which is valid as it supersets both. "[+-]neon" is retained for niche uses such as firmware, kernels, "I just hate floats", and so on. I am... pretty sure no one is relying on this. An argument could be made that, as we are not an "entirely proprietary" toolchain, we should not support AArch64 without floats at all. I think that's a bit excessive. However, I want to recognize the intent: programming for AArch64 should be simplified where possible. For x86-64, programmers regularly set up illegal feature configurations because it's hard to understand them, see https://github.com/rust-lang/rust/issues/89586. And per the above notes, plus the discussion in https://github.com/rust-lang/rust/issues/86941, there should be no real use cases for leaving these features split: the two should in fact always go together. - Fixes rust-lang/rust#95002. - Fixes rust-lang/rust#95064. - Fixes rust-lang/rust#95122.
2022-03-22Fixup aarch64 smoke testJubilee Young-5/+4
2022-03-22better errors when a Copy impl is not coherentMichael Goulet-0/+64
2022-03-22interpret/memory: simplify check_and_deref_ptrRalf Jung-8/+8
2022-03-22Test SVE2 includes NEON and not vice versaJubilee Young-0/+58
Required by https://github.com/rust-lang/rust/issues/95122
2022-03-22diagnostics: do not suggest `fn foo({ <body> }`Michael Howell-3/+1
Instead of suggesting that the body always replace the last character on the line, presuming it must be a semicolon, the parser should instead check what the last character is, and append the body if it is anything else. Fixes #83104
2022-03-22Test NEON compilesJubilee Young-0/+24
Required by https://github.com/rust-lang/rust/issues/95002
2022-03-22Filter for all features instead of anyJubilee Young-0/+64
Adds regression tests for feature logic Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com> Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me>
2022-03-22Fold aarch64 feature +fp into +neonJubilee Young-2/+2
Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64: The Neon unit, which handles both floating point and SIMD instructions. Moreover, a configuration for AArch64 must include both or neither. Arm says "entirely proprietary" toolchains may omit floating point: https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point In the Programmer's Guide for Armv8-A, Arm says AArch64 can have both FP and Neon or neither in custom implementations: https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON In "Bare metal boot code for Armv8-A", enabling Neon and FP is just disabling the same trap flag: https://developer.arm.com/documentation/dai0527/a In an unlikely future where "Neon and FP" become unrelated, we can add "[+-]fp" as its own feature flag. Until then, we can simplify programming with Rust on AArch64 by folding both into "[+-]neon", which is valid as it supersets both. "[+-]neon" is retained for niche uses such as firmware, kernels, "I just hate floats", and so on.
2022-03-22Modernize `alloc-no-oom-handling` testMiguel Ojeda-1/+1
- The edition should be 2021 to avoid warnings. - The `external_crate` feature was removed in commit 45bf1ed1a112 ("rustc: Allow changing the default allocator"). Note that commit d620ae10709c ("Auto merge of #84266") removed the old test, but the new one introduced passed the `--cfg` like in the old one. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>