Commit Graph

1152 Commits

Author SHA1 Message Date
Guillaume Gomez
3950a6d8b6 Run attributes check at crate level 2020-10-03 21:33:47 +02:00
Guillaume Gomez
0e68e1ba5c Prevent #[doc(alias = "...")] at crate level 2020-10-03 21:33:47 +02:00
Jonas Schievink
c7c2418227
Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, r=oli-obk,ollie27
Doc alias name restriction

Fixes #76705.
2020-10-02 20:27:03 +02:00
Guillaume Gomez
84cb71c6fa Forbid some characters to be used as doc alias 2020-10-02 19:26:59 +02:00
Harald Hoyer
cadd12b5f0 Implement Make handle_alloc_error default to panic (for no_std + liballoc)
Related: https://github.com/rust-lang/rust/issues/66741

Guarded with `#![feature(default_alloc_error_handler)]` a default
`alloc_error_handler` is called, if a custom allocator is used and no
other custom `#[alloc_error_handler]` is defined.

The panic message does not contain the size anymore, because it would
pull in the fmt machinery, which would blow up the code size
significantly.
2020-10-02 09:00:29 +02:00
Dylan DPC
849e5636ea
Rollup merge of #77343 - varkor:rustc_args_required_const-validation, r=lcnr
Validate `rustc_args_required_const`

Fixes https://github.com/rust-lang/rust/issues/74608.
2020-10-01 02:13:44 +02:00
Jonas Schievink
d4add198be
Rollup merge of #77296 - tmiasko:liveness-option, r=ecstatic-morse
liveness: Use Option::None to represent absent live nodes

No functional changes intended.
2020-09-30 20:56:12 +02:00
varkor
609786dbd8 Validate rustc_args_required_const 2020-09-30 11:59:44 +01:00
Tomasz Miąsko
93e3db30e9 liveness: Use Option::None to represent absent live nodes
No functional changes intended.
2020-09-30 00:00:00 +00:00
Tomasz Miąsko
924e8aaaf2 Liveness analysis for everybody
Perform liveness analysis for every body instead of limiting it to fns.
2020-09-29 23:45:31 +02:00
David Wood
57e8fc5685
passes: check_attr on more targets
This commit modifies `check_attr` so that:

- Enum variants are now checked (some attributes would not have been
  prohibited on variants previously).
- `check_expr_attributes` and `check_stmt_attributes` are removed as
  `check_attributes` can perform the same checks.

Signed-off-by: David Wood <david@davidtw.co>
2020-09-28 12:18:52 +01:00
Tomasz Miąsko
33dde94d33 liveness: Inline visitor implementation for IrMaps 2020-09-27 23:55:53 +02:00
Tomasz Miąsko
536b51aca0 liveness: Store upvars_mentioned inside Liveness struct 2020-09-27 23:55:53 +02:00
Tomasz Miąsko
b629ffd96b liveness: Use visit_param to add variables corresponding to params 2020-09-27 23:55:53 +02:00
Tomasz Miąsko
e0db21dc7e liveness: Use upvars instead of FnKind to check for closures
Avoiding FnKind will make it easier to run liveness analysis on all
bodies in the future, not just fn-like things.
2020-09-27 23:55:52 +02:00
Tomasz Miąsko
e3319e7d16 liveness: Move body_owner field from IrMaps to Liveness
The Liveness struct is the only user of body_owner field.  Move the
field there.
2020-09-27 23:55:52 +02:00
bors
7f7a1cbfd3 Auto merge of #77229 - tmiasko:liveness, r=lcnr
Small improvements in liveness pass

* Remove redundant debug logging (`add_variable` already contains logging).
* Remove redundant fields for a number of live nodes and variables.
* Delay conversion from a symbol to a string until linting.
* Inline contents of specials struct.
* Remove unnecessary local variable exit_ln.
* Use newtype_index for Variable and LiveNode.
* Access live nodes directly through self.lnks[ln].

No functional changes intended (except those related to the logging).
2020-09-27 19:38:01 +00:00
Jonas Schievink
9f086fcb00
Rollup merge of #77203 - ecstatic-morse:const-stability-attr-checks, r=oli-obk
Check for missing const-stability attributes in `rustc_passes`

Currently, this happens as a side effect of `is_min_const_fn`, which is non-obvious. Also adds a test for this case, since we didn't seem to have one before.
2020-09-27 18:37:21 +02:00
bors
d902752866 Auto merge of #77118 - exrook:stability-generic-parameters-2, r=varkor
Stability annotations on generic parameters (take 2.5)

Rebase of #72314 + more tests

Implements rust-lang/wg-allocators#2.
2020-09-27 12:51:21 +00:00
Tomasz Miąsko
d68aa227c6 liveness: Access live nodes directly through self.lnks[ln] 2020-09-27 00:00:00 +00:00
Tomasz Miąsko
57d38975cc liveness: Use newtype_index for Variable and LiveNode 2020-09-26 16:44:41 +02:00
Tomasz Miąsko
49d1ce00f3 liveness: Remove unnecessary local variable exit_ln 2020-09-26 16:44:28 +02:00
Tomasz Miąsko
141b91da6c liveness: Inline contents of specials struct 2020-09-26 15:38:56 +02:00
Tomasz Miąsko
70f150b51e liveness: Delay conversion from a symbol to a string until linting 2020-09-26 15:38:51 +02:00
Tomasz Miąsko
2fb1564457 liveness: Remove redundant fields for a number of live nodes and variables 2020-09-26 15:38:30 +02:00
Tomasz Miąsko
9b5835ec79 liveness: Remove redundant debug logging
The IrMaps::add_variable already contains debug logging. Don't duplicate it.
2020-09-26 15:38:22 +02:00
marmeladema
35bad3edbf Address review comment 2020-09-25 22:48:44 +01:00
Dylan MacKenzie
61d86fa06c Check for missing const-stability attributes in stability
This used to happen as a side-effect of `is_min_const_fn`, which was
subtle.
2020-09-25 14:31:32 -07:00
Jonas Schievink
ba44e9fe34
Rollup merge of #77073 - lcnr:ty-trait-param, r=matthewjasper
dead_code: look at trait impls even if they don't contain items

fixes #70225
2020-09-25 19:42:35 +02:00
Erik Hofmayer
138a2e5eaa /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
Erik Hofmayer
dd66ea2d3d Updated html_root_url for compiler crates 2020-09-23 21:14:43 +02:00
Jacob Hughes
3f1b4b39e3 Fix compilation & test failures 2020-09-22 22:54:52 -04:00
Avi Dessauer
2793da3f39 Update src/librustc_passes/stability.rs
Co-authored-by: varkor <github@varkor.com>
2020-09-22 21:55:38 -04:00
Avi Dessauer
41eec9065a Update src/librustc_passes/stability.rs
Co-authored-by: varkor <github@varkor.com>
2020-09-22 21:55:29 -04:00
Avi Dessauer
19e90843a4 Add documentation 2020-09-22 21:55:23 -04:00
Avi Dessauer
a7a2086053 Stability annotations on generic trait parameters 2020-09-22 21:53:48 -04:00
Bastian Kauschke
438d229b25 dead_code: look at trait impls even if they don't contain items 2020-09-22 22:13:58 +02:00
Bastian Kauschke
4debbdc6b9 transmute: use diagnostic item 2020-09-19 11:33:11 +02:00
Bastian Kauschke
e5b82a56c5 allow concrete self types in consts 2020-09-13 22:53:51 +02:00
bors
dbb73f8f79 Auto merge of #73461 - calebzulawski:validate-attribute-placement, r=matthewjasper
Validate built-in attribute placement

Closes #54584, closes #47725, closes #54044.

I've changed silently ignoring some incorrectly placed attributes to errors.  I'm not sure what the policy is since this can theoretically break code (should they be warnings instead? does it warrant a crater run?).
2020-09-12 22:04:37 +00:00
Mara Bos
14cc17759d Improve ineffective_unstable_trait_impl error message. 2020-09-11 21:42:28 +02:00
Mara Bos
89fb34fea7 Turn unstable trait impl error into a lint, so it can be disabled. 2020-09-11 13:36:42 +02:00
Mara Bos
e5c645f40e Turn useless #[unstable] attributes into errors. 2020-09-11 13:36:15 +02:00
Mara Bos
1854f8b3d8 Warn for #[unstable] on trait impls when it has no effect. 2020-09-11 13:36:15 +02:00
Caleb Zulawski
8f69266f79 Emit warnings on misplaced #[no_mangle] 2020-09-05 22:12:24 -04:00
Caleb Zulawski
0c62ef08bd Allow #[cold], #[track_caller] on closures. Fix whitespace in error messages. 2020-09-05 20:46:38 -04:00
Caleb Zulawski
f745b34960 Emit warnings for misplaced attributes used by some crates 2020-09-05 20:46:37 -04:00
Caleb Zulawski
4efe97a3d9 Check placement of more attributes 2020-09-05 20:45:43 -04:00
bors
02fe30971e Auto merge of #75888 - GuillaumeGomez:trait-impl-assoc-const-doc-alias, r=ollie27
Add check for doc alias on assoc const in trait impl

Fixes #73721.

r? @ollie27
2020-09-05 09:35:17 +00:00
LeSeulArtichaut
3e14b684dd Change ty.kind to a method 2020-09-04 17:47:51 +02:00
Guillaume Gomez
6e43ff5cea Add check for doc alias on associated const in trait impls 2020-09-03 22:11:29 +02:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00