-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #105686
Rollup of 7 pull requests #105686
Conversation
In a scenario like ``` 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 rust-lang#103622.
Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are in fact invalid.
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`.
fix a stderr
…-docs, r=workingjubilee Add docs for question mark operator for Option As a beginner learning rust, it took me a while to figure out what `?` was doing with Options. I think the documentation of this could be improved. I've used the question mark documentation from the `Result` type as a template here, and tried to come up with a simple example as well.
…r=nnethercote 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.
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 rust-lang#103622.
… r=estebank Suggest impl in the scenario of typo with fn Fixes rust-lang#105366
…mpiler-errors Suggest `collect`ing into `Vec<_>` Fix rust-lang#105510.
…iver-argument, r=compiler-errors Suggest dereferencing receiver arguments properly Fixes rust-lang#105429
…fication, r=wesleywiser fold instead of obliterating args Fixes rust-lang#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 🤔
@bors r+ rollup=never p=7 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR: previous master: dc30b92cc5 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (7bdda8f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
Successful merges:
collect
ing intoVec<_>
#105523 (Suggestcollect
ing intoVec<_>
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup