diff options
| author | bors <bors@rust-lang.org> | 2020-11-28 15:17:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-28 15:17:13 +0000 |
| commit | e37f25aa3f356546ab851e394d5598fc575eabda (patch) | |
| tree | 74c4ea90fdc836713c72cb393d1b8f442dd0e4c4 /src | |
| parent | 4ae328bef47dffcbf363e5ae873f419c06a5511d (diff) | |
| parent | 208d680f771601cf5efb6a7bfb49cb2b9e655d3e (diff) | |
| download | rust-e37f25aa3f356546ab851e394d5598fc575eabda.tar.gz rust-e37f25aa3f356546ab851e394d5598fc575eabda.zip | |
Auto merge of #79507 - jonas-schievink:rollup-e5yeayh, r=jonas-schievink
Rollup of 10 pull requests Successful merges: - #78086 (Improve doc for 'as _') - #78853 (rustc_parse: fix ConstBlock expr span) - #79234 (Resolve typedefs in HashMap gdb/lldb pretty-printers) - #79344 (Convert UNC path to local path to satisfy install script on Windows) - #79383 (Fix bold code formatting in keyword docs) - #79460 (Remove intermediate vectors from `add_bounds`) - #79474 (Change comments on types to doc-comments) - #79476 (Sync rustc_codegen_cranelift) - #79478 (Expand docs on Peekable::peek_mut) - #79486 (Slightly improve code samples in E0591) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/dist.rs | 6 | ||||
| -rw-r--r-- | src/etc/gdb_providers.py | 2 | ||||
| -rw-r--r-- | src/etc/lldb_providers.py | 2 | ||||
| -rw-r--r-- | src/test/ui/explain.stdout | 18 |
4 files changed, 20 insertions, 8 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 9b77e38a847..354be109cf2 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1183,7 +1183,11 @@ impl Step for PlainSourceTarball { // characters and on `C:\` paths, so normalize both of them away. pub fn sanitize_sh(path: &Path) -> String { let path = path.to_str().unwrap().replace("\\", "/"); - return change_drive(&path).unwrap_or(path); + return change_drive(unc_to_lfs(&path)).unwrap_or(path); + + fn unc_to_lfs(s: &str) -> &str { + if s.starts_with("//?/") { &s[4..] } else { s } + } fn change_drive(s: &str) -> Option<String> { let mut ch = s.chars(); diff --git a/src/etc/gdb_providers.py b/src/etc/gdb_providers.py index b74d47a8002..cabf5dccbfe 100644 --- a/src/etc/gdb_providers.py +++ b/src/etc/gdb_providers.py @@ -352,7 +352,7 @@ class StdHashMapProvider: ctrl = table["ctrl"]["pointer"] self.size = int(table["items"]) - self.pair_type = table.type.template_argument(0) + self.pair_type = table.type.template_argument(0).strip_typedefs() self.new_layout = not table.type.has_key("data") if self.new_layout: diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py index 64cb9837943..9c7b07efbaa 100644 --- a/src/etc/lldb_providers.py +++ b/src/etc/lldb_providers.py @@ -531,7 +531,7 @@ class StdHashMapSyntheticProvider: ctrl = table.GetChildMemberWithName("ctrl").GetChildAtIndex(0) self.size = table.GetChildMemberWithName("items").GetValueAsUnsigned() - self.pair_type = table.type.template_args[0] + self.pair_type = table.type.template_args[0].GetTypedefedType() self.pair_type_size = self.pair_type.GetByteSize() self.new_layout = not table.GetChildMemberWithName("data").IsValid() diff --git a/src/test/ui/explain.stdout b/src/test/ui/explain.stdout index c50c46ee564..62f1a7f98ea 100644 --- a/src/test/ui/explain.stdout +++ b/src/test/ui/explain.stdout @@ -1,12 +1,18 @@ Per [RFC 401][rfc401], if you have a function declaration `foo`: ``` +struct S; + // For the purposes of this explanation, all of these // different kinds of `fn` declarations are equivalent: -struct S; + fn foo(x: S) { /* ... */ } -extern "C" { fn foo(x: S); } -impl S { fn foo(self) { /* ... */ } } +extern "C" { + fn foo(x: S); +} +impl S { + fn foo(self) { /* ... */ } +} ``` the type of `foo` is **not** `fn(S)`, as one might expect. @@ -34,8 +40,10 @@ extern "C" fn foo(userdata: Box<i32>) { /* ... */ } -let f: extern "C" fn(*mut i32) = transmute(foo); -callback(f); +unsafe { + let f: extern "C" fn(*mut i32) = transmute(foo); + callback(f); +} ``` Here, transmute is being used to convert the types of the fn arguments. |
