about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-14Rollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomezMatthias Krüger-0/+9
rustdoc: apply `pre-wrap` CSS to code-wrapped links This is common syntax used for intra-doc links, so fixing it should help with doc formatting.
2022-12-14Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, ↵Matthias Krüger-0/+29
r=wesleywiser fold instead of obliterating args Fixes #105608 we call `const_eval_resolve` on the following constant: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), _, ] } _, ], ``` when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ PLACEHOLDER, PLACEHOLDER, ], ``` Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), PLACEHOLDER, ] } PLACEHOLDER, ], ``` which ctfe _can_ handle. I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:
2022-12-14Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, ↵Matthias Krüger-0/+43
r=compiler-errors Suggest dereferencing receiver arguments properly Fixes #105429
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-57/+77
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebankMatthias Krüger-0/+37
Suggest impl in the scenario of typo with fn Fixes #105366
2022-12-14Rollup merge of #105491 - sulami:master, r=compiler-errorsMatthias Krüger-0/+110
Illegal sized bounds: only suggest mutability change if needed In a scenario like ```rust struct Type; pub trait Trait { fn function(&mut self) where Self: Sized; } impl Trait for Type { fn function(&mut self) {} } fn main() { (&mut Type as &mut dyn Trait).function(); } ``` the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied. Fixes #103622.
2022-12-14Rollup merge of #105161 - cassaundra:numeric-literal-error, r=nnethercoteMatthias Krüger-0/+84
Refine when invalid prefix case error arises Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are actually invalid.
2022-12-14Support more projections in custom mirJakob Degen-0/+151
2022-12-14Support common enum operations in custom mirJakob Degen-0/+201
2022-12-14Fix unsafetyck disabling for custom MIRJakob Degen-0/+24
2022-12-13Add regression testinquisitivecrystal-0/+39
2022-12-14Auto merge of #104875 - chenyukang:yukang/fix-104867-inc, r=estebankbors-22/+360
Properly handle postfix inc/dec in standalone and subexpr scenarios Fixes #104867 r? `@estebank`
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-19/+12
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13error parsing lifetime following by Sized and message + between themYiming Lei-0/+51
detect the pattern at the general site parse_impl_ty() this will fix #102598
2022-12-13rustdoc: add CSS margin between `impl` docblock and its itemsMichael Howell-0/+17
2022-12-13Auto merge of #105667 - matthiaskrgr:rollup-fexlc0b, r=matthiaskrgrbors-2360/+2238
Rollup of 7 pull requests Successful merges: - #105147 (Allow unsafe through inline const) - #105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - #105464 (Support #[track_caller] on async closures) - #105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - #105500 (Make some diagnostics not depend on the source of what they reference being available) - #105628 (Small doc fixes) - #105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-13review commentsEsteban Küber-69/+69
2022-12-13Rollup merge of #105500 - oli-obk:unhide_unknown_spans, r=estebankMatthias Krüger-1570/+267
Make some diagnostics not depend on the source of what they reference being available r? `@estebank` follow up to https://github.com/rust-lang/rust/pull/104449
2022-12-13Rollup merge of #105476 - estebank:moves-n-borrows, r=compiler-errorsMatthias Krüger-779/+1777
Change pattern borrowing suggestions to be verbose and remove invalid suggestion Synthesize a more accurate span and use verbose suggestion output to make the message clearer. Do not suggest borrowing binding in pattern in let else. Fix #104838.
2022-12-13Rollup merge of #105464 - nbdd0121:hir, r=compiler-errorsMatthias Krüger-11/+75
Support #[track_caller] on async closures Follow up on #105180 r? ```@compiler-errors``` cc ```@cjgillot```
2022-12-13Rollup merge of #105147 - nbdd0121:inline_const_unsafe, r=oli-obkMatthias Krüger-0/+119
Allow unsafe through inline const Handle similar to closures. Address https://github.com/rust-lang/rust/pull/104087#issuecomment-1324173328 Note that this PR does not fix the issue for `unsafe { [0; function_requiring_unsafe()] }`. This is fundamentally unfixable for MIR unsafeck IMO. This PR also does not fix unsafety checking for inline const in pattern position. It actually breaks it, allowing unsafe functions to be used in inline const in pattern position without unsafe blocks. Inline const in pattern position is not visible in MIR so ignored by MIR unsafety checking (currently it is also not checked by borrow checker, which is the reason why it's considered an incomplete feature). `@rustbot` label: +T-lang +F-inline_const
2022-12-14suggest dereferencing receiver arguments properlyTakayuki Maeda-0/+43
fix a stderr
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-69/+69
2022-12-13Mention implementations that satisfy the traitEsteban Küber-1/+21
2022-12-13Remove unnecessary code and account for turbofish suggestionEsteban Küber-8/+8
Remove previously existing fallback that tried to give a good turbofish suggestion, `need_type_info` is already good enough. Special case `::<Vec<_>` suggestion for `Iterator::collect`.
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-23/+23
2022-12-13Account for dereference expressionsEsteban Küber-133/+186
2022-12-13Fix span for `&mut ` removal suggestionEsteban Küber-29/+29
2022-12-13Suggest `ref` for some patterns as a fallbackEsteban Küber-53/+460
2022-12-13Do not suggest borrowing binding in pattern in let elseEsteban Küber-13/+14
Fix #104838.
2022-12-13Change pattern borrowing suggestions to be verboseEsteban Küber-737/+1274
Synthesize a more accurate span and use verbose suggestion output to make the message clearer.
2022-12-13Combine projection and opaque into aliasMichael Goulet-19/+12
2022-12-13rustdoc: apply `pre-wrap` CSS to code-wrapped linksMichael Howell-0/+9
This is common syntax used for intra-doc links, so fixing it should help with doc formatting.
2022-12-13fix testsakida31-8/+0
2022-12-13Rename `assert_uninit_valid` intrinsicNilstrieb-3/+3
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
2022-12-13reduce to single suggestion for all argumentsakida31-76/+42
2022-12-13change error messageakida31-20/+24
2022-12-13Remove `hint` from help messageakida31-20/+20
2022-12-13Fix stderr of tests which have improved diagnosticsakida31-0/+80
2022-12-13Remove invalid case for mutable borrow suggestionDeep Majumder-0/+26
If we have a call such as `foo(&mut buf)` and after reference collapsing the type is inferred as `&T` where-as the required type is `&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically and the issue lies elsewhere, not in the borrow. Fixes #105645
2022-12-13bless fulldeps testsOli Scherer-3/+1
2022-12-13Use a label instead of a note for the drop site to create denser diagnosticsOli Scherer-35/+15
2022-12-13Stop pointing to operators if their libcore method source is not availableOli Scherer-64/+15
2022-12-13Avoid rendering empty annotationsOli Scherer-158/+50
2022-12-13Don't emit empty notesOli Scherer-29/+1
2022-12-13Clarify what "this" meansOli Scherer-33/+33
2022-12-13Inform the user which trait is meant in the diagnostic itself instead of ↵Oli Scherer-22/+22
relying on the span making it obvious
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-1481/+385
available
2022-12-13Auto merge of #105350 - compiler-errors:faster-binder-relate, r=oli-obkbors-0/+38
Fast-path some binder relations A simpler approach than #104598 Fixes #104583 r? types
2022-12-12Refine when invalid prefix case error arisesCassaundra Smith-0/+84
Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are in fact invalid.