Skip to content

Commit 5568d8a

Browse files
committed
---
yaml --- r: 272617 b: refs/heads/auto c: 3238b4b h: refs/heads/master i: 272615: 45c0a84
1 parent 008552e commit 5568d8a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: faea5ff6efae623c052e59120d18306cc6d9fd4a
11+
refs/heads/auto: 3238b4bbbdd5b0a8c64ebeaedfa989d1babb3c21
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc_resolve/resolve_imports.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ impl<'a> ::ModuleS<'a> {
317317
fn update_resolution<T, F>(&self, name: Name, ns: Namespace, update: F) -> T
318318
where F: FnOnce(&mut NameResolution<'a>) -> T
319319
{
320+
// Ensure that `resolution` isn't borrowed during `define_in_glob_importers`,
321+
// where it might end up getting re-defined via a glob cycle.
320322
let (new_binding, t) = {
321323
let mut resolution = &mut *self.resolution(name, ns).borrow_mut();
322324
let was_known = resolution.binding().is_some();
@@ -650,6 +652,8 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
650652
// Add to target_module's glob_importers
651653
target_module.glob_importers.borrow_mut().push((module_, directive));
652654

655+
// Ensure that `resolutions` isn't borrowed during `try_define_child`,
656+
// since it might get updated via a glob cycle.
653657
let bindings = target_module.resolutions.borrow().iter().filter_map(|(name, resolution)| {
654658
resolution.borrow().binding().map(|binding| (*name, binding))
655659
}).collect::<Vec<_>>();

0 commit comments

Comments
 (0)