Deadbeef
076916fe94
Introduce ~const
...
- [x] Removed `?const` and change uses of `?const`
- [x] Added `~const` to the AST. It is gated behind const_trait_impl.
- [x] Validate `~const` in ast_validation.
- [ ] Add enum `BoundConstness` to the HIR. (With variants `NotConst` and
`ConstIfConst` allowing future extensions)
- [ ] Adjust trait selection and pre-existing code to use `BoundConstness`.
- [ ] Optional steps (*for this PR, obviously*)
- [ ] Fix #88155
- [ ] Do something with constness bounds in chalk
2021-08-27 05:07:37 +00:00
Ashvin Arsakularatne
e81c393663
fix: remove wrong reformatting of qualified paths in struct patterns
2021-08-25 21:18:41 -05:00
David Tolnay
fd6b025e8a
Preserve visibility on trait items inside trait and impl
2021-08-22 12:06:18 -05:00
Frank Steffahn
9bc0dbeb64
Fix typos “an”→“a” and a few different ones that appeared in the same search
2021-08-22 18:15:49 +02:00
Frank Steffahn
25ebc35f97
Fix more “a”/“an” typos
2021-08-22 16:35:29 +02:00
bors
e1dac88cfe
Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrum
...
Document private items for rustfmt
This is possible now that https://github.com/rust-lang/rust/pull/73936 has been merged.
2021-08-17 04:18:55 +00:00
Joshua Nelson
7769ed0484
Document private items for rustfmt
...
This is possible now that rustdoc allows passing
`--document-private-items` more than once.
2021-08-16 01:46:56 +00:00
Caio
64bf8dfa33
Introduce hir::ExprKind::Let - Take 2
2021-08-15 16:18:26 -03:00
Caleb Cartwright
5d8eb8d79c
fix: don't drop drop generic args on assoc ty constraints
2021-08-08 13:58:10 -05:00
Caleb Cartwright
fefb5427a2
fix: handle GAT types in impls with self bounds
2021-08-06 22:03:40 -05:00
klensy
8c52aae10a
Bump deps
...
* dirs-sys v0.3.4 -> v0.3.6 to drop a lot of deps
regex v1.3.1 -> v1.4.3 drops thread_local 0.3.6
bytecount v0.6.0 -> v0.6.2 replaces packed_simd with packed_simd_2
ignore v0.4.11 -> v0.4.17 drop crossbeam-channel v0.4.0
* itertools 8.0 -> 9.0
bump `ignore` version in Cargo.toml
* cargo_metadata 0.8 -> 0.12
* env_logger 0.6 -> 0.8
2021-07-27 19:50:11 -05:00
Ellen
0b21ea2161
Unyeet const param defaults
2021-07-27 19:50:11 -05:00
Outvi V
e7fa07036f
fix: make --edition 2021 visible in --help
2021-07-27 19:50:11 -05:00
Caleb Cartwright
e4b8714c09
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt
2021-07-25 22:57:19 -05:00
Caleb Cartwright
d42be80bf7
chore: disable clippy::matches_like_macro lint
2021-07-25 22:53:32 -05:00
Matthias Krüger
4c2959fb12
fix a bunch of clippy warnings
...
clippy::bind_instead_of_map
clippy::branches_sharing_code
clippy::collapsible_match
clippy::inconsistent_struct_constructor
clippy::int_plus_one
clippy::iter_count
clippy::iter_nth_zero
clippy::manual_range_contains
clippy::match_like_matches_macro
clippy::needless::collect
clippy::needless_question_mark
clippy::needless_return
clippy::op_ref
clippy::option_as_ref_deref
clippy::ptr_arg
clippy::redundant_clone
clippy::redundant_closure
clippy::redundant_static_lifetimes
clippy::search_is_some
clippy::#single_char_add_str
clippy::single_char_pattern
clippy::single_component_path_imports
clippy::single_match
clippy::skip_while_next
clippy::unnecessary_lazy_evaluations
clippy::unnecessary_unwrap
clippy::useless_conversion
clippy::useless_format
2021-07-25 22:53:32 -05:00
Caleb Cartwright
b305d62e5b
fix: correct arm leading pipe check ( #4880 )
...
In the event a pattern starts with a leading pipe
the pattern span will contain, and begin with, the pipe.
This updates the process to see if a match arm contains
a leading pipe by leveraging this recent(ish) change to
the patterns in the AST, and avoids an indexing bug that
occurs when a pattern starts with a non-ascii char in the
old implementation.
2021-07-25 22:53:32 -05:00
Michael Murphy
486e774fbf
Adjusting help message ( #4865 )
...
On stable, running with `--help|-h` shows information about `file-lines`
which is a nightly-only option. This commit removes all mention of
`file-lines` from the help message on stable.
There is room for improvement here; perhaps a new struct called, e.g.,
`StableOptions` could be added to complement the existing
`GetOptsOptions` struct. `StableOptions` could have a field for each
field in `GetOptsOptions`, with each field's value being a `bool` that
specifies whether or not the option exists on stable. Or is this adding
too much complexity?
2021-07-25 22:53:32 -05:00
Casey Rodarmor
1ca3798d2c
Improve pasta copyability of merge_imports
deprecation message
...
Add double quotes around `Crate` so that it can be copied directly into a `Cargo.toml` file
2021-07-25 22:53:32 -05:00
Ruby Lazuli
75765f656e
Allow --edition 2021
to be passed to rustfmt
...
This was added to Configurations.md in #4618 , but the option wasn't
actually made available. This should let people who are using Rust 2021
on nightly rustc run `cargo fmt` again.
2021-07-25 22:53:32 -05:00
Camille GILLOT
277feac1f9
Use LocalExpnId where possible.
2021-07-17 19:41:02 +02:00
Guillaume Gomez
abf449ffa6
Rework SESSION_GLOBALS API to prevent overwriting it
2021-07-08 16:16:28 +02:00
Joshua Nelson
33acc960f7
Document rustfmt on nightly-rustc
...
The recursion_limit attribute avoids the following error:
```
error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`)
```
2021-07-01 19:39:47 -04:00
Yuki Okushi
0b8a26f507
Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Mark-Simulacrum
...
rustfmt: load nested out-of-line mods correctly
This should address https://github.com/rust-lang/rustfmt/issues/4874
r? `@Mark-Simulacrum`
Decided to make the change directly in tree here for expediency/to minimize any potential backporting issues, and because there's some subtree sync items I need to get resolved before pulling from r-l/rustfmt
2021-06-22 00:00:41 +09:00
Caleb Cartwright
2608f2c63b
fix(rustfmt): load nested out-of-line mods correctly
2021-06-17 22:35:19 -05:00
Yuki Okushi
1e2258ffa9
Use AttrVec
for Arm
, FieldDef
, and Variant
2021-06-17 08:04:54 +09:00
Ryan Levick
58c63cf8de
Add support for using qualified paths with structs in expression and pattern
...
position.
2021-06-10 13:18:41 +02:00
jedel1043
e243be6ada
Allow formatting Anonymous{Struct, Union}
declarations
2021-05-16 22:13:38 -05:00
Andy Wang
ef31361766
Rename RealFileName::Named
to LocalPath
2021-05-12 22:12:43 -05:00
Andy Wang
e4b5621b0e
Only deal with LocalPath in conversion
2021-05-12 22:12:43 -05:00
Andy Wang
8526acee21
Rename span_to_string to span_to_diagnostic_string
2021-05-12 22:12:43 -05:00
Caleb Cartwright
f87414729f
fix: backport changes for latest rustc api comaptibility
2021-05-02 10:37:43 -05:00
Yuki Okushi
ddb224a173
Upgrade annotate-snippets
to 0.8 ( #4762 )
2021-04-22 08:33:36 -05:00
ChinYing-Li
dac2423f3f
Recognize when a block comment has been ended inside a string literal ( #4312 )
2021-04-21 21:30:42 -05:00
Caleb Cartwright
78b0728887
refactor: remove panics on misconfigured widths
2021-04-21 21:27:50 -05:00
Caleb Cartwright
a168d92f9a
tests: augment heuristics tests
2021-04-21 21:27:50 -05:00
Caleb Cartwright
1bcc1f8df5
refactor: apply heuristic config changes in lib
2021-04-21 21:27:50 -05:00
Caleb Cartwright
ea1611c06e
feat(config): expose all width heurstic options
2021-04-21 21:27:50 -05:00
Joshua Nelson
943b97c3ae
Fix errors when parallel_compiler
is enabled
2021-04-21 21:17:36 -05:00
Joshua Nelson
61ee1089f0
Use rustc_private
instead of crates.io dependencies
...
- Update rust-toolchain to also install `rustc-dev` component
2021-04-21 21:17:36 -05:00
Caleb Cartwright
c32f2ec015
chore: fmt and cleanup
2021-04-02 23:21:06 -05:00
Caleb Cartwright
4948911608
deps: apply rustc-ap-* v712 changes
2021-04-02 23:21:06 -05:00
Caleb Cartwright
4c617e8fb3
deps: apply rustc module loading changes
2021-04-02 23:21:06 -05:00
Caleb Cartwright
a1dc57ace1
chore: apply AST HasAttrs->AstLike changes
2021-04-02 23:21:06 -05:00
Caleb Cartwright
612e8d5b9b
refactor: apply rustc mod parsing changes
2021-04-02 23:21:06 -05:00
Caleb Cartwright
2c6339571b
chore: apply pattern parsing changes
2021-04-02 23:21:06 -05:00
Caleb Cartwright
cbd83b8083
chore: add span creation util function
2021-04-02 23:21:06 -05:00
Yuki Okushi
ca4e9f47b9
Fix a legacy_derive_helpers
warning
2021-03-18 23:34:32 -05:00
Joshua Nelson
c3a5111106
Fix some clippy warnings
...
This commit can be replicated with
`cargo clippy --fix -Z unstable-options && cargo +nightly-2021-02-10 fmt`.
2021-02-18 20:20:29 -06:00
David Bar-On
432e09e89f
Add the use of rewrite_assign_rhs_with_comments to 1.x
2021-02-17 20:47:20 -06:00