Skip to content

Commit e13429e

Browse files
committed
---
yaml --- r: 277039 b: refs/heads/try c: 3238b4b h: refs/heads/master i: 277037: bdac99a 277035: 405e1b2 277031: f3d069e 277023: e606f00
1 parent f00736b commit e13429e

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: faea5ff6efae623c052e59120d18306cc6d9fd4a
4+
refs/heads/try: 3238b4bbbdd5b0a8c64ebeaedfa989d1babb3c21
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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)