mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
internal: reduce coupling
tt is a data structure, data structures cant' go wrong, they shouldn't have the knowledge that the world outside of them has all kinds of errors.
This commit is contained in:
parent
d8a3d6f378
commit
81602f8a5d
6 changed files with 25 additions and 32 deletions
|
@ -11,7 +11,7 @@ use std::{fmt, iter::FromIterator, ops, panic::RefUnwindSafe, str::FromStr, sync
|
|||
use cfg::CfgOptions;
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use syntax::SmolStr;
|
||||
use tt::{ExpansionError, Subtree};
|
||||
use tt::Subtree;
|
||||
use vfs::{file_set::FileSet, FileId, VfsPath};
|
||||
|
||||
/// Files are grouped into source roots. A source root is a directory on the
|
||||
|
@ -163,7 +163,13 @@ pub trait ProcMacroExpander: fmt::Debug + Send + Sync + RefUnwindSafe {
|
|||
subtree: &Subtree,
|
||||
attrs: Option<&Subtree>,
|
||||
env: &Env,
|
||||
) -> Result<Subtree, ExpansionError>;
|
||||
) -> Result<Subtree, ProcMacroExpansionError>;
|
||||
}
|
||||
|
||||
pub enum ProcMacroExpansionError {
|
||||
Panic(String),
|
||||
/// Things like "proc macro server was killed by OOM".
|
||||
System(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue