mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-01 21:21:10 +00:00
Add AtomicStr
This commit is contained in:
parent
fb36c0d633
commit
fe1b0fab70
11 changed files with 300 additions and 105 deletions
|
@ -6,10 +6,10 @@ use std::fmt;
|
|||
use std::fmt::Write as _;
|
||||
use std::io::{stderr, BufWriter, Write as _};
|
||||
|
||||
use crate::astr::AtomicStr;
|
||||
use crate::color::*;
|
||||
use crate::config::Input;
|
||||
use crate::traits::{Locational, Stream};
|
||||
use crate::Str;
|
||||
use crate::{fmt_option, impl_display_from_debug, switch_lang};
|
||||
|
||||
/// ErrorKindと言っているが、ErrorだけでなくWarning, Exceptionも含まれる
|
||||
|
@ -306,17 +306,17 @@ pub struct ErrorCore {
|
|||
pub errno: usize,
|
||||
pub kind: ErrorKind,
|
||||
pub loc: Location,
|
||||
pub desc: Str,
|
||||
pub hint: Option<Str>,
|
||||
pub desc: AtomicStr,
|
||||
pub hint: Option<AtomicStr>,
|
||||
}
|
||||
|
||||
impl ErrorCore {
|
||||
pub fn new<S: Into<Str>>(
|
||||
pub fn new<S: Into<AtomicStr>>(
|
||||
errno: usize,
|
||||
kind: ErrorKind,
|
||||
loc: Location,
|
||||
desc: S,
|
||||
hint: Option<Str>,
|
||||
hint: Option<AtomicStr>,
|
||||
) -> Self {
|
||||
Self {
|
||||
errno,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue