rust/compiler
Colin Baumgarten b9e85bf60a Detect and reject out-of-range integers in format string literals
Until now out-of-range integers in format string literals
were silently ignored. They wrapped around to zero at
usize::MAX, producing unexpected results.

When using debug builds of rustc, such integers in format string
literals even cause an 'attempt to add with overflow' panic in
rustc.

Fix this by producing an error diagnostic for integers in format
string literals which do not fit into usize.

Fixes #102528
2022-10-01 01:05:01 +02:00
..
rustc Don't rerun the build script for the compiler each time on linux 2022-07-10 23:57:25 -05:00
rustc_apfloat Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_arena Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
rustc_ast Inline <Token as PartialEq<TokenKind>>::eq. 2022-09-29 07:05:34 +10:00
rustc_ast_lowering Do not overwrite binders for another HirId. 2022-09-27 18:58:37 +02:00
rustc_ast_passes Rollup merge of #102273 - woppopo:relax_const_bound, r=fee1-dead 2022-09-26 19:19:21 +02:00
rustc_ast_pretty make mk_attr_id part of ParseSess 2022-09-14 08:49:10 +08:00
rustc_attr remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_borrowck Auto merge of #102051 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum 2022-09-26 14:22:43 +00:00
rustc_builtin_macros Remove confusing drop. 2022-09-27 13:31:52 +02:00
rustc_codegen_cranelift Stabilize bench_black_box 2022-09-27 17:38:51 +02:00
rustc_codegen_gcc Rollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco 2022-09-30 10:22:36 +02:00
rustc_codegen_llvm Adjust the s390x data layout for LLVM 16 2022-09-29 18:18:26 -07:00
rustc_codegen_ssa Rollup merge of #102426 - sunfishcode:sunfishcode/no-wasm-init-memory, r=nagisa 2022-09-29 10:15:18 -07:00
rustc_const_eval remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_data_structures remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_driver rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
rustc_error_codes Auto merge of #100719 - CohenArthur:rust-safe-intrinsic-attribute, r=wesleywiser 2022-09-28 19:07:50 +00:00
rustc_error_messages Rollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco 2022-09-30 10:22:36 +02:00
rustc_errors Rollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco 2022-09-30 10:22:36 +02:00
rustc_expand Rewrite and refactor format_args!() builtin macro. 2022-09-27 13:13:08 +02:00
rustc_feature attributes: Add #[rustc_safe_intrinsic] builtin 2022-09-27 15:55:42 +02:00
rustc_fs_util Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_graphviz Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_hir Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_hir_analysis Auto merge of #101887 - nnethercote:shrink-Res, r=spastorino 2022-09-29 22:45:24 +00:00
rustc_hir_pretty Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_incremental remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_index Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8Ki 2022-09-28 13:07:17 +09:00
rustc_infer Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_interface rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
rustc_lexer Auto merge of #102302 - nnethercote:more-lexer-improvements, r=matklad 2022-09-28 08:14:04 +00:00
rustc_lint Auto merge of #101887 - nnethercote:shrink-Res, r=spastorino 2022-09-29 22:45:24 +00:00
rustc_lint_defs Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk" 2022-09-22 19:36:11 +02:00
rustc_llvm Avoid LLVM-deprecated Optional::hasValue 2022-09-26 16:51:18 -07:00
rustc_log Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_macros Allow raw identifiers to be used as fluent arguments 2022-09-27 20:29:18 +02:00
rustc_metadata Auto merge of #102164 - compiler-errors:rpitit-foreign, r=TaKO8Ki 2022-09-30 04:24:14 +00:00
rustc_middle Rollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco 2022-09-30 10:22:36 +02:00
rustc_mir_build Auto merge of #101887 - nnethercote:shrink-Res, r=spastorino 2022-09-29 22:45:24 +00:00
rustc_mir_dataflow remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_mir_transform remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_monomorphize remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_parse Rollup merge of #102350 - TaKO8Ki:incomplete-fn-in-struct-definition, r=fee1-dead 2022-09-30 10:22:37 +02:00
rustc_parse_format Detect and reject out-of-range integers in format string literals 2022-10-01 01:05:01 +02:00
rustc_passes Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_plugin_impl UPDATE - rename DiagnosticHandler macro to Diagnostic 2022-09-21 11:39:53 -04:00
rustc_privacy Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_query_impl Auto merge of #101785 - jyn514:query-struct-fn-ptrs, r=cjgillot 2022-09-26 00:17:59 +00:00
rustc_query_system remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_resolve Auto merge of #101887 - nnethercote:shrink-Res, r=spastorino 2022-09-29 22:45:24 +00:00
rustc_save_analysis Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_serialize remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_session Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwco 2022-09-28 11:11:42 +00:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span Auto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd 2022-09-30 07:57:12 +00:00
rustc_symbol_mangling separate definitions and HIR owners 2022-09-24 23:21:19 +09:00
rustc_target Adjust the s390x data layout for LLVM 16 2022-09-29 18:18:26 -07:00
rustc_trait_selection Auto merge of #102304 - lcnr:coherence-cleanup, r=compiler-errors 2022-09-30 01:32:15 +00:00
rustc_traits remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_transmute rustc_transmute: fix big-endian discriminants 2022-09-20 13:03:43 -07:00
rustc_ty_utils rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
rustc_type_ir Address code review comments 2022-09-13 14:50:12 -07:00