···158 pub fn to_diagnostic(&self) -> Diagnostic {
159 match self {
160 Self::Parse { path, warning, src } => match warning {
161- crate::parse::Warning::DeprecatedOptionBitString { location } => {
162- let text = "This option has been replaced by the `bits` option.\n".into();
163- Diagnostic {
164- title: "Deprecated bit literal option".into(),
165- text,
166- hint: Some("Run `gleam format` to auto-fix your code.".into()),
167- level: diagnostic::Level::Warning,
168- location: Some(Location {
169- path: path.to_path_buf(),
170- src: src.clone(),
171- label: diagnostic::Label {
172- text: None,
173- span: *location,
174- },
175- extra_labels: Vec::new(),
176- }),
177- }
178- }
179-180- crate::parse::Warning::DeprecatedOptionBinary { location } => {
181- let text = "This option has been replaced by the `bytes` option.\n".into();
182- Diagnostic {
183- title: "Deprecated bit literal option".into(),
184- text,
185- hint: Some("Run `gleam format` to auto-fix your code.".into()),
186- level: diagnostic::Level::Warning,
187- location: Some(Location {
188- path: path.to_path_buf(),
189- src: src.clone(),
190- label: diagnostic::Label {
191- text: None,
192- span: *location,
193- },
194- extra_labels: Vec::new(),
195- }),
196- }
197- }
198 crate::parse::Warning::ReservedWord { location, word } => {
199 let text = format!(
200 "The word `{word}` has been reserved for future use.
···158 pub fn to_diagnostic(&self) -> Diagnostic {
159 match self {
160 Self::Parse { path, warning, src } => match warning {
0000000000000000000000000000000000000161 crate::parse::Warning::ReservedWord { location, word } => {
162 let text = format!(
163 "The word `{word}` has been reserved for future use.