@@ -8,82 +8,69 @@ LL | pub(crate) const FOO_PUB_CRATE: [u32; 1_000_000] = [0u32; 1_000_000];
8
8
|
9
9
= note: `-D clippy::large-const-arrays` implied by `-D warnings`
10
10
11
- thread 'rustc' panicked at 'aborting due to `-Z treat-err-as-bug=1`', src/librustc_errors/lib.rs:930:13
12
- stack backtrace:
13
- 0: backtrace::backtrace::libunwind::trace
14
- at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
15
- 1: backtrace::backtrace::trace_unsynchronized
16
- at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
17
- 2: std::sys_common::backtrace::_print_fmt
18
- at src/libstd/sys_common/backtrace.rs:78
19
- 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
20
- at src/libstd/sys_common/backtrace.rs:59
21
- 4: core::fmt::write
22
- at src/libcore/fmt/mod.rs:1069
23
- 5: std::io::Write::write_fmt
24
- at src/libstd/io/mod.rs:1504
25
- 6: std::sys_common::backtrace::_print
26
- at src/libstd/sys_common/backtrace.rs:62
27
- 7: std::sys_common::backtrace::print
28
- at src/libstd/sys_common/backtrace.rs:49
29
- 8: std::panicking::default_hook::{{closure}}
30
- at src/libstd/panicking.rs:198
31
- 9: std::panicking::default_hook
32
- at src/libstd/panicking.rs:218
33
- 10: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
34
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/liballoc/boxed.rs:1038
35
- 11: clippy_driver::report_clippy_ice
36
- at src/driver.rs:242
37
- 12: <clippy_driver::ICE_HOOK as core::ops::deref::Deref>::deref::__static_ref_initialize::{{closure}}
38
- at src/driver.rs:235
39
- 13: std::panicking::rust_panic_with_hook
40
- at src/libstd/panicking.rs:481
41
- 14: std::panicking::begin_panic
42
- 15: rustc_errors::HandlerInner::emit_diagnostic
43
- 16: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
44
- 17: clippy_lints::utils::diagnostics::span_lint_and_then::{{closure}}
45
- at clippy_lints/src/utils/diagnostics.rs:137
46
- 18: core::ops::function::FnOnce::call_once{{vtable.shim}}
47
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/libcore/ops/function.rs:232
48
- 19: rustc_middle::lint::struct_lint_level::struct_lint_level_impl
49
- 20: rustc_middle::lint::struct_lint_level
50
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_middle/lint.rs:332
51
- 21: rustc_middle::ty::context::TyCtxt::struct_span_lint_hir
52
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_middle/ty/context.rs:2595
53
- 22: <rustc_lint::context::LateContext as rustc_lint::context::LintContext>::lookup
54
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_lint/context.rs:641
55
- 23: rustc_lint::context::LintContext::struct_span_lint
56
- at /rustc/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_lint/context.rs:594
57
- 24: clippy_lints::utils::diagnostics::span_lint_and_then
58
- at clippy_lints/src/utils/diagnostics.rs:133
59
- 25: <clippy_lints::large_const_arrays::LargeConstArrays as rustc_lint::passes::LateLintPass>::check_item
60
- at clippy_lints/src/large_const_arrays.rs:68
61
- 26: <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_item
62
- 27: rustc_hir::intravisit::Visitor::visit_nested_item
63
- 28: rustc_hir::intravisit::walk_crate
64
- 29: rustc_lint::late::late_lint_pass_crate
65
- 30: rustc_session::utils::<impl rustc_session::session::Session>::time
66
- 31: rustc_session::utils::<impl rustc_session::session::Session>::time
67
- 32: rustc_interface::passes::analysis::{{closure}}::{{closure}}
68
- 33: rustc_session::utils::<impl rustc_session::session::Session>::time
69
- 34: rustc_interface::passes::analysis
70
- 35: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
71
- 36: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
72
- 37: rustc_query_system::query::plumbing::get_query
73
- 38: rustc_middle::ty::context::tls::enter_global
74
- 39: rustc_interface::interface::run_compiler_in_existing_thread_pool
75
- 40: scoped_tls::ScopedKey<T>::set
76
- 41: rustc_ast::attr::with_globals
77
- note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
11
+ error: large array defined as const
12
+ --> $DIR/large_const_arrays.rs:13:1
13
+ |
14
+ LL | pub const FOO_PUB: [u32; 1_000_000] = [0u32; 1_000_000];
15
+ | ^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
+ | |
17
+ | help: make this a static item: `static`
18
+
19
+ error: large array defined as const
20
+ --> $DIR/large_const_arrays.rs:14:1
21
+ |
22
+ LL | const FOO: [u32; 1_000_000] = [0u32; 1_000_000];
23
+ | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
+ | |
25
+ | help: make this a static item: `static`
26
+
27
+ error: large array defined as const
28
+ --> $DIR/large_const_arrays.rs:23:5
29
+ |
30
+ LL | pub const BAR_PUB: [u32; 1_000_000] = [0u32; 1_000_000];
31
+ | ^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
+ | |
33
+ | help: make this a static item: `static`
34
+
35
+ error: large array defined as const
36
+ --> $DIR/large_const_arrays.rs:24:5
37
+ |
38
+ LL | const BAR: [u32; 1_000_000] = [0u32; 1_000_000];
39
+ | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40
+ | |
41
+ | help: make this a static item: `static`
78
42
79
- error: internal compiler error: unexpected panic
43
+ error: large array defined as const
44
+ --> $DIR/large_const_arrays.rs:25:5
45
+ |
46
+ LL | pub const BAR_STRUCT_PUB: [S; 5_000] = [S { data: [0; 32] }; 5_000];
47
+ | ^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
+ | |
49
+ | help: make this a static item: `static`
50
+
51
+ error: large array defined as const
52
+ --> $DIR/large_const_arrays.rs:26:5
53
+ |
54
+ LL | const BAR_STRUCT: [S; 5_000] = [S { data: [0; 32] }; 5_000];
55
+ | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
+ | |
57
+ | help: make this a static item: `static`
80
58
81
- note: the compiler unexpectedly panicked. this is a bug.
59
+ error: large array defined as const
60
+ --> $DIR/large_const_arrays.rs:27:5
61
+ |
62
+ LL | pub const BAR_S_PUB: [Option<&str>; 200_000] = [Some("str"); 200_000];
63
+ | ^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64
+ | |
65
+ | help: make this a static item: `static`
82
66
83
- note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
67
+ error: large array defined as const
68
+ --> $DIR/large_const_arrays.rs:28:5
69
+ |
70
+ LL | const BAR_S: [Option<&str>; 200_000] = [Some("str"); 200_000];
71
+ | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
+ | |
73
+ | help: make this a static item: `static`
84
74
85
- note: Clippy version: clippy 0.0.212 (87a6f3fc 2020-04-26)
75
+ error: aborting due to 9 previous errors
86
76
87
- query stack during panic:
88
- #0 [analysis] running analysis passes on this crate
89
- end of query stack
0 commit comments