Bastian Kauschke
58031c7cb2
ConstKind::Unevaluated
2020-07-15 12:58:32 +02:00
bors
7750c3d46b
Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebank
...
Show the values and computation that would overflow a const evaluation or propagation
Fixes #71134
In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics.
cc @shepmaster
The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
2020-06-26 14:08:46 +00:00
Oliver Scherer
819cde5dab
Show the values and computation that would overflow a const evaluation or propagation
2020-06-26 10:08:52 +02:00
Eric Huss
75983e137e
Support configurable deny-warnings for all in-tree crates.
2020-06-25 21:17:21 -07:00
Eduard-Mihai Burtescu
95b3c427d4
Remove Option from the return type of def_kind.
2020-04-24 13:44:07 -05:00
marmeladema
fe7531579d
Address comments from review
2020-04-23 23:14:07 +01:00
marmeladema
bfce24aa67
Modify as_local_hir_id to return a bare HirId
2020-04-23 23:14:07 +01:00
marmeladema
6148db719f
Modify as_local_hir_id to accept a LocalDefId instead of a DefId
2020-04-23 23:14:07 +01:00
Josh Stone
554847c513
Dogfood or_patterns in rustdoc
2020-04-16 13:58:47 -07:00
Dylan DPC
9433d899a7
Rollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27
...
Improve rustdoc source code a bit
Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`.
r? @kinnison
cc @ollie27
2020-04-16 00:39:24 +02:00
marmeladema
c15e13ae16
Remove DUMMY_HIR_ID
2020-04-14 08:46:07 +01:00
Guillaume Gomez
12a95482c1
Improve rustdoc source code a bit
2020-04-10 16:43:00 +02:00
Matthias Krüger
08f2904dfa
more clippy fixes
...
use is_empty() instead of len comparison (clippy::len_zero)
use if let instead of while let loop that never loops (clippy::never_loop)
remove redundant returns (clippy::needless_return)
remove redundant closures (clippy::redundant_closure)
use if let instead of match and wildcard pattern (clippy::single_match)
don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-31 15:20:05 +02:00
Mazdak Farrokhzad
1ccb0b4a02
rustc -> rustc_middle part 3 (rustfmt)
2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad
0cb9e36090
rustc -> rustc_middle part 2
2020-03-30 07:16:56 +02:00
Mazdak Farrokhzad
f1701ddef1
rustc: remove rustc_hir_pretty dependency.
2020-03-24 08:44:55 +01:00
Matthias Krüger
74d68ea7eb
don't create variable bindings just to return the bound value immediately (clippy::let_and_return)
2020-03-22 00:35:25 +01:00
Guillaume Gomez
b9167e6c7d
Support type search for arguments and returned types
2020-03-16 18:29:19 +01:00
Matthias Krüger
569676b9b0
Use .map() to modify data inside Options instead of using .and_then(|x| Some(y)) (clippy::option_and_then_some)
2020-03-04 20:35:11 +01:00
Vadim Petrochenkov
6054a30370
Make it build again
2020-02-29 20:47:10 +03:00
Dylan DPC
391e7e26ae
Rollup merge of #69181 - skinny121:const-eval-return, r=oli-obk
...
Change const eval to just return the value
As discussed in https://github.com/rust-lang/rust/pull/68505#discussion_r370956535 , the type of consts shouldn't be returned from const eval queries.
r? @eddyb
cc @nikomatsakis
2020-02-18 16:07:22 +01:00
Yuki Okushi
eb12ed889d
Rename FunctionRetTy to FnRetTy
2020-02-17 11:24:29 +09:00
Ben Lewis
774a029e96
Code review changes.
2020-02-16 09:59:01 +13:00
Ben Lewis
c423a8649c
Change const eval to return ConstValue, instead of Const as the type inside it shouldn't be used.
2020-02-15 11:56:23 +13:00
Camille GILLOT
fc73e196d9
Review comments.
2020-02-11 23:21:21 +01:00
Camille GILLOT
ff369236a3
Move lang_items definitions to librustc_lang_items.
2020-02-11 23:09:22 +01:00
Matthias Krüger
697ef95c9f
remove redundant imports (clippy::single_component_path_imports)
2020-02-04 01:05:45 +01:00
Yuki Okushi
edfa0f4345
Rollup merge of #68556 - ollie27:rustdoc_primitive_re-export, r=GuillaumeGomez
...
rustdoc: Fix re-exporting primitive types
* Generate links to the primitive type docs for re-exports.
* Don't ICE on cross crate primitive type re-exports.
* Make primitive type re-exports show up cross crate.
Fixes #67646
Closes #67972
r? @GuillaumeGomez
2020-01-29 09:34:48 +09:00
Matthias Krüger
ec61761e46
don't clone types that are copy, round two.
2020-01-27 01:18:18 +01:00
Oliver Middleton
bbc2ae7590
rustdoc: Fix re-exporting primitive types
...
* Generate links to the primitive type docs for re-exports.
* Don't ICE on cross crate primitive type re-exports.
* Make primitive type re-exports show up cross crate.
2020-01-26 21:32:43 +00:00
Santiago Pastorino
a9de4f11ed
Fix print const on librustdoc
2020-01-10 09:08:25 +01:00
Santiago Pastorino
1688719214
Promote Refs to constants instead of static
2020-01-10 09:08:24 +01:00
Mazdak Farrokhzad
ebfd8673a7
Remove rustc_hir reexports in rustc::hir.
2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad
62ac10ffde
simplify reexports in rustc::hir
2020-01-05 12:47:11 +01:00
Mazdak Farrokhzad
7901c7f707
canonicalize FxHash{Map,Set} imports
2020-01-04 18:57:22 +01:00
Vadim Petrochenkov
70f1d57048
Rename syntax_pos to rustc_span in source code
2020-01-01 09:15:18 +03:00
Ohad Ravid
811bdeee00
Show value for consts in the documentation
2019-12-24 10:10:36 +01:00
Mark Rousskov
a06baa56b9
Format the world
2019-12-22 17:42:47 -05:00
Guillaume Gomez
26b0bcb47c
Remove useless comment
2019-12-09 18:06:11 +01:00
Guillaume Gomez
8749550d5c
Remove unused imports
2019-12-09 18:00:51 +01:00
Guillaume Gomez
bc68976472
Fix usage of variants in clean/utils
2019-12-09 17:58:46 +01:00
Guillaume Gomez
ae7e808f42
Make utils module public
2019-12-09 17:57:02 +01:00
Guillaume Gomez
596705b42f
Fix missing imports
2019-12-09 17:53:42 +01:00
Guillaume Gomez
5d906ed971
Move clean functions to another file
2019-12-09 17:46:20 +01:00