Change type and field name to be clearer
This commit is contained in:
parent
18388c9f73
commit
668a62984a
@ -484,7 +484,7 @@ pub(crate) struct MacroExpectedFound<'a> {
|
|||||||
#[subdiagnostic]
|
#[subdiagnostic]
|
||||||
pub(crate) remove_surrounding_derive: Option<RemoveSurroundingDerive>,
|
pub(crate) remove_surrounding_derive: Option<RemoveSurroundingDerive>,
|
||||||
#[subdiagnostic]
|
#[subdiagnostic]
|
||||||
pub(crate) remove_surrounding_derive_help: Option<RemoveAddAsNonDerive<'a>>,
|
pub(crate) add_as_non_derive: Option<AddAsNonDerive<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subdiagnostic)]
|
#[derive(Subdiagnostic)]
|
||||||
@ -496,6 +496,6 @@ pub(crate) struct RemoveSurroundingDerive {
|
|||||||
|
|
||||||
#[derive(Subdiagnostic)]
|
#[derive(Subdiagnostic)]
|
||||||
#[help(resolve_add_as_non_derive)]
|
#[help(resolve_add_as_non_derive)]
|
||||||
pub(crate) struct RemoveAddAsNonDerive<'a> {
|
pub(crate) struct AddAsNonDerive<'a> {
|
||||||
pub(crate) macro_path: &'a str,
|
pub(crate) macro_path: &'a str,
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! A bunch of methods and structures more or less related to resolving macros and
|
//! A bunch of methods and structures more or less related to resolving macros and
|
||||||
//! interface provided by `Resolver` to macro expander.
|
//! interface provided by `Resolver` to macro expander.
|
||||||
|
|
||||||
use crate::errors::{MacroExpectedFound, RemoveAddAsNonDerive, RemoveSurroundingDerive};
|
use crate::errors::{AddAsNonDerive, MacroExpectedFound, RemoveSurroundingDerive};
|
||||||
use crate::Namespace::*;
|
use crate::Namespace::*;
|
||||||
use crate::{BuiltinMacroState, Determinacy};
|
use crate::{BuiltinMacroState, Determinacy};
|
||||||
use crate::{DeriveData, Finalize, ParentScope, ResolutionError, Resolver, ScopeSet};
|
use crate::{DeriveData, Finalize, ParentScope, ResolutionError, Resolver, ScopeSet};
|
||||||
@ -559,8 +559,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||||||
&& ext.macro_kind() != MacroKind::Derive
|
&& ext.macro_kind() != MacroKind::Derive
|
||||||
{
|
{
|
||||||
err.remove_surrounding_derive = Some(RemoveSurroundingDerive { span: path.span });
|
err.remove_surrounding_derive = Some(RemoveSurroundingDerive { span: path.span });
|
||||||
err.remove_surrounding_derive_help =
|
err.add_as_non_derive = Some(AddAsNonDerive { macro_path: &path_str });
|
||||||
Some(RemoveAddAsNonDerive { macro_path: &path_str });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut err = self.tcx.sess.create_err(err);
|
let mut err = self.tcx.sess.create_err(err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user