-
Notifications
You must be signed in to change notification settings - Fork 13k
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
implement fuzzy matching in on_unimplemented #33694
Conversation
@@ -523,8 +523,7 @@ impl<T> SliceExt for [T] { | |||
} | |||
|
|||
#[stable(feature = "rust1", since = "1.0.0")] | |||
#[allow(unused_attributes)] | |||
#[rustc_on_unimplemented = "a usize is required to index into a slice"] | |||
#[rustc_on_unimplemented = "slice indexes must be usizes"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure the message is as clear as possible to the users that will be helped, maybe we can change to “slice index type must be usize”? I just think the “usizes” formulation will be confusing.
def_a == def_b, | ||
_ => cat_a == cat_b | ||
}, | ||
// infer and error are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: incomplete sentence... "infer and error are fuzzy equal to all types", I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: incomplete sentence... "infer and error are fuzzy equal to all types", I guess?
Looks great! r=me after nits and once we settle on a good wording for the error message :) |
363ff9c
to
b344c71
Compare
|
@@ -523,8 +523,7 @@ impl<T> SliceExt for [T] { | |||
} | |||
|
|||
#[stable(feature = "rust1", since = "1.0.0")] | |||
#[allow(unused_attributes)] | |||
#[rustc_on_unimplemented = "a usize is required to index into a slice"] | |||
#[rustc_on_unimplemented = "slice indices are of type usize"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: usize
@bors r=nikomatsakis |
📌 Commit b344c71 has been approved by |
r=me modulo nit |
@bors r=nikomatsakis |
📌 Commit b9a201c has been approved by |
implement fuzzy matching in on_unimplemented Fixes #31062 r? @nikomatsakis
Fixes #31062
r? @nikomatsakis