Fix tests and rustdoc

This commit is contained in:
Nick Cameron 2018-09-12 13:44:22 +12:00
parent c480386391
commit cdcbdfdf0a
11 changed files with 28 additions and 24 deletions

View File

@ -4012,6 +4012,8 @@ fn push(&mut self, text: &str) {
def: def_ctor(def_id),
segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment {
ident: ast::Ident::from_str(&s),
id: None,
def: None,
args: None,
infer_types: false,
}).collect())

View File

@ -186,6 +186,8 @@ pub fn get_real_ty<F>(&self,
segments.push(hir::PathSegment::new(
real_name.unwrap_or(last.ident),
None,
None,
self.generics_to_path_params(generics.clone()),
false,
));

View File

@ -33,7 +33,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _2: ();
// let mut _3: [closure@NodeId(18) d:&'14s D];
// let mut _3: [closure@NodeId(28) d:&'14s D];
// let mut _4: &'14s D;
// bb0: {
// StorageLive(_1);
@ -42,7 +42,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// StorageLive(_3);
// StorageLive(_4);
// _4 = &'14s _1;
// _3 = [closure@NodeId(18)] { d: move _4 };
// _3 = [closure@NodeId(28)] { d: move _4 };
// StorageDead(_4);
// _2 = const foo(move _3) -> [return: bb2, unwind: bb3];
// }
@ -67,7 +67,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(18) d:&'14s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(28) d:&'14s D]) -> i32 {
// let mut _0: i32;
//
// bb0: {

View File

@ -33,7 +33,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _2: ();
// let mut _3: [closure@NodeId(22) d:&'19s D];
// let mut _3: [closure@NodeId(33) d:&'19s D];
// let mut _4: &'19s D;
// bb0: {
// StorageLive(_1);
@ -42,7 +42,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// StorageLive(_3);
// StorageLive(_4);
// _4 = &'19s _1;
// _3 = [closure@NodeId(22)] { d: move _4 };
// _3 = [closure@NodeId(33)] { d: move _4 };
// StorageDead(_4);
// _2 = const foo(move _3) -> [return: bb2, unwind: bb3];
// }
@ -66,7 +66,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(22) d:&'19s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) d:&'19s D]) -> i32 {
// let mut _0: i32;
// ...
// let _2: &'16_0rs D;

View File

@ -33,13 +33,13 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _2: ();
// let mut _3: [closure@NodeId(22) d:D];
// let mut _3: [closure@NodeId(33) d:D];
// bb0: {
// StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3);
// _3 = [closure@NodeId(22)] { d: move _1 };
// _3 = [closure@NodeId(33)] { d: move _1 };
// _2 = const foo(move _3) -> [return: bb2, unwind: bb4];
// }
// bb1: {
@ -67,7 +67,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(22) d:D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) d:D]) -> i32 {
// let mut _0: i32;
// ...
// let _2: &'16_0rs D;

View File

@ -36,7 +36,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _3: ();
// let mut _4: [closure@NodeId(22) r:&'19s D];
// let mut _4: [closure@NodeId(33) r:&'19s D];
// bb0: {
// StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,);
@ -45,7 +45,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// _2 = &'21_1rs _1;
// FakeRead(ForLet, _2);
// StorageLive(_4);
// _4 = [closure@NodeId(22)] { r: _2 };
// _4 = [closure@NodeId(33)] { r: _2 };
// _3 = const foo(move _4) -> [return: bb2, unwind: bb3];
// }
// bb1: {
@ -72,7 +72,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(22) r:&'19s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) r:&'19s D]) -> i32 {
// let mut _0: i32;
//
// bb0: {

View File

@ -30,7 +30,7 @@ fn foo<T: Copy>(_t: T, q: &i32) -> i32 {
// ...
// bb0: {
// ...
// _3 = [closure@NodeId(39)];
// _3 = [closure@NodeId(53)];
// ...
// _4 = &_3;
// ...

View File

@ -26,7 +26,7 @@ fn foo<T: Copy>(_t: T, q: i32) -> i32 {
// ...
// bb0: {
// ...
// _3 = [closure@NodeId(28)];
// _3 = [closure@NodeId(39)];
// ...
// _4 = &_3;
// ...

View File

@ -59,10 +59,10 @@ fn main() {
// }
// END rustc.main.EraseRegions.after.mir
// START rustc.main-{{closure}}.EraseRegions.after.mir
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(50)], _2: &ReErased mut i32) -> i32 {
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(65)], _2: &ReErased mut i32) -> i32 {
// ...
// bb0: {
// Validate(Acquire, [_1: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(50)], _2: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// Validate(Acquire, [_1: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(65)], _2: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// StorageLive(_3);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })), [(*_2): i32]);
// _3 = &ReErased (*_2);

View File

@ -48,11 +48,11 @@ fn main() {
// }
// END rustc.write_42.EraseRegions.after.mir
// START rustc.write_42-{{closure}}.EraseRegions.after.mir
// fn write_42::{{closure}}(_1: &ReErased [closure@NodeId(22)], _2: *mut i32) -> () {
// fn write_42::{{closure}}(_1: &ReErased [closure@NodeId(32)], _2: *mut i32) -> () {
// ...
// bb0: {
// Validate(Acquire, [_1: &ReFree(DefId(0/1:9 ~ validate_4[317d]::write_42[0]::{{closure}}[0]), BrEnv) [closure@NodeId(22)], _2: *mut i32]);
// Validate(Release, [_1: &ReFree(DefId(0/1:9 ~ validate_4[317d]::write_42[0]::{{closure}}[0]), BrEnv) [closure@NodeId(22)], _2: *mut i32]);
// Validate(Acquire, [_1: &ReFree(DefId(0/1:9 ~ validate_4[317d]::write_42[0]::{{closure}}[0]), BrEnv) [closure@NodeId(32)], _2: *mut i32]);
// Validate(Release, [_1: &ReFree(DefId(0/1:9 ~ validate_4[317d]::write_42[0]::{{closure}}[0]), BrEnv) [closure@NodeId(32)], _2: *mut i32]);
// (*_2) = const 23i32;
// _0 = ();
// return;
@ -76,11 +76,11 @@ fn main() {
// }
// END rustc.test.EraseRegions.after.mir
// START rustc.main-{{closure}}.EraseRegions.after.mir
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(60)], _2: &ReErased mut i32) -> bool {
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(80)], _2: &ReErased mut i32) -> bool {
// ...
// bb0: {
// Validate(Acquire, [_1: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(60)], _2: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// Validate(Release, [_1: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(60)], _2: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// Validate(Acquire, [_1: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(80)], _2: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// Validate(Release, [_1: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(80)], _2: &ReFree(DefId(0/1:10 ~ validate_4[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// StorageLive(_3);
// ...
// _0 = const write_42(move _3) -> bb1;

View File

@ -46,10 +46,10 @@ fn main() {
// }
// END rustc.test.EraseRegions.after.mir
// START rustc.main-{{closure}}.EraseRegions.after.mir
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(46)], _2: &ReErased mut i32) -> bool {
// fn main::{{closure}}(_1: &ReErased [closure@NodeId(62)], _2: &ReErased mut i32) -> bool {
// ...
// bb0: {
// Validate(Acquire, [_1: &ReFree(DefId(0/1:9 ~ validate_5[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(46)], _2: &ReFree(DefId(0/1:9 ~ validate_5[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// Validate(Acquire, [_1: &ReFree(DefId(0/1:9 ~ validate_5[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(62)], _2: &ReFree(DefId(0/1:9 ~ validate_5[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// StorageLive(_3);
// StorageLive(_4);
// StorageLive(_5);