Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c109bed1
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,发现更多精彩内容 >>
提交
c109bed1
编写于
6月 25, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deny common lints by default for lib{std,extra}
上级
032dcc57
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
35 addition
and
33 deletion
+35
-33
mk/target.mk
mk/target.mk
+11
-2
src/libextra/term.rs
src/libextra/term.rs
+7
-7
src/libstd/libc.rs
src/libstd/libc.rs
+1
-1
src/libstd/os.rs
src/libstd/os.rs
+8
-13
src/libstd/rt/thread_local_storage.rs
src/libstd/rt/thread_local_storage.rs
+2
-2
src/libstd/run.rs
src/libstd/run.rs
+2
-3
src/libstd/task/spawn.rs
src/libstd/task/spawn.rs
+1
-1
src/libstd/to_str.rs
src/libstd/to_str.rs
+2
-2
src/libstd/unstable/dynamic_lib.rs
src/libstd/unstable/dynamic_lib.rs
+1
-2
未找到文件。
mk/target.mk
浏览文件 @
c109bed1
...
...
@@ -13,6 +13,15 @@
# this exists can be found on issue #2400
export
CFG_COMPILER_TRIPLE
# The standard libraries should be held up to a higher standard than any old
# code, make sure that these common warnings are denied by default. These can
# be overridden during development temporarily. For stage0, we allow all these
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
# NOTE: add "-A warnings" after snapshot to WFLAGS_ST0
WFLAGS_ST0
=
-A
unrecognized-lint
WFLAGS_ST1
=
-D
warnings
WFLAGS_ST2
=
-D
warnings
# TARGET_STAGE_N template: This defines how target artifacts are built
# for all stage/target architecture combinations. The arguments:
# $(1) is the stage
...
...
@@ -39,7 +48,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
$$(TSREQ$(1)_T_$(2)_H_$(3))
\
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(1)
_T_
$(2)
_H_
$(3)
)
-o
$$
@
$$
<
&&
touch
$$
@
$$
(
STAGE
$(1)
_T_
$(2)
_H_
$(3)
)
$$
(
WFLAGS_ST
$(1)
)
-o
$$
@
$$
<
&&
touch
$$
@
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
:
\
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS)
\
...
...
@@ -47,7 +56,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
$$(TSREQ$(1)_T_$(2)_H_$(3))
\
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(1)
_T_
$(2)
_H_
$(3)
)
-o
$$
@
$$
<
&&
touch
$$
@
$$
(
STAGE
$(1)
_T_
$(2)
_H_
$(3)
)
$$
(
WFLAGS_ST
$(1)
)
-o
$$
@
$$
<
&&
touch
$$
@
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3))
:
\
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS)
\
...
...
src/libextra/term.rs
浏览文件 @
c109bed1
...
...
@@ -15,12 +15,12 @@
use
core
::
prelude
::
*
;
use
core
::
io
;
use
core
::
os
;
use
terminfo
::
*
;
use
terminfo
::
searcher
::
open
;
use
terminfo
::
parser
::
compiled
::
parse
;
use
terminfo
::
parm
::{
expand
,
Number
,
Variables
};
#[cfg(not(target_os
=
"win32"
))]
use
core
::
os
;
#[cfg(not(target_os
=
"win32"
))]
use
terminfo
::
*
;
#[cfg(not(target_os
=
"win32"
))]
use
terminfo
::
searcher
::
open
;
#[cfg(not(target_os
=
"win32"
))]
use
terminfo
::
parser
::
compiled
::
parse
;
#[cfg(not(target_os
=
"win32"
))]
use
terminfo
::
parm
::{
expand
,
Number
,
Variables
};
// FIXME (#2807): Windows support.
...
...
@@ -122,10 +122,10 @@ pub fn new(out: @io::Writer) -> Result<Terminal, ~str> {
return
Ok
(
Terminal
{
out
:
out
,
color_supported
:
false
});
}
pub
fn
fg
(
&
self
,
color
:
u8
)
{
pub
fn
fg
(
&
self
,
_
color
:
u8
)
{
}
pub
fn
bg
(
&
self
,
color
:
u8
)
{
pub
fn
bg
(
&
self
,
_
color
:
u8
)
{
}
pub
fn
reset
(
&
self
)
{
...
...
src/libstd/libc.rs
浏览文件 @
c109bed1
...
...
@@ -568,7 +568,7 @@ pub mod extra {
pub
mod
os
{
pub
mod
common
{
pub
mod
posix01
{
use
libc
::
types
::
os
::
arch
::
c95
::
{
c_int
,
c_short
}
;
use
libc
::
types
::
os
::
arch
::
c95
::
c_short
;
use
libc
::
types
::
os
::
arch
::
extra
::{
int64
,
time64_t
};
use
libc
::
types
::
os
::
arch
::
posix88
::{
dev_t
,
ino_t
};
use
libc
::
types
::
os
::
arch
::
posix88
::
mode_t
;
...
...
src/libstd/os.rs
浏览文件 @
c109bed1
...
...
@@ -33,9 +33,8 @@
use
iterator
::
IteratorUtil
;
use
libc
;
use
libc
::{
c_char
,
c_void
,
c_int
,
size_t
};
use
libc
::
{
mode_t
,
FILE
}
;
use
libc
::
FILE
;
use
local_data
;
use
option
;
use
option
::{
Some
,
None
};
use
os
;
use
prelude
::
*
;
...
...
@@ -181,7 +180,6 @@ pub fn env() -> ~[(~str,~str)] {
unsafe
{
#[cfg(windows)]
unsafe
fn
get_env_pairs
()
->
~
[
~
str
]
{
use
libc
::
types
::
os
::
arch
::
extra
::
LPTCH
;
use
libc
::
funcs
::
extra
::
kernel32
::{
GetEnvironmentStringsA
,
FreeEnvironmentStringsA
...
...
@@ -248,10 +246,10 @@ pub fn getenv(n: &str) -> Option<~str> {
do
with_env_lock
{
let
s
=
str
::
as_c_str
(
n
,
|
s
|
libc
::
getenv
(
s
));
if
ptr
::
null
::
<
u8
>
()
==
cast
::
transmute
(
s
)
{
option
::
None
::
<~
str
>
None
::
<~
str
>
}
else
{
let
s
=
cast
::
transmute
(
s
);
option
::
Some
::
<~
str
>
(
str
::
raw
::
from_buf
(
s
))
Some
::
<~
str
>
(
str
::
raw
::
from_buf
(
s
))
}
}
}
...
...
@@ -540,7 +538,7 @@ fn secondary() -> Option<Path> {
#[cfg(windows)]
fn
secondary
()
->
Option
<
Path
>
{
do
getenv
(
~
"USERPROFILE"
)
.chain
|
p
|
{
do
getenv
(
"USERPROFILE"
)
.chain
|
p
|
{
if
!
p
.is_empty
()
{
Some
(
Path
(
p
))
}
else
{
...
...
@@ -647,9 +645,7 @@ fn mkdir(p: &Path, _mode: c_int) -> bool {
use
os
::
win32
::
as_utf16_p
;
// FIXME: turn mode into something useful? #2623
do
as_utf16_p
(
p
.to_str
())
|
buf
|
{
libc
::
CreateDirectoryW
(
buf
,
unsafe
{
cast
::
transmute
(
0
)
})
libc
::
CreateDirectoryW
(
buf
,
cast
::
transmute
(
0
))
!=
(
0
as
libc
::
BOOL
)
}
}
...
...
@@ -659,7 +655,7 @@ fn mkdir(p: &Path, _mode: c_int) -> bool {
fn
mkdir
(
p
:
&
Path
,
mode
:
c_int
)
->
bool
{
unsafe
{
do
as_c_charp
(
p
.to_str
())
|
c
|
{
libc
::
mkdir
(
c
,
mode
as
mode_t
)
==
(
0
as
c_int
)
libc
::
mkdir
(
c
,
mode
as
libc
::
mode_t
)
==
(
0
as
c_int
)
}
}
}
...
...
@@ -732,7 +728,6 @@ unsafe fn get_list(p: &Path) -> ~[~str] {
}
#[cfg(windows)]
unsafe
fn
get_list
(
p
:
&
Path
)
->
~
[
~
str
]
{
use
libc
::
types
::
os
::
arch
::
extra
::{
LPCTSTR
,
HANDLE
,
BOOL
};
use
libc
::
consts
::
os
::
extra
::
INVALID_HANDLE_VALUE
;
use
libc
::
wcslen
;
use
libc
::
funcs
::
extra
::
kernel32
::{
...
...
@@ -961,7 +956,7 @@ fn do_copy_file(from: &Path, to: &Path) -> bool {
// Give the new file the old file's permissions
if
do
str
::
as_c_str
(
to
.to_str
())
|
to_buf
|
{
libc
::
chmod
(
to_buf
,
from_mode
as
mode_t
)
libc
::
chmod
(
to_buf
,
from_mode
as
libc
::
mode_t
)
}
!=
0
{
return
false
;
// should be a condition...
}
...
...
@@ -1329,7 +1324,7 @@ fn default_glob_t () -> libc::glob_t {
/// Returns a vector of Path objects that match the given glob pattern
#[cfg(target_os
=
"win32"
)]
pub
fn
glob
(
pattern
:
&
str
)
->
~
[
Path
]
{
pub
fn
glob
(
_
pattern
:
&
str
)
->
~
[
Path
]
{
fail
!
(
"glob() is unimplemented on Windows"
)
}
...
...
src/libstd/rt/thread_local_storage.rs
浏览文件 @
c109bed1
...
...
@@ -60,13 +60,13 @@ pub unsafe fn get(key: Key) -> *mut c_void {
#[cfg(windows)]
pub
unsafe
fn
create
(
key
:
&
mut
Key
)
{
static
TLS_OUT_OF_INDEXES
:
DWORD
=
0xFFFFFFFF
;
*
key
=
unsafe
{
TlsAlloc
()
}
;
*
key
=
TlsAlloc
()
;
assert
!
(
*
key
!=
TLS_OUT_OF_INDEXES
);
}
#[cfg(windows)]
pub
unsafe
fn
set
(
key
:
Key
,
value
:
*
mut
c_void
)
{
unsafe
{
assert
!
(
0
!=
TlsSetValue
(
key
,
value
))
}
assert
!
(
0
!=
TlsSetValue
(
key
,
value
))
}
#[cfg(windows)]
...
...
src/libstd/run.rs
浏览文件 @
c109bed1
...
...
@@ -12,11 +12,10 @@
#[allow(missing_doc)]
;
use
iterator
::
IteratorUtil
;
use
cast
;
use
comm
::{
stream
,
SharedChan
,
GenericChan
,
GenericPort
};
use
int
;
use
io
;
use
iterator
::
IteratorUtil
;
use
libc
::{
pid_t
,
c_void
,
c_int
};
use
libc
;
use
option
::{
Some
,
None
};
...
...
@@ -465,7 +464,6 @@ fn spawn_process_os(prog: &str, args: &[~str],
use
libc
::
funcs
::
extra
::
msvcrt
::
get_osfhandle
;
use
sys
;
use
uint
;
unsafe
{
...
...
@@ -638,6 +636,7 @@ fn spawn_process_os(prog: &str, args: &[~str],
use
libc
::
funcs
::
posix88
::
unistd
::{
fork
,
dup2
,
close
,
chdir
,
execvp
};
use
libc
::
funcs
::
bsd44
::
getdtablesize
;
use
int
;
mod
rustrt
{
use
libc
::
c_void
;
...
...
src/libstd/task/spawn.rs
浏览文件 @
c109bed1
...
...
@@ -91,7 +91,7 @@
use
util
;
use
unstable
::
sync
::{
Exclusive
,
exclusive
};
use
rt
::
local
::
Local
;
use
iterator
::
{
IteratorUtil
}
;
use
iterator
::
IteratorUtil
;
#[cfg(test)]
use
task
::
default_task_opts
;
#[cfg(test)]
use
comm
;
...
...
src/libstd/to_str.rs
浏览文件 @
c109bed1
...
...
@@ -17,8 +17,8 @@
use
str
::
OwnedStr
;
use
hashmap
::
HashMap
;
use
hashmap
::
HashSet
;
use
iterator
::
IteratorUtil
;
use
hash
::
Hash
;
use
iterator
::
IteratorUtil
;
use
cmp
::
Eq
;
use
vec
::
ImmutableVector
;
...
...
@@ -177,7 +177,7 @@ fn to_str(&self) -> ~str {
mod
tests
{
use
hashmap
::
HashMap
;
use
hashmap
::
HashSet
;
use
container
::{
Set
,
Map
};
use
container
::{
Set
,
Map
};
#[test]
fn
test_simple_types
()
{
assert_eq!
(
1
i
.to_str
(),
~
"1"
);
...
...
src/libstd/unstable/dynamic_lib.rs
浏览文件 @
c109bed1
...
...
@@ -164,7 +164,6 @@ mod dl {
use
libc
;
use
path
;
use
ptr
;
use
str
;
use
task
;
use
result
::
*
;
...
...
@@ -175,7 +174,7 @@ pub unsafe fn open_external(filename: &path::Path) -> *libc::c_void {
}
pub
unsafe
fn
open_internal
()
->
*
libc
::
c_void
{
let
mut
handle
=
ptr
::
null
();
let
handle
=
ptr
::
null
();
GetModuleHandleExW
(
0
as
libc
::
DWORD
,
ptr
::
null
(),
&
handle
as
**
libc
::
c_void
);
handle
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录