Skip to content

Commit 31262c2

Browse files
Arguments are now passed directly to the function instead of the enum variants
1 parent c5f7c19 commit 31262c2

File tree

3 files changed

+197
-196
lines changed

3 files changed

+197
-196
lines changed

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
209209
// had the duplicate.
210210
let ns = ns.unwrap();
211211
::resolve_error(
212+
self,
213+
sp,
212214
&::ResolutionError::DuplicateDefinition(
213-
self,
214-
sp,
215215
namespace_error_to_string(duplicate_type),
216216
&*token::get_name(name))
217217
);
@@ -307,9 +307,9 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
307307
full_path.segments.last().unwrap().identifier.name;
308308
if &token::get_name(source_name)[..] == "mod" ||
309309
&token::get_name(source_name)[..] == "self" {
310-
::resolve_error(&::ResolutionError::SelfImportsOnlyAllowedWithin(
311-
self,
312-
view_path.span)
310+
::resolve_error(self,
311+
view_path.span,
312+
&::ResolutionError::SelfImportsOnlyAllowedWithin
313313
);
314314
}
315315

@@ -331,9 +331,9 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
331331
}).collect::<Vec<Span>>();
332332
if mod_spans.len() > 1 {
333333
::resolve_error(
334-
&::ResolutionError::SelfImportCanOnlyAppearOnceInTheList(
335-
self,
336-
mod_spans[0])
334+
self,
335+
mod_spans[0],
336+
&::ResolutionError::SelfImportCanOnlyAppearOnceInTheList
337337
);
338338
for other_span in mod_spans.iter().skip(1) {
339339
self.session.span_note(*other_span,
@@ -350,10 +350,10 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
350350
Some(name) => *name,
351351
None => {
352352
::resolve_error(
353+
self,
354+
source_item.span,
353355
&::ResolutionError::
354-
SelfImportOnlyInImportListWithNonEmptyPrefix(
355-
self,
356-
source_item.span)
356+
SelfImportOnlyInImportListWithNonEmptyPrefix
357357
);
358358
continue;
359359
}

0 commit comments

Comments
 (0)