Commit Graph

4991 Commits

Author SHA1 Message Date
yukang
1674eea8ad Fix #88256, remove duplicated diagnostic 2021-09-04 19:26:25 +08:00
Esteban Kuber
48b8e4577a Detect bare blocks with type ascription that were meant to be a struct literal
Address part of #34255.

Potential improvement: silence the other knock down errors in
`issue-34255-1.rs`.
2021-09-03 14:43:04 +00:00
Cameron Steffen
a603756cc5 Temporary fix rustfmt for let-else 2021-08-30 20:18:41 -05:00
Deadbeef
20ddab3def Fix rustfmt test 2021-08-27 11:53:03 +00:00
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
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
bors
2323cbc231 Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
rfc3052 followup: Remove authors field from Cargo manifests

Since RFC 3052 soft deprecated the authors field, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information for contributors, we may as well
remove it from crates in this repo.
2021-08-02 05:49:17 +00:00
Jade
e9038b8842 rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Caleb Cartwright
e4b8714c09 Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt 2021-07-25 22:57:19 -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
Yuki Okushi
d13020cd31 Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
Spaces
2021-06-22 00:00:38 +09:00
Alexander Melentyev
71f01d1974 Delete spaces 2021-06-21 12:11:37 +03: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
Joshua Nelson
d67f1a48ef Update log to 0.4.14
This avoids the following warning:

```
warning: trailing semicolon in macro used in expression position
   --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/src/macros.rs:152:45
    |
147 | / macro_rules! debug {
148 | |     (target: $target:expr, $($arg:tt)+) => (
149 | |         log!(target: $target, $crate::Level::Debug, $($arg)+);
150 | |     );
151 | |     ($($arg:tt)+) => (
152 | |         log!($crate::Level::Debug, $($arg)+);
    | |                                             ^
153 | |     )
154 | | }
    | |_- in this expansion of `debug!`
    |
   ::: src/tools/rustfmt/src/modules/visitor.rs:36:23
    |
36  |               Err(e) => debug!("{}", e),
    |                         --------------- in this macro invocation
    |
    = note: requested on the command line with `-W semicolon-in-expressions-from-macros`
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
```
2021-05-14 21:54:43 -05:00
Caleb Cartwright
7872306edf chore: update gitattributes for files with windows style line endings 2021-05-14 18:50:25 -05:00
Andy Wang
927561ace1 Bump nightly version 2021-05-12 22:12:43 -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
2a3635d5d1 tests: remove snippets with inner attrs on non-block expressions 2021-05-04 18:38:22 -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
84ff0013c2 Add the case in duplicate issue (#4806) to the idempotent tests 2021-04-21 21:30:42 -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
Joseph Birr-Pixton
58157bb4b7 Add some basic tests for chain_width use 2021-04-21 21:27:50 -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
Caleb Cartwright
0269eb1c5f docs: update configuration info 2021-04-21 21:27:50 -05:00
Joshua Nelson
26fb3fa737 Use rustup in CI to automatically determine the toolchain version needed
This also removes the (now unused) `RUSTC_RELEASE` and
`RUSTC_RELEASE_CHANNEL` variables.
2021-04-21 21:17:36 -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
Joshua Nelson
6767c1d051 Don't show CRLF tests as modified in the working directory
This was being overriden by `lf=eof` in `.gitattributes` in the root
directory. Override it again to avoid warnings like this:

```
$ git diff src/tools/rustfmt/tests/target/issue-3494/crlf.rs
warning: CRLF will be replaced by LF in src/tools/rustfmt/tests/target/issue-3494/crlf.rs.
The file will have its original line endings in your working directory
```
2021-04-21 21:17:36 -05:00
Caleb Cartwright
0bd2b1927c chore: bump version and changelog 2021-04-03 00:30:12 -05:00
Caleb Cartwright
01cdc15f13 chore: bump toolchain 2021-04-02 23:21:06 -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
ef57c5bf67 chore: bump rustc-ap crates to v712 2021-04-02 23:21:06 -05:00
Caleb Cartwright
748e595047 deps: remove unused rustc_attr crate AP crate 2021-04-02 23:21:06 -05:00