Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a0df420
Implement FromStr for PathBuf
SimonSapin Oct 17, 2018
ac18635
Add MaybeUninit::new
SimonSapin Oct 21, 2018
412ad9b
Allow extern statics with an extern type
mjbshaw Oct 22, 2018
5b84550
Keep an obligation for both sized and unsized types
mjbshaw Oct 22, 2018
1c8fb66
Move `BoundTy` to `ty::TyKind`
scalexm Oct 22, 2018
cdf5547
Shift both late bound regions and bound types
scalexm Oct 22, 2018
ab820ad
Rename `BoundTyIndex` to `BoundVar`
scalexm Oct 23, 2018
9049c85
Rename `BoundTy` field `level` -> `index`
scalexm Oct 23, 2018
8642a23
Adjust bound tys indices in canonicalization
scalexm Oct 23, 2018
e76fffc
Remove `ReCanonical` in favor of `ReLateBound`
scalexm Oct 24, 2018
b86d700
Rename `Binder::no_late_bound_regions` to `Binder::no_bound_vars`
scalexm Oct 24, 2018
235c848
Extend `ty::fold::RegionReplacer` to `ty::fold::BoundVarReplacer`
scalexm Oct 24, 2018
47499cc
Fix doc comment
scalexm Oct 25, 2018
18eeed5
Move cg_llvm::back::linker to cg_utils
bjorn3 Oct 20, 2018
2bf01aa
Rename `as_bound_var` to `assert_bound_var`
scalexm Oct 25, 2018
2b205dc
Substitute binders directly
scalexm Oct 25, 2018
029cf2f
Move collect_and_partition_mono_items to rustc_mir
bjorn3 Oct 25, 2018
06695c2
Remove rustc_metadata_utils, which contains only one function
bjorn3 Oct 25, 2018
adafd0f
Fix indentation
bjorn3 Oct 25, 2018
8d5fb4c
Add note linking to Rust 2018 path semantics docs.
davidtwco Oct 18, 2018
c674802
Remove unnecessary mut in iterator.find_map documentation example, Re…
meven Oct 23, 2018
bb37f18
Turn ICE for dangling pointers into error
oli-obk Oct 22, 2018
caabc72
Reproduce the underlying issue
oli-obk Oct 22, 2018
7a2879f
Update dangling-alloc-id-ice-2.rs
oli-obk Oct 23, 2018
9d18968
Typo
oli-obk Oct 24, 2018
5c45fef
Update and add new test (fixes #55353)
oli-obk Oct 26, 2018
599eb12
Add trailing newline
oli-obk Oct 26, 2018
4cb611f
Update string.rs
rick68 Oct 27, 2018
c04893a
Fix an ICE in the min_const_fn analysis
oli-obk Oct 27, 2018
630c6a5
introducing lint reason annotations (RFC 2383)
zackmdavis Sep 30, 2018
dc0609c
feature-gate lint reasons
zackmdavis Sep 30, 2018
f90de11
in which lint reasons are restricted to come last in the attribute
zackmdavis Oct 12, 2018
f66ea66
wherein the status of empty and reason-only lint attributes is clarified
zackmdavis Oct 16, 2018
80c1f0b
Rollup merge of #54683 - zackmdavis:critique_of_pure_lints, r=petroch…
Mark-Simulacrum Oct 27, 2018
ef8f09a
Rollup merge of #55148 - SimonSapin:path-fromstr, r=oli-obk
Mark-Simulacrum Oct 27, 2018
be00065
Rollup merge of #55185 - davidtwco:issue-55130, r=nikomatsakis
Mark-Simulacrum Oct 27, 2018
671e8ea
Rollup merge of #55252 - SimonSapin:maybeuninit-new, r=bluss
Mark-Simulacrum Oct 27, 2018
b3740b1
Rollup merge of #55257 - mjbshaw:static, r=oli-obk
Mark-Simulacrum Oct 27, 2018
805fcb6
Rollup merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung
Mark-Simulacrum Oct 27, 2018
0956690
Rollup merge of #55330 - scalexm:bound-ty, r=nikomatsakis
Mark-Simulacrum Oct 27, 2018
2994675
Rollup merge of #55349 - bjorn3:rustc_mir_collect_and_partition_mono_…
Mark-Simulacrum Oct 27, 2018
18d3f3f
Rollup merge of #55389 - meven:master, r=shepmaster
Mark-Simulacrum Oct 27, 2018
545eae8
Rollup merge of #55406 - rick68:patch-16, r=varkor
Mark-Simulacrum Oct 27, 2018
25be4f6
Rollup merge of #55412 - oli-obk:min_const_fn_ice, r=estebank
Mark-Simulacrum Oct 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feature-gate lint reasons
We take stability seriously, so we shy away from making even seemingly
"trivial" features insta-stable.
  • Loading branch information
zackmdavis committed Oct 27, 2018
commit dc0609c2473c01f521c5a3b9959edf7dd11f2d86
14 changes: 13 additions & 1 deletion src/librustc/lint/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,23 @@ impl<'a> LintLevelsBuilder<'a> {
match item.node {
ast::MetaItemKind::Word => {} // actual lint names handled later
ast::MetaItemKind::NameValue(ref name_value) => {
let gate_reasons = !self.sess.features_untracked().lint_reasons;
let name_ident = item.ident.segments[0].ident;
let name = name_ident.name.as_str();

if name == "reason" {
if let ast::LitKind::Str(rationale, _) = name_value.node {
reason = Some(rationale);
if gate_reasons {
feature_gate::emit_feature_err(
&self.sess.parse_sess,
"lint_reasons",
item.span,
feature_gate::GateIssue::Language,
"lint reasons are experimental"
);
} else {
reason = Some(rationale);
}
} else {
let mut err = bad_attr(name_value.span);
err.help("reason must be a string literal");
Expand Down
3 changes: 3 additions & 0 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ declare_features! (

// `extern crate foo as bar;` puts `bar` into extern prelude.
(active, extern_crate_item_prelude, "1.31.0", Some(54658), None),

// `reason = ` in lint attributes and `expect` lint attribute
(active, lint_reasons, "1.31.0", Some(54503), None),
);

declare_features! (
Expand Down
4 changes: 4 additions & 0 deletions src/test/ui/feature-gates/feature-gate-lint-reasons.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![warn(nonstandard_style, reason = "the standard should be respected")]
//~^ ERROR lint reasons are experimental

fn main() {}
11 changes: 11 additions & 0 deletions src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0658]: lint reasons are experimental (see issue #54503)
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(lint_reasons)] to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
2 changes: 2 additions & 0 deletions src/test/ui/lint/reasons-erroneous.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(lint_reasons)]

#![warn(absolute_paths_not_starting_with_crate, reason = 0)]
//~^ ERROR malformed lint attribute
//~| HELP reason must be a string literal
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/lint/reasons-erroneous.stderr
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
error[E0452]: malformed lint attribute
--> $DIR/reasons-erroneous.rs:1:58
--> $DIR/reasons-erroneous.rs:3:58
|
LL | #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
| ^
|
= help: reason must be a string literal

error[E0452]: malformed lint attribute
--> $DIR/reasons-erroneous.rs:4:40
--> $DIR/reasons-erroneous.rs:6:40
|
LL | #![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: reason must be a string literal

error[E0452]: malformed lint attribute
--> $DIR/reasons-erroneous.rs:7:29
--> $DIR/reasons-erroneous.rs:9:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0452]: malformed lint attribute
--> $DIR/reasons-erroneous.rs:9:23
--> $DIR/reasons-erroneous.rs:11:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0452]: malformed lint attribute
--> $DIR/reasons-erroneous.rs:11:36
--> $DIR/reasons-erroneous.rs:13:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `reason`
--> $DIR/reasons-erroneous.rs:13:44
--> $DIR/reasons-erroneous.rs:15:44
|
LL | #![warn(ellipsis_inclusive_range_patterns, reason)]
| ^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/lint/reasons-forbidden.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(lint_reasons)]

#![forbid(
unsafe_code,
//~^ NOTE `forbid` level set here
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/reasons-forbidden.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0453]: allow(unsafe_code) overruled by outer forbid(unsafe_code)
--> $DIR/reasons-forbidden.rs:12:13
--> $DIR/reasons-forbidden.rs:14:13
|
LL | unsafe_code,
| ----------- `forbid` level set here
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/lint/reasons.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// compile-pass

#![feature(lint_reasons)]

#![warn(elided_lifetimes_in_paths,
//~^ NOTE lint level defined here
reason = "explicit anonymous lifetimes aid reasoning about ownership")]
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/lint/reasons.stderr
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
warning: hidden lifetime parameters in types are deprecated
--> $DIR/reasons.rs:19:29
--> $DIR/reasons.rs:21:29
|
LL | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
| ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
|
= note: explicit anonymous lifetimes aid reasoning about ownership
note: lint level defined here
--> $DIR/reasons.rs:3:9
--> $DIR/reasons.rs:5:9
|
LL | #![warn(elided_lifetimes_in_paths,
| ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: variable `Social_exchange_psychology` should have a snake case name such as `social_exchange_psychology`
--> $DIR/reasons.rs:28:9
--> $DIR/reasons.rs:30:9
|
LL | let Social_exchange_psychology = CheaterDetectionMechanism {};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: people shouldn't have to change their usual style habits
to contribute to our project
note: lint level defined here
--> $DIR/reasons.rs:7:5
--> $DIR/reasons.rs:9:5
|
LL | nonstandard_style,
| ^^^^^^^^^^^^^^^^^
Expand Down