Skip to content
Permalink
Browse files

Tweak unstable diagnostic output

  • Loading branch information...
estebank committed Apr 10, 2019
1 parent 96d700f commit 3ab97062cfddb6e5e5e32352dd15ca2243aba3ff
Showing with 842 additions and 453 deletions.
  1. +41 −23 src/libsyntax/feature_gate.rs
  2. +11 −13 src/libsyntax/json.rs
  3. +4 −2 src/test/ui/cast/cast-ptr-to-int-const.stderr
  4. +2 −1 src/test/ui/conditional-compilation/cfg-attr-crate-2.stderr
  5. +2 −1 src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr
  6. +2 −1 src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr
  7. +2 −1 src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr
  8. +2 −1 src/test/ui/consts/const-deref-ptr.stderr
  9. +2 −1 src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr
  10. +6 −3 src/test/ui/consts/const-eval/feature-gate-const_panic.stderr
  11. +3 −1 src/test/ui/consts/const-eval/match-test-ptr-null.rs
  12. +4 −3 src/test/ui/consts/const-eval/match-test-ptr-null.stderr
  13. +8 −4 src/test/ui/consts/min_const_fn/min_const_fn_unsafe.stderr
  14. +2 −1 src/test/ui/consts/projection_qualif.stderr
  15. +6 −3 src/test/ui/custom_attribute.stderr
  16. +3 −1 src/test/ui/error-codes/E0395.rs
  17. +2 −1 src/test/ui/error-codes/E0395.stderr
  18. +2 −1 src/test/ui/error-codes/E0396.stderr
  19. +2 −1 src/test/ui/error-codes/E0658.stderr
  20. +14 −7 src/test/ui/explore-issue-38412.stderr
  21. +5 −5 src/test/ui/feature-gate-optimize_attribute.rs
  22. +10 −5 src/test/ui/feature-gate-optimize_attribute.stderr
  23. +2 −1 src/test/ui/feature-gate/feature-gate-c_variadic.stderr
  24. +2 −1 src/test/ui/feature-gate/feature-gate-static-nobundle-2.stderr
  25. +2 −1 src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr
  26. +84 −42 src/test/ui/feature-gates/feature-gate-abi.stderr
  27. +1 −1 src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs
  28. +2 −1 src/test/ui/feature-gates/feature-gate-alloc-error-handler.stderr
  29. +2 −1 src/test/ui/feature-gates/feature-gate-allow_fail.stderr
  30. +6 −3 src/test/ui/feature-gates/feature-gate-arbitrary-self-types.stderr
  31. +6 −3 src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr
  32. +2 −1 src/test/ui/feature-gates/feature-gate-asm.stderr
  33. +2 −1 src/test/ui/feature-gates/feature-gate-asm2.stderr
  34. +2 −1 src/test/ui/feature-gates/feature-gate-assoc-type-defaults.stderr
  35. +2 −1 src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr
  36. +6 −3 src/test/ui/feature-gates/feature-gate-async-await.stderr
  37. +2 −1 src/test/ui/feature-gates/feature-gate-box-expr.stderr
  38. +2 −1 src/test/ui/feature-gates/feature-gate-box_patterns.stderr
  39. +1 −1 src/test/ui/feature-gates/feature-gate-box_syntax.rs
  40. +2 −1 src/test/ui/feature-gates/feature-gate-box_syntax.stderr
  41. +18 −18 src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs
  42. +36 −18 src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr
  43. +1 −1 src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.rs
  44. +2 −1 src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.stderr
  45. +4 −2 src/test/ui/feature-gates/feature-gate-concat_idents.stderr
  46. +2 −1 src/test/ui/feature-gates/feature-gate-concat_idents2.stderr
  47. +4 −2 src/test/ui/feature-gates/feature-gate-concat_idents3.stderr
  48. +4 −2 src/test/ui/feature-gates/feature-gate-const_fn.stderr
  49. +4 −2 src/test/ui/feature-gates/feature-gate-const_generics.stderr
  50. +1 −1 src/test/ui/feature-gates/feature-gate-const_transmute.rs
  51. +2 −1 src/test/ui/feature-gates/feature-gate-const_transmute.stderr
  52. +2 −1 src/test/ui/feature-gates/feature-gate-crate_visibility_modifier.stderr
  53. +26 −13 src/test/ui/feature-gates/feature-gate-custom_attribute.stderr
  54. +34 −17 src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr
  55. +2 −1 src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr
  56. +1 −1 src/test/ui/feature-gates/feature-gate-decl_macro.rs
  57. +2 −1 src/test/ui/feature-gates/feature-gate-decl_macro.stderr
  58. +2 −1 src/test/ui/feature-gates/feature-gate-doc_alias.stderr
  59. +2 −1 src/test/ui/feature-gates/feature-gate-doc_cfg-cfg-rustdoc.stderr
  60. +2 −1 src/test/ui/feature-gates/feature-gate-doc_cfg.stderr
  61. +2 −1 src/test/ui/feature-gates/feature-gate-doc_keyword.stderr
  62. +2 −1 src/test/ui/feature-gates/feature-gate-doc_masked.stderr
  63. +2 −1 src/test/ui/feature-gates/feature-gate-doc_spotlight.stderr
  64. +2 −1 src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr
  65. +2 −1 src/test/ui/feature-gates/feature-gate-exclusive-range-pattern.stderr
  66. +4 −2 src/test/ui/feature-gates/feature-gate-existential-type.stderr
  67. +2 −1 src/test/ui/feature-gates/feature-gate-extern_types.stderr
  68. +2 −1 src/test/ui/feature-gates/feature-gate-external_doc.stderr
  69. +1 −1 src/test/ui/feature-gates/feature-gate-ffi_returns_twice.rs
  70. +2 −1 src/test/ui/feature-gates/feature-gate-ffi_returns_twice.stderr
  71. +2 −1 src/test/ui/feature-gates/feature-gate-fundamental.stderr
  72. +2 −1 src/test/ui/feature-gates/feature-gate-generators.stderr
  73. +14 −7 src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
  74. +2 −1 src/test/ui/feature-gates/feature-gate-global_asm.stderr
  75. +8 −4 src/test/ui/feature-gates/feature-gate-is_sorted.stderr
  76. +2 −1 src/test/ui/feature-gates/feature-gate-label_break_value.stderr
  77. +6 −3 src/test/ui/feature-gates/feature-gate-link_args.stderr
  78. +2 −1 src/test/ui/feature-gates/feature-gate-link_cfg.stderr
  79. +2 −1 src/test/ui/feature-gates/feature-gate-link_llvm_intrinsics.stderr
  80. +2 −1 src/test/ui/feature-gates/feature-gate-linkage.stderr
  81. +2 −1 src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
  82. +2 −1 src/test/ui/feature-gates/feature-gate-log_syntax.stderr
  83. +2 −1 src/test/ui/feature-gates/feature-gate-log_syntax2.stderr
  84. +6 −3 src/test/ui/feature-gates/feature-gate-macros_in_extern.stderr
  85. +2 −1 src/test/ui/feature-gates/feature-gate-main.stderr
  86. +1 −1 src/test/ui/feature-gates/feature-gate-marker_trait_attr.rs
  87. +2 −1 src/test/ui/feature-gates/feature-gate-marker_trait_attr.stderr
  88. +2 −1 src/test/ui/feature-gates/feature-gate-may-dangle.stderr
  89. +4 −2 src/test/ui/feature-gates/feature-gate-min_const_fn.stderr
  90. +4 −2 src/test/ui/feature-gates/feature-gate-naked_functions.stderr
  91. +10 −5 src/test/ui/feature-gates/feature-gate-never_type.stderr
  92. +2 −1 src/test/ui/feature-gates/feature-gate-no-debug.stderr
  93. +2 −1 src/test/ui/feature-gates/feature-gate-no_core.stderr
  94. +26 −13 src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr
  95. +1 −1 src/test/ui/feature-gates/feature-gate-non_exhaustive.rs
  96. +2 −1 src/test/ui/feature-gates/feature-gate-non_exhaustive.stderr
  97. +2 −1 src/test/ui/feature-gates/feature-gate-on-unimplemented.stderr
  98. +4 −2 src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr
  99. +2 −1 src/test/ui/feature-gates/feature-gate-plugin.stderr
  100. +2 −1 src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
  101. +4 −2 src/test/ui/feature-gates/feature-gate-repr-simd.stderr
  102. +2 −1 src/test/ui/feature-gates/feature-gate-repr128.stderr
  103. +1 −1 src/test/ui/feature-gates/feature-gate-repr_align_enum.rs
  104. +2 −1 src/test/ui/feature-gates/feature-gate-repr_align_enum.stderr
  105. +4 −2 src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
  106. +2 −1 src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
  107. +2 −1 src/test/ui/feature-gates/feature-gate-simd.stderr
  108. +12 −6 src/test/ui/feature-gates/feature-gate-slice-patterns.stderr
  109. +2 −1 src/test/ui/feature-gates/feature-gate-start.stderr
  110. +2 −1 src/test/ui/feature-gates/feature-gate-static-nobundle.stderr
  111. +1 −1 src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.rs
  112. +2 −1 src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.stderr
  113. +2 −1 src/test/ui/feature-gates/feature-gate-thread_local.stderr
  114. +2 −1 src/test/ui/feature-gates/feature-gate-trace_macros.stderr
  115. +2 −1 src/test/ui/feature-gates/feature-gate-trait-alias.stderr
  116. +2 −1 src/test/ui/feature-gates/feature-gate-try_blocks.stderr
  117. +2 −1 src/test/ui/feature-gates/feature-gate-try_reserve.stderr
  118. +2 −1 src/test/ui/feature-gates/feature-gate-type_ascription.stderr
  119. +14 −7 src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr
  120. +6 −3 src/test/ui/feature-gates/feature-gate-unboxed-closures-method-calls.stderr
  121. +6 −3 src/test/ui/feature-gates/feature-gate-unboxed-closures-ufcs-calls.stderr
  122. +1 −1 src/test/ui/feature-gates/feature-gate-unboxed-closures.rs
  123. +4 −2 src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr
  124. +2 −1 src/test/ui/feature-gates/feature-gate-underscore_const_names.stderr
  125. +2 −1 src/test/ui/feature-gates/feature-gate-unsized_tuple_coercion.stderr
  126. +6 −3 src/test/ui/feature-gates/feature-gate-untagged_unions.stderr
  127. +2 −1 src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr
  128. +2 −1 src/test/ui/feature-gates/underscore_const_names_feature_gate.stderr
  129. +6 −3 src/test/ui/imports/local-modularized-tricky-fail-2.stderr
  130. +2 −1 src/test/ui/inference/inference_unstable_forced.stderr
  131. +2 −1 src/test/ui/issues/issue-17458.stderr
  132. +2 −1 src/test/ui/issues/issue-18294.stderr
  133. +2 −1 src/test/ui/issues/issue-20313.stderr
  134. +2 −1 src/test/ui/issues/issue-23024.stderr
  135. +2 −1 src/test/ui/issues/issue-25826.stderr
  136. +4 −2 src/test/ui/issues/issue-32655.stderr
  137. +2 −1 src/test/ui/issues/issue-32829.stderr
  138. +2 −1 src/test/ui/issues/issue-37887.stderr
  139. +2 −1 src/test/ui/issues/issue-49074.stderr
  140. +2 −1 src/test/ui/issues/issue-51279.stderr
  141. +2 −1 src/test/ui/issues/issue-52023-array-size-pointer-cast.stderr
  142. +2 −1 src/test/ui/linkage4.stderr
  143. +2 −1 src/test/ui/macros/macro-reexport-removed.stderr
  144. +6 −3 src/test/ui/macros/macros-in-extern.stderr
  145. +4 −2 src/test/ui/panic-runtime/needs-gate.stderr
  146. +4 −2 src/test/ui/proc-macro/attr-stmt-expr.stderr
  147. +2 −1 src/test/ui/proc-macro/derive-helper-shadowing.stderr
  148. +2 −1 src/test/ui/proc-macro/derive-still-gated.stderr
  149. +2 −1 src/test/ui/proc-macro/expand-to-unstable-2.stderr
  150. +2 −1 src/test/ui/proc-macro/issue-41211.stderr
  151. +6 −3 src/test/ui/proc-macro/macros-in-extern.stderr
  152. +10 −5 src/test/ui/proc-macro/more-gates.stderr
  153. +2 −1 src/test/ui/proc-macro/proc-macro-attributes.stderr
  154. +32 −16 src/test/ui/proc-macro/proc-macro-gates.stderr
  155. +4 −2 src/test/ui/proc-macro/proc-macro-gates2.stderr
  156. +2 −1 src/test/ui/reserved/reserved-attr-on-macro.stderr
  157. +2 −1 src/test/ui/rfc1445/feature-gate.no_gate.stderr
  158. +2 −1 src/test/ui/span/gated-features-attr-spans.stderr
  159. +6 −3 src/test/ui/span/issue-36530.stderr
  160. +2 −1 src/test/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr
  161. +2 −1 src/test/ui/specialization/specialization-feature-gate-default.stderr
  162. +2 −2 src/test/ui/stability-attribute/stability-attribute-issue.rs
  163. +4 −2 src/test/ui/stability-attribute/stability-attribute-issue.stderr
  164. +8 −8 src/test/ui/stmt_expr_attrs_no_feature.rs
  165. +18 −9 src/test/ui/stmt_expr_attrs_no_feature.stderr
  166. +6 −3 src/test/ui/suggestions/attribute-typos.stderr
  167. +2 −1 src/test/ui/syntax-trait-polarity-feature-gate.stderr
  168. +2 −1 src/test/ui/target-feature-gate.stderr
  169. +8 −4 src/test/ui/trace_macros-gate.stderr
  170. +2 −1 src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr
  171. +4 −2 src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr
  172. +8 −4 src/test/ui/utf8_idents.stderr
