-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 5 pull requests #71826
Rollup of 5 pull requests #71826
Commits on Apr 22, 2020
-
Handle binop on unbound type param
When encountering a binary operation involving a type parameter that has no bindings, suggest adding the appropriate bound.
Configuration menu - View commit details
-
Copy full SHA for 2e89ade - Browse repository at this point
Copy the full SHA 2e89adeView commit details -
Suggest restricting type param when it doesn't satisfy projection
When encountering a projection that isn't satisfied by a type parameter, suggest constraining the type parameter.
Configuration menu - View commit details
-
Copy full SHA for b3eaccb - Browse repository at this point
Copy the full SHA b3eaccbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ddf322f - Browse repository at this point
Copy the full SHA ddf322fView commit details -
On incorrect equality constraint likely to be assoc type, suggest app…
…ropriate syntax When encountering `where <A as Foo>::Bar = B`, it is possible that `Bar` is an associated type. If so, suggest `where A: Foo<Bar = B>`. CC rust-lang#20041.
Configuration menu - View commit details
-
Copy full SHA for c2b5373 - Browse repository at this point
Copy the full SHA c2b5373View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e67570 - Browse repository at this point
Copy the full SHA 8e67570View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0a9d52 - Browse repository at this point
Copy the full SHA c0a9d52View commit details
Commits on May 2, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a691521 - Browse repository at this point
Copy the full SHA a691521View commit details -
Configuration menu - View commit details
-
Copy full SHA for 902aa62 - Browse repository at this point
Copy the full SHA 902aa62View commit details -
Configuration menu - View commit details
-
Copy full SHA for c05961c - Browse repository at this point
Copy the full SHA c05961cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3ec00a - Browse repository at this point
Copy the full SHA f3ec00aView commit details -
Test associated const default qualifs cross-crate
This also tests for the ICE in rust-lang#71734
Configuration menu - View commit details
-
Copy full SHA for bcc44b8 - Browse repository at this point
Copy the full SHA bcc44b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14a2c8d - Browse repository at this point
Copy the full SHA 14a2c8dView commit details
Commits on May 3, 2020
-
Rollup merge of rust-lang#70908 - estebank:suggest-add, r=nikomatsakis
Provide suggestions for type parameters missing bounds for associated types When implementing the binary operator traits it is easy to forget to restrict the `Output` associated type. `rustc` now accounts for different cases to lead users in the right direction to add the necessary restrictions. The structured suggestions in the following output are new: ``` error: equality constraints are not yet supported in `where` clauses --> $DIR/missing-bounds.rs:37:33 | LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B { | ^^^^^^^^^^^^^^^^^^^^^^ not supported | = note: see issue rust-lang#20041 <rust-lang#20041> for more information help: if `Output` is an associated type you're trying to set, use the associated type binding syntax | LL | impl<B: Add> Add for E<B> where B: Add<Output = B> { | ^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/missing-bounds.rs:11:11 | 7 | impl<B> Add for A<B> where B: Add { | - this type parameter ... 11 | A(self.0 + rhs.0) | ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<B as std::ops::Add>::Output` help: consider further restricting this bound | 7 | impl<B> Add for A<B> where B: Add + std::ops::Add<Output = B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot add `B` to `B` --> $DIR/missing-bounds.rs:31:21 | 31 | Self(self.0 + rhs.0) | ------ ^ ----- B | | | B | help: consider restricting type parameter `B` | 27 | impl<B: std::ops::Add<Output = B>> Add for D<B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` That output is given for the following cases: ```rust struct A<B>(B); impl<B> Add for A<B> where B: Add { type Output = Self; fn add(self, rhs: Self) -> Self { A(self.0 + rhs.0) //~ ERROR mismatched types } } struct D<B>(B); impl<B> Add for D<B> { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) //~ ERROR cannot add `B` to `B` } } struct E<B>(B); impl<B: Add> Add for E<B> where <B as Add>::Output = B { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) } } ```
Configuration menu - View commit details
-
Copy full SHA for 6ad0ab1 - Browse repository at this point
Copy the full SHA 6ad0ab1View commit details -
Rollup merge of rust-lang#71165 - lcnr:patch-2, r=Amanieu
`slice::fill`: use `T` instead of generic arg implements rust-lang#70758 (comment) As the discussion in rust-lang#70758 has shifted, I now use `T` instead of `&T`.
Configuration menu - View commit details
-
Copy full SHA for 96a4f13 - Browse repository at this point
Copy the full SHA 96a4f13View commit details -
Rollup merge of rust-lang#71542 - crlf0710:confusable_idents, r=petro…
…chenkov Implement `confusable_idents` lint. This collects all identifier symbols into `ParseSession` and examines them within the non-ascii-idents lint. The skeleton generation part needs to be added to `unicode-security` crate. Will update this PR when the crate is updated. r? @petrochenkov EDIT: also included the `concat_idents` part.
Configuration menu - View commit details
-
Copy full SHA for e5be1f8 - Browse repository at this point
Copy the full SHA e5be1f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 167e7d7 - Browse repository at this point
Copy the full SHA 167e7d7View commit details -
Rollup merge of rust-lang#71813 - ecstatic-morse:issue-71734, r=tmandry
Decode qualifs for associated const defaults Fixes rust-lang#71734. We encode qualifs for associated constants, but never expected to decode the qualifs for defaulted associated consts. Fix this, and test that associated const defaults have the correct qualifs cross-crate. r? @tmandry
Configuration menu - View commit details
-
Copy full SHA for 18b456b - Browse repository at this point
Copy the full SHA 18b456bView commit details