mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Auto merge of #149350 - Jarcho:derive_recv_ctxt, r=jackh726
Mark method receivers in builtin derives as being from the derive. Another small annoyance while working on clippy. This was clearly using the root context on purpose, but it also has no reason to do so. All the uses of the receiver are generated by the macros so they can just use the marked context rather than the root.
This commit is contained in:
@@ -1052,7 +1052,7 @@ fn create_method(
|
||||
|
||||
let args = {
|
||||
let self_arg = explicit_self.map(|explicit_self| {
|
||||
let ident = Ident::with_dummy_span(kw::SelfLower).with_span_pos(span);
|
||||
let ident = Ident::new(kw::SelfLower, span);
|
||||
ast::Param::from_self(ast::AttrVec::default(), explicit_self, ident)
|
||||
});
|
||||
let nonself_args =
|
||||
|
||||
@@ -315,7 +315,7 @@ pub fn expr_ident(&self, span: Span, id: Ident) -> Box<ast::Expr> {
|
||||
self.expr_path(self.path_ident(span, id))
|
||||
}
|
||||
pub fn expr_self(&self, span: Span) -> Box<ast::Expr> {
|
||||
self.expr_ident(span, Ident::with_dummy_span(kw::SelfLower))
|
||||
self.expr_ident(span, Ident::new(kw::SelfLower, span))
|
||||
}
|
||||
|
||||
pub fn expr_macro_call(&self, span: Span, call: Box<ast::MacCall>) -> Box<ast::Expr> {
|
||||
|
||||
@@ -272,6 +272,7 @@ LL | impl<T: NotNull> IntoNullable for T {
|
||||
| ------- ^^^^^^^^^^^^ ^
|
||||
| |
|
||||
| unsatisfied trait bound introduced here
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
|
||||
--> $DIR/issue-38821.rs:23:23
|
||||
@@ -301,6 +302,7 @@ LL | impl<T: NotNull> IntoNullable for T {
|
||||
| ------- ^^^^^^^^^^^^ ^
|
||||
| |
|
||||
| unsatisfied trait bound introduced here
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
|
||||
--> $DIR/issue-38821.rs:23:10
|
||||
|
||||
Reference in New Issue
Block a user