@@ -903,7 +903,7 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeTemplate, Attribu
("thread_local", Whitelisted, template!(Word), Gated(Stability::Unstable,
"thread_local",
"`#[thread_local]` is an experimental feature, and does \
not currently handle destructors.",
not currently handle destructors",
cfg_fn!(thread_local))),

("rustc_on_unimplemented", Whitelisted, template!(List:
@@ -1438,42 +1438,58 @@ pub enum GateStrength {
Soft,
}

pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: GateIssue,
explain: &str) {
pub fn emit_feature_err(
sess: &ParseSess,
feature: &str,
span: Span,
issue: GateIssue,
explain: &str,
) {
feature_err(sess, feature, span, issue, explain).emit();
}

pub fn feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: GateIssue,
explain: &str) -> DiagnosticBuilder<'a> {
pub fn feature_err<'a>(
sess: &'a ParseSess,
feature: &str,
span: Span,
issue: GateIssue,
explain: &str,
) -> DiagnosticBuilder<'a> {
leveled_feature_err(sess, feature, span, issue, explain, GateStrength::Hard)
}

fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: GateIssue,
explain: &str, level: GateStrength) -> DiagnosticBuilder<'a> {
fn leveled_feature_err<'a>(
sess: &'a ParseSess,
feature: &str,
span: Span,
issue: GateIssue,
explain: &str,
level: GateStrength,
) -> DiagnosticBuilder<'a> {
let diag = &sess.span_diagnostic;

