Skip to content

Commit 36bdfdc

Browse files
committed
Don't return a BoxedResolver on errors
1 parent 9d9ccec commit 36bdfdc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub struct BoxedResolver {
128128
}
129129

130130
impl BoxedResolver {
131-
fn new<T>(generator: T) -> (Result<ast::Crate>, Self)
131+
fn new<T>(generator: T) -> Result<(ast::Crate, Self)>
132132
where
133133
T: ::std::ops::Generator<
134134
Action,
@@ -144,7 +144,7 @@ impl BoxedResolver {
144144
_ => panic!(),
145145
};
146146

147-
(init, BoxedResolver { generator })
147+
init.map(|init| (init, BoxedResolver { generator }))
148148
}
149149

150150
pub fn access<F: for<'a> FnOnce(&mut Resolver<'a>) -> R, R>(&mut self, f: F) -> R {
@@ -206,7 +206,7 @@ pub fn configure_and_expand(
206206
// its contents but the results of name resolution on those contents. Hopefully we'll push
207207
// this back at some point.
208208
let crate_name = crate_name.to_string();
209-
let (result, resolver) = BoxedResolver::new(static move |mut action| {
209+
BoxedResolver::new(static move |mut action| {
210210
let _ = action;
211211
let sess = &*sess;
212212
let resolver_arenas = Resolver::arenas();
@@ -248,8 +248,7 @@ pub fn configure_and_expand(
248248
}
249249

250250
resolver.into_outputs()
251-
});
252-
result.map(|k| (k, resolver))
251+
})
253252
}
254253

255254
pub fn register_plugins<'a>(

0 commit comments

Comments
 (0)