Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
96bcdac9
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,发现更多精彩内容 >>
提交
96bcdac9
编写于
6月 25, 2017
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make sufficiently old or low-impact compatibility lints deny-by-default
上级
affb8ee8
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
24 addition
and
73 deletion
+24
-73
src/librustc/lint/builtin.rs
src/librustc/lint/builtin.rs
+7
-7
src/test/compile-fail/defaulted-unit-warning.rs
src/test/compile-fail/defaulted-unit-warning.rs
+1
-4
src/test/compile-fail/directory_ownership/backcompat-warnings.rs
...t/compile-fail/directory_ownership/backcompat-warnings.rs
+0
-4
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
+3
-5
src/test/compile-fail/issue-32995-2.rs
src/test/compile-fail/issue-32995-2.rs
+1
-8
src/test/compile-fail/issue-32995.rs
src/test/compile-fail/issue-32995.rs
+1
-16
src/test/compile-fail/issue-38293.rs
src/test/compile-fail/issue-38293.rs
+0
-1
src/test/compile-fail/issue-39404.rs
src/test/compile-fail/issue-39404.rs
+1
-3
src/test/compile-fail/no-patterns-in-args-2.rs
src/test/compile-fail/no-patterns-in-args-2.rs
+1
-2
src/test/compile-fail/safe-extern-statics-mut.rs
src/test/compile-fail/safe-extern-statics-mut.rs
+0
-3
src/test/compile-fail/safe-extern-statics.rs
src/test/compile-fail/safe-extern-statics.rs
+0
-1
src/test/compile-fail/type-parameter-invalid-lint.rs
src/test/compile-fail/type-parameter-invalid-lint.rs
+0
-1
src/test/ui/compare-method/proj-outlives-region.rs
src/test/ui/compare-method/proj-outlives-region.rs
+0
-3
src/test/ui/compare-method/proj-outlives-region.stderr
src/test/ui/compare-method/proj-outlives-region.stderr
+3
-3
src/test/ui/compare-method/region-extra.rs
src/test/ui/compare-method/region-extra.rs
+0
-3
src/test/ui/compare-method/region-extra.stderr
src/test/ui/compare-method/region-extra.stderr
+3
-3
src/test/ui/compare-method/region-unrelated.rs
src/test/ui/compare-method/region-unrelated.rs
+0
-3
src/test/ui/compare-method/region-unrelated.stderr
src/test/ui/compare-method/region-unrelated.stderr
+3
-3
未找到文件。
src/librustc/lint/builtin.rs
浏览文件 @
96bcdac9
...
...
@@ -144,20 +144,20 @@
declare_lint!
{
pub
RESOLVE_TRAIT_ON_DEFAULTED_UNIT
,
Warn
,
Deny
,
"attempt to resolve a trait on an expression whose type cannot be inferred but which
\
currently defaults to ()"
}
declare_lint!
{
pub
SAFE_EXTERN_STATICS
,
Warn
,
Deny
,
"safe access to extern statics was erroneously allowed"
}
declare_lint!
{
pub
PATTERNS_IN_FNS_WITHOUT_BODY
,
Warn
,
Deny
,
"patterns in functions without body were erroneously allowed"
}
...
...
@@ -169,14 +169,14 @@
declare_lint!
{
pub
LEGACY_DIRECTORY_OWNERSHIP
,
Warn
,
Deny
,
"non-inline, non-`#[path]` modules (e.g. `mod foo;`) were erroneously allowed in some files
\
not named `mod.rs`"
}
declare_lint!
{
pub
LEGACY_IMPORTS
,
Warn
,
Deny
,
"detects names that resolve to ambiguous glob imports with RFC 1560"
}
...
...
@@ -188,13 +188,13 @@
declare_lint!
{
pub
MISSING_FRAGMENT_SPECIFIER
,
Warn
,
Deny
,
"detects missing fragment specifiers in unused `macro_rules!` patterns"
}
declare_lint!
{
pub
PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES
,
Warn
,
Deny
,
"detects parenthesized generic parameters in type and module names"
}
...
...
src/test/compile-fail/defaulted-unit-warning.rs
浏览文件 @
96bcdac9
...
...
@@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
#![allow(unreachable_code)]
#![deny(resolve_trait_on_defaulted_unit)]
#![allow(unused)]
trait
Deserialize
:
Sized
{
fn
deserialize
()
->
Result
<
Self
,
String
>
;
...
...
@@ -38,4 +36,3 @@ fn smeg() {
fn
main
()
{
smeg
();
}
src/test/compile-fail/directory_ownership/backcompat-warnings.rs
浏览文件 @
96bcdac9
...
...
@@ -10,12 +10,8 @@
// error-pattern: cannot declare a new module at this location
// error-pattern: will become a hard error
// error-pattern: compilation successful
#![feature(rustc_attrs)]
#[path=
"mod_file_not_owning_aux3.rs"
]
mod
foo
;
#[rustc_error]
fn
main
()
{}
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
浏览文件 @
96bcdac9
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
#![allow(unused)]
pub
struct
Foo
;
...
...
@@ -20,12 +19,11 @@ mod baz {
use
*
;
//~ NOTE `Foo` could refer to the name imported here
use
bar
::
*
;
//~ NOTE `Foo` could also refer to the name imported here
fn
f
(
_
:
Foo
)
{}
//~^
WARN
`Foo` is ambiguous
//~^
ERROR
`Foo` is ambiguous
//~| WARN hard error in a future release
//~| NOTE see issue #38260
//~| NOTE #[
warn
(legacy_imports)] on by default
//~| NOTE #[
deny
(legacy_imports)] on by default
}
}
#[rustc_error]
fn
main
()
{}
//~ ERROR compilation successful
fn
main
()
{}
src/test/compile-fail/issue-32995-2.rs
浏览文件 @
96bcdac9
...
...
@@ -8,23 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(parenthesized_params_in_types_and_modules)]
//~^ NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
#![allow(dead_code,
unused_variables)]
#![feature(conservative_impl_trait)]
#![allow(unused)]
fn
main
()
{
{
fn
f
<
X
:
::
std
::
marker
()::
Send
>
()
{}
}
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
{
fn
f
()
->
impl
::
std
::
marker
()::
Send
{
}
}
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
}
#[derive(Clone)]
...
...
@@ -33,4 +27,3 @@ fn main() {
impl
::
std
::
marker
()::
Copy
for
X
{}
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
src/test/compile-fail/issue-32995.rs
浏览文件 @
96bcdac9
...
...
@@ -8,26 +8,16 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(parenthesized_params_in_types_and_modules)]
//~^ NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
//~| NOTE lint level defined here
#![allow(dead_code,
unused_variables)]
#![allow(unused)]
fn
main
()
{
let
x
:
usize
()
=
1
;
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
let
b
:
::
std
::
boxed
()::
Box
<
_
>
=
Box
::
new
(
1
);
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
macro_rules!
pathexpr
{
(
$p:path
)
=>
{
$p
}
...
...
@@ -36,27 +26,22 @@ fn main() {
let
p
=
pathexpr!
(::
std
::
str
()::
from_utf8
)(
b
"foo"
)
.unwrap
();
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
let
p
=
pathexpr!
(::
std
::
str
::
from_utf8
())(
b
"foo"
)
.unwrap
();
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
let
o
:
Box
<
::
std
::
marker
()::
Send
>
=
Box
::
new
(
1
);
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
let
o
:
Box
<
Send
+
::
std
::
marker
()::
Sync
>
=
Box
::
new
(
1
);
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
}
fn
foo
<
X
:
Default
>
()
{
let
d
:
X
()
=
Default
::
default
();
//~^ ERROR parenthesized parameters may only be used with a trait
//~| WARN previously accepted
//~| NOTE issue #42238
}
src/test/compile-fail/issue-38293.rs
浏览文件 @
96bcdac9
...
...
@@ -11,7 +11,6 @@
// Test that `fn foo::bar::{self}` only imports `bar` in the type namespace.
#![allow(unused)]
#![deny(legacy_imports)]
mod
foo
{
pub
fn
f
()
{
}
...
...
src/test/compile-fail/issue-39404.rs
浏览文件 @
96bcdac9
...
...
@@ -8,12 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(missing_fragment_specifier)]
//~ NOTE lint level defined here
#![allow(unused_macros)]
#![allow(unused)]
macro_rules!
m
{
(
$i
)
=>
{}
}
//~^ ERROR missing fragment specifier
//~| WARN previously accepted
//~| NOTE issue #40107
fn
main
()
{}
src/test/compile-fail/no-patterns-in-args-2.rs
浏览文件 @
96bcdac9
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(patterns_in_fns_without_body)]
trait
Tr
{
fn
f1
(
mut
arg
:
u8
);
//~ ERROR patterns aren't allowed in methods without bodies
//~^ WARN was previously accepted
...
...
@@ -17,6 +15,7 @@ trait Tr {
//~^ WARN was previously accepted
fn
g1
(
arg
:
u8
);
// OK
fn
g2
(
_
:
u8
);
// OK
#[allow(anonymous_parameters)]
fn
g3
(
u8
);
// OK
}
...
...
src/test/compile-fail/safe-extern-statics-mut.rs
浏览文件 @
96bcdac9
...
...
@@ -10,9 +10,6 @@
// aux-build:extern-statics.rs
#![allow(unused)]
#![deny(safe_extern_statics)]
extern
crate
extern_statics
;
use
extern_statics
::
*
;
...
...
src/test/compile-fail/safe-extern-statics.rs
浏览文件 @
96bcdac9
...
...
@@ -11,7 +11,6 @@
// aux-build:extern-statics.rs
#![allow(unused)]
#![deny(safe_extern_statics)]
extern
crate
extern_statics
;
use
extern_statics
::
*
;
...
...
src/test/compile-fail/type-parameter-invalid-lint.rs
浏览文件 @
96bcdac9
...
...
@@ -10,7 +10,6 @@
// gate-test-default_type_parameter_fallback
#![deny(invalid_type_param_default)]
#![allow(unused)]
fn
avg
<
T
=
i32
>
(
_
:
T
)
{}
...
...
src/test/ui/compare-method/proj-outlives-region.rs
浏览文件 @
96bcdac9
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
#![deny(extra_requirement_in_impl)]
// Test that we elaborate `Type: 'region` constraints and infer various important things.
trait
Master
<
'a
,
T
:
?
Sized
,
U
>
{
...
...
src/test/ui/compare-method/proj-outlives-region.stderr
浏览文件 @
96bcdac9
error[E0276]: impl has stricter requirements than trait
--> $DIR/proj-outlives-region.rs:
22
:5
--> $DIR/proj-outlives-region.rs:
19
:5
|
1
7
| fn foo() where T: 'a;
1
4
| fn foo() where T: 'a;
| --------------------- definition of `foo` from trait
...
22
| fn foo() where U: 'a { } //~ ERROR E0276
19
| fn foo() where U: 'a { } //~ ERROR E0276
| ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a`
|
= note: #[deny(extra_requirement_in_impl)] on by default
...
...
src/test/ui/compare-method/region-extra.rs
浏览文件 @
96bcdac9
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
#![deny(extra_requirement_in_impl)]
// Test that you cannot add an extra where clause in the impl relating
// two regions.
...
...
src/test/ui/compare-method/region-extra.stderr
浏览文件 @
96bcdac9
error[E0276]: impl has stricter requirements than trait
--> $DIR/region-extra.rs:
22
:5
--> $DIR/region-extra.rs:
19
:5
|
1
8
| fn foo();
1
5
| fn foo();
| --------- definition of `foo` from trait
...
22
| fn foo() where 'a: 'b { }
19
| fn foo() where 'a: 'b { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
error: aborting due to previous error
...
...
src/test/ui/compare-method/region-unrelated.rs
浏览文件 @
96bcdac9
...
...
@@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
#![deny(extra_requirement_in_impl)]
// Test that we elaborate `Type: 'region` constraints and infer various important things.
trait
Master
<
'a
,
T
:
?
Sized
,
U
>
{
...
...
src/test/ui/compare-method/region-unrelated.stderr
浏览文件 @
96bcdac9
error[E0276]: impl has stricter requirements than trait
--> $DIR/region-unrelated.rs:
22
:5
--> $DIR/region-unrelated.rs:
19
:5
|
1
7
| fn foo() where T: 'a;
1
4
| fn foo() where T: 'a;
| --------------------- definition of `foo` from trait
...
22
| fn foo() where V: 'a { }
19
| fn foo() where V: 'a { }
| ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a`
|
= note: #[deny(extra_requirement_in_impl)] on by default
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录