Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0cd54b85
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0cd54b85
编写于
2月 18, 2015
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Round 5 test fixes and rebase conflicts
上级
cb29c468
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
52 addition
and
10 deletion
+52
-10
src/libcore/hash/mod.rs
src/libcore/hash/mod.rs
+2
-2
src/libstd/old_io/process.rs
src/libstd/old_io/process.rs
+13
-1
src/libstd/os.rs
src/libstd/os.rs
+3
-2
src/libstd/sys/unix/os.rs
src/libstd/sys/unix/os.rs
+1
-1
src/libstd/sys/windows/backtrace.rs
src/libstd/sys/windows/backtrace.rs
+2
-2
src/libstd/sys/windows/process.rs
src/libstd/sys/windows/process.rs
+29
-0
src/test/compile-fail/regions-assoc-type-outlives-container-hrtb.rs
...ompile-fail/regions-assoc-type-outlives-container-hrtb.rs
+1
-1
src/test/run-make/save-analysis/foo.rs
src/test/run-make/save-analysis/foo.rs
+1
-1
未找到文件。
src/libcore/hash/mod.rs
浏览文件 @
0cd54b85
...
...
@@ -158,7 +158,7 @@ fn write_u64(&mut self, i: u64) {
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_usize
(
&
mut
self
,
i
:
usize
)
{
if
cfg!
(
target_pointer_
size
=
"32"
)
{
if
cfg!
(
target_pointer_
width
=
"32"
)
{
self
.write_u32
(
i
as
u32
)
}
else
{
self
.write_u64
(
i
as
u64
)
...
...
@@ -241,7 +241,7 @@ impl<S: Writer + Hasher> Hash<S> for $ty {
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
let
a
:
[
u8
;
::
$ty
::
BYTES
]
=
unsafe
{
mem
::
transmute
(
(
*
self
as
$uty
)
.to_le
()
as
$ty
)
mem
::
transmute
(
*
self
)
};
state
.write
(
&
a
)
}
...
...
src/libstd/old_io/process.rs
浏览文件 @
0cd54b85
...
...
@@ -104,7 +104,7 @@ pub struct Process {
#[derive(Eq,
Clone,
Debug)]
struct
EnvKey
(
CString
);
#[cfg(
windows
)]
#[cfg(
all(windows,
stage0)
)]
impl
<
H
:
hash
::
Writer
+
hash
::
Hasher
>
hash
::
Hash
<
H
>
for
EnvKey
{
fn
hash
(
&
self
,
state
:
&
mut
H
)
{
let
&
EnvKey
(
ref
x
)
=
self
;
...
...
@@ -116,6 +116,18 @@ fn hash(&self, state: &mut H) {
}
}
}
#[cfg(all(windows,
not(stage0)))]
impl
hash
::
Hash
for
EnvKey
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
let
&
EnvKey
(
ref
x
)
=
self
;
match
str
::
from_utf8
(
x
.as_bytes
())
{
Ok
(
s
)
=>
for
ch
in
s
.chars
()
{
(
ch
as
u8
as
char
)
.to_lowercase
()
.hash
(
state
);
},
Err
(
..
)
=>
x
.hash
(
state
)
}
}
}
#[cfg(windows)]
impl
PartialEq
for
EnvKey
{
...
...
src/libstd/os.rs
浏览文件 @
0cd54b85
...
...
@@ -561,10 +561,11 @@ pub fn get_exit_status() -> int {
#[cfg(target_os
=
"macos"
)]
unsafe
fn
load_argc_and_argv
(
argc
:
int
,
argv
:
*
const
*
const
c_char
)
->
Vec
<
Vec
<
u8
>>
{
use
ffi
::
CStr
;
use
iter
::
range
;
(
0
..
argc
as
uint
)
.map
(|
i
|
{
ffi
::
c_str_to_bytes
(
&*
argv
.offset
(
i
as
int
)
)
.to_vec
()
(
0
..
argc
)
.map
(|
i
|
{
CStr
::
from_ptr
(
*
argv
.offset
(
i
))
.to_bytes
(
)
.to_vec
()
})
.collect
()
}
...
...
src/libstd/sys/unix/os.rs
浏览文件 @
0cd54b85
...
...
@@ -266,7 +266,7 @@ pub fn args() -> Args {
let
(
argc
,
argv
)
=
(
*
_
NSGetArgc
()
as
isize
,
*
_
NSGetArgv
()
as
*
const
*
const
c_char
);
range
(
0
,
argc
as
isize
)
.map
(|
i
|
{
let
bytes
=
CStr
::
from_ptr
(
&
*
argv
.offset
(
i
))
.to_bytes
()
.to_vec
();
let
bytes
=
CStr
::
from_ptr
(
*
argv
.offset
(
i
))
.to_bytes
()
.to_vec
();
OsStringExt
::
from_vec
(
bytes
)
})
.collect
::
<
Vec
<
_
>>
()
};
...
...
src/libstd/sys/windows/backtrace.rs
浏览文件 @
0cd54b85
...
...
@@ -25,7 +25,7 @@
#![allow(dead_code)]
use
dynamic_lib
::
DynamicLibrary
;
use
ffi
;
use
ffi
::
CStr
;
use
intrinsics
;
use
old_io
::{
IoResult
,
Writer
};
use
libc
;
...
...
@@ -362,7 +362,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
if
ret
==
libc
::
TRUE
{
try!
(
write!
(
w
,
" - "
));
let
ptr
=
info
.Name
.as_ptr
()
as
*
const
libc
::
c_char
;
let
bytes
=
unsafe
{
ffi
::
c_str_to_bytes
(
&
ptr
)
};
let
bytes
=
unsafe
{
CStr
::
from_ptr
(
ptr
)
.to_bytes
(
)
};
match
str
::
from_utf8
(
bytes
)
{
Ok
(
s
)
=>
try!
(
demangle
(
w
,
s
)),
Err
(
..
)
=>
try!
(
w
.write_all
(
&
bytes
[
..
bytes
.len
()
-
1
])),
...
...
src/libstd/sys/windows/process.rs
浏览文件 @
0cd54b85
...
...
@@ -589,6 +589,7 @@ fn backslash_run_ends_in_quote(s: &[char], mut i: uint) -> bool {
}
}
#[cfg(stage0)]
fn
with_envp
<
K
,
V
,
T
,
F
>
(
env
:
Option
<&
collections
::
HashMap
<
K
,
V
>>
,
cb
:
F
)
->
T
where
K
:
BytesContainer
+
Eq
+
Hash
<
Hasher
>
,
V
:
BytesContainer
,
...
...
@@ -616,6 +617,34 @@ fn with_envp<K, V, T, F>(env: Option<&collections::HashMap<K, V>>, cb: F) -> T
_
=>
cb
(
ptr
::
null_mut
())
}
}
#[cfg(not(stage0))]
fn
with_envp
<
K
,
V
,
T
,
F
>
(
env
:
Option
<&
collections
::
HashMap
<
K
,
V
>>
,
cb
:
F
)
->
T
where
K
:
BytesContainer
+
Eq
+
Hash
,
V
:
BytesContainer
,
F
:
FnOnce
(
*
mut
c_void
)
->
T
,
{
// On Windows we pass an "environment block" which is not a char**, but
// rather a concatenation of null-terminated k=v\0 sequences, with a final
// \0 to terminate.
match
env
{
Some
(
env
)
=>
{
let
mut
blk
=
Vec
::
new
();
for
pair
in
env
{
let
kv
=
format!
(
"{}={}"
,
pair
.0
.container_as_str
()
.unwrap
(),
pair
.1
.container_as_str
()
.unwrap
());
blk
.extend
(
kv
.utf16_units
());
blk
.push
(
0
);
}
blk
.push
(
0
);
cb
(
blk
.as_mut_ptr
()
as
*
mut
c_void
)
}
_
=>
cb
(
ptr
::
null_mut
())
}
}
fn
with_dirp
<
T
,
F
>
(
d
:
Option
<&
CString
>
,
cb
:
F
)
->
T
where
F
:
FnOnce
(
*
const
u16
)
->
T
,
...
...
src/test/compile-fail/regions-assoc-type-outlives-container-hrtb.rs
浏览文件 @
0cd54b85
...
...
@@ -18,7 +18,7 @@
///////////////////////////////////////////////////////////////////////////
pub
trait
TheTrait
<
'b
>
:
PhantomFn
<
Self
,
Self
>
{
pub
trait
TheTrait
<
'b
>
:
PhantomFn
<
&
'b
Self
,
Self
>
{
type
TheAssocType
;
}
...
...
src/test/run-make/save-analysis/foo.rs
浏览文件 @
0cd54b85
...
...
@@ -34,7 +34,7 @@
static
uni
:
&
'static
str
=
"Les Miséééééééérables"
;
static
yy
:
usize
=
25
;
static
bob
:
Option
<
std
::
borrow
::
Cow
<
'static
,
[
isize
]
>
>
=
None
;
static
bob
:
Option
<
&
'static
[
isize
]
>
=
None
;
// buglink test - see issue #1337.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录