let issue = match issue {
GateIssue::Language => find_lang_feature_issue(feature),
GateIssue::Library(lib) => lib,
};

let explanation = match issue {
None | Some(0) => explain.to_owned(),
Some(n) => format!("{} (see issue #{})", explain, n)
};

let mut err = match level {
GateStrength::Hard => {
diag.struct_span_err_with_code(span, &explanation, stringify_error_code!(E0658))
diag.struct_span_err_with_code(span, explain, stringify_error_code!(E0658))
}
GateStrength::Soft => diag.struct_span_warn(span, &explanation),
GateStrength::Soft => diag.struct_span_warn(span, explain),
};

match issue {
None | Some(0) => {}
Some(n) => {
err.note(&format!("for more information, see tracking issue #{}", n));
}
}

// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
if sess.unstable_features.is_nightly_build() {
err.help(&format!("add #![feature({})] to the \
crate attributes to enable",
feature));
err.help(&format!("add #![feature({})] to the crate attributes to enable", feature));
}

// If we're on stable and only emitting a "soft" warning, add a note to
@@ -1488,10 +1504,10 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
}

const EXPLAIN_BOX_SYNTAX: &str =
"box expression syntax is experimental; you can call `Box::new` instead.";
"box expression syntax is experimental; you can call `Box::new` instead";

pub const EXPLAIN_STMT_ATTR_SYNTAX: &str =
"attributes on expressions are experimental.";
"attributes on expressions are experimental";

pub const EXPLAIN_ASM: &str =
"inline assembly is not stable enough for use and is subject to change";
@@ -1685,10 +1701,12 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {

fn visit_name(&mut self, sp: Span, name: ast::Name) {
if !name.as_str().is_ascii() {
gate_feature_post!(&self,
non_ascii_idents,
self.context.parse_sess.source_map().def_span(sp),
"non-ascii idents are not fully supported.");
gate_feature_post!(
&self,
non_ascii_idents,
self.context.parse_sess.source_map().def_span(sp),
"non-ascii idents are not fully supported"
);
}
}

@@ -348,19 +348,17 @@ impl DiagnosticSpanLine {
/// `span` within the line.
fn from_span(span: Span, je: &JsonEmitter) -> Vec<DiagnosticSpanLine> {
je.sm.span_to_lines(span)
.map(|lines| {
let fm = &*lines.file;
lines.lines
.iter()
.map(|line| {
DiagnosticSpanLine::line_from_source_file(fm,
line.line_index,
line.start_col.0 + 1,
line.end_col.0 + 1)
})
.collect()
})
.unwrap_or_else(|_| vec![])
.map(|lines| {
let fm = &*lines.file;
lines.lines
.iter()
.map(|line| DiagnosticSpanLine::line_from_source_file(
fm,
line.line_index,
line.start_col.0 + 1,
line.end_col.0 + 1,
)).collect()
}).unwrap_or_else(|_| vec![])
}
}

@@ -1,17 +1,19 @@
error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
error[E0658]: casting pointers to integers in constants is unstable
--> $DIR/cast-ptr-to-int-const.rs:5:9
|
LL | main as u32
| ^^^^^^^^^^^
|
= note: for more information, see tracking issue #51910
= help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable

error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
error[E0658]: casting pointers to integers in constants is unstable
--> $DIR/cast-ptr-to-int-const.rs:9:9
|
LL | &Y as *const u32 as u32
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51910
= help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable

error: aborting due to 2 previous errors
@@ -1,9 +1,10 @@
error[E0658]: no_core is experimental (see issue #29639)
error[E0658]: no_core is experimental
--> $DIR/cfg-attr-crate-2.rs:6:21
|
LL | #![cfg_attr(broken, no_core)]
| ^^^^^^^
|
= note: for more information, see tracking issue #29639
= help: add #![feature(no_core)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,9 +1,10 @@
error[E0658]: no_core is experimental (see issue #29639)
error[E0658]: no_core is experimental
--> $DIR/cfg-attr-multi-invalid-1.rs:4:21
|
LL | #![cfg_attr(broken, no_core, no_std)]
| ^^^^^^^
|
= note: for more information, see tracking issue #29639
= help: add #![feature(no_core)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,9 +1,10 @@
error[E0658]: no_core is experimental (see issue #29639)
error[E0658]: no_core is experimental
--> $DIR/cfg-attr-multi-invalid-2.rs:4:29
|
LL | #![cfg_attr(broken, no_std, no_core)]
| ^^^^^^^
|
= note: for more information, see tracking issue #29639
= help: add #![feature(no_core)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,4 +1,4 @@
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27
|
LL | #[cfg_attr(all(), unknown)]
@@ -7,6 +7,7 @@ LL | #[cfg_attr(all(), unknown)]
LL | foo!();
| ------- in this macro invocation
|
= note: for more information, see tracking issue #29642
= help: add #![feature(custom_attribute)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,9 +1,10 @@
error[E0658]: dereferencing raw pointers in statics is unstable (see issue #51911)
error[E0658]: dereferencing raw pointers in statics is unstable
--> $DIR/const-deref-ptr.rs:4:29
|
LL | static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51911
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,9 +1,10 @@
error[E0658]: unions in const fn are unstable (see issue #51909)
error[E0658]: unions in const fn are unstable
--> $DIR/feature-gate-const_fn_union.rs:11:5
|
LL | Foo { u }.i
| ^^^^^^^^^^^
|
= note: for more information, see tracking issue #51909
= help: add #![feature(const_fn_union)] to the crate attributes to enable

error: aborting due to previous error
@@ -1,27 +1,30 @@
error[E0658]: panicking in constants is unstable (see issue #51999)
error[E0658]: panicking in constants is unstable
--> $DIR/feature-gate-const_panic.rs:3:15
|
LL | const Z: () = panic!("cheese");
| ^^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51999
= help: add #![feature(const_panic)] to the crate attributes to enable
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0658]: panicking in constants is unstable (see issue #51999)
error[E0658]: panicking in constants is unstable
--> $DIR/feature-gate-const_panic.rs:9:15
|
LL | const X: () = unimplemented!();
| ^^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51999
= help: add #![feature(const_panic)] to the crate attributes to enable
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0658]: panicking in constants is unstable (see issue #51999)
error[E0658]: panicking in constants is unstable
--> $DIR/feature-gate-const_panic.rs:6:15
|
LL | const Y: () = unreachable!();
| ^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51999
= help: add #![feature(const_panic)] to the crate attributes to enable
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

@@ -3,7 +3,9 @@ fn main() {
// that pointer comparison is disallowed, not that parts of a pointer are accessed as raw
// bytes.
let _: [u8; 0] = [4; {
match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
match &1 as *const i32 as usize {
//~^ ERROR casting pointers to integers in constants
//~| NOTE for more information, see tracking issue #51910
0 => 42, //~ ERROR constant contains unimplemented expression type
//~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
//~| ERROR evaluation of constant value failed
@@ -1,19 +1,20 @@
error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
error[E0658]: casting pointers to integers in constants is unstable
--> $DIR/match-test-ptr-null.rs:6:15
|
LL | match &1 as *const i32 as usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51910
= help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable

error[E0019]: constant contains unimplemented expression type
--> $DIR/match-test-ptr-null.rs:7:13
--> $DIR/match-test-ptr-null.rs:9:13
|
LL | 0 => 42,
| ^

error[E0080]: evaluation of constant value failed
--> $DIR/match-test-ptr-null.rs:7:13
--> $DIR/match-test-ptr-null.rs:9:13
|
LL | 0 => 42,
| ^ "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
@@ -1,33 +1,37 @@
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe.rs:50:77
|
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
| ^^^
|
= note: for more information, see tracking issue #51911
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable

error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe.rs:53:70
|
LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
| ^^
|
= note: for more information, see tracking issue #51911
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable

error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe.rs:56:83
|
LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
| ^^^
|
= note: for more information, see tracking issue #51911
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable

error[E0658]: unions in const fn are unstable (see issue #51909)
error[E0658]: unions in const fn are unstable
--> $DIR/min_const_fn_unsafe.rs:63:5
|
LL | Foo { x: () }.y
| ^^^^^^^^^^^^^^^
|
= note: for more information, see tracking issue #51909
= help: add #![feature(const_fn_union)] to the crate attributes to enable

error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
@@ -10,12 +10,13 @@ error[E0019]: constant contains unimplemented expression type
LL | unsafe { *b = 5; }
| ^^^^^^

error[E0658]: dereferencing raw pointers in constants is unstable (see issue #51911)
error[E0658]: dereferencing raw pointers in constants is unstable
--> $DIR/projection_qualif.rs:7:18
|
LL | unsafe { *b = 5; }
| ^^^^^^
|
= note: for more information, see tracking issue #51911
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable

error: aborting due to 3 previous errors
@@ -1,25 +1,28 @@
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:3:3
|
LL | #[foo]
| ^^^
|
= note: for more information, see tracking issue #29642
= help: add #![feature(custom_attribute)] to the crate attributes to enable

error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:5:7
|
LL | #[foo]
| ^^^
|
= note: for more information, see tracking issue #29642
= help: add #![feature(custom_attribute)] to the crate attributes to enable

error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:7:7
|
LL | #[foo]
| ^^^
|
= note: for more information, see tracking issue #29642
= help: add #![feature(custom_attribute)] to the crate attributes to enable

error: aborting due to 3 previous errors
Oops, something went wrong.

0 comments on commit 3ab9706

Please sign in to comment.
You can’t perform that action at this time.