tangled
alpha
login
or
join now
daniellemaywood.uk
/
gleam
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
Remove constructor
Louis Pilfold
2 years ago
bc83ef61
feb4f934
-41
2 changed files
expand all
collapse all
unified
split
compiler-core
src
parse.rs
warning.rs
-4
compiler-core/src/parse.rs
···
96
96
97
97
#[derive(Debug, Eq, PartialEq, Clone)]
98
98
pub enum Warning {
99
99
-
// TODO: remove after next release
100
100
-
DeprecatedOptionBitString { location: SrcSpan },
101
101
-
// TODO: remove after next release
102
102
-
DeprecatedOptionBinary { location: SrcSpan },
103
99
ReservedWord { location: SrcSpan, word: EcoString },
104
100
}
105
101
-37
compiler-core/src/warning.rs
···
158
158
pub fn to_diagnostic(&self) -> Diagnostic {
159
159
match self {
160
160
Self::Parse { path, warning, src } => match warning {
161
161
-
crate::parse::Warning::DeprecatedOptionBitString { location } => {
162
162
-
let text = "This option has been replaced by the `bits` option.\n".into();
163
163
-
Diagnostic {
164
164
-
title: "Deprecated bit literal option".into(),
165
165
-
text,
166
166
-
hint: Some("Run `gleam format` to auto-fix your code.".into()),
167
167
-
level: diagnostic::Level::Warning,
168
168
-
location: Some(Location {
169
169
-
path: path.to_path_buf(),
170
170
-
src: src.clone(),
171
171
-
label: diagnostic::Label {
172
172
-
text: None,
173
173
-
span: *location,
174
174
-
},
175
175
-
extra_labels: Vec::new(),
176
176
-
}),
177
177
-
}
178
178
-
}
179
179
-
180
180
-
crate::parse::Warning::DeprecatedOptionBinary { location } => {
181
181
-
let text = "This option has been replaced by the `bytes` option.\n".into();
182
182
-
Diagnostic {
183
183
-
title: "Deprecated bit literal option".into(),
184
184
-
text,
185
185
-
hint: Some("Run `gleam format` to auto-fix your code.".into()),
186
186
-
level: diagnostic::Level::Warning,
187
187
-
location: Some(Location {
188
188
-
path: path.to_path_buf(),
189
189
-
src: src.clone(),
190
190
-
label: diagnostic::Label {
191
191
-
text: None,
192
192
-
span: *location,
193
193
-
},
194
194
-
extra_labels: Vec::new(),
195
195
-
}),
196
196
-
}
197
197
-
}
198
161
crate::parse::Warning::ReservedWord { location, word } => {
199
162
let text = format!(
200
163
"The word `{word}` has been reserved for future use.