Commit Graph

956 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
38825674b2 add the ORDER_DEPENDENT_TRAIT_OBJECTS lint 2018-12-14 18:19:00 +02:00
Alex Crichton
cf47a19305 Bump to 1.33.0
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations

Actually updating the version number is blocked on updating Cargo
2018-12-12 08:09:26 -08:00
Nicholas Nethercote
1fe2c03240 Remove tokenstream::Delimited.
Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.

More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.

Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
2018-12-10 12:10:10 +11:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
John Kåre Alsaker
a70babed03 Use a function to access the Hir map to be able to turn it into a query later 2018-12-06 17:24:36 +01:00
Pietro Albini
9e7ff56750
Rollup merge of #56528 - sinkuu:unused_dep, r=Mark-Simulacrum
Remove unused dependency (rustc_lint -> rustc_mir)
2018-12-06 07:49:00 +01:00
Shotaro Yamada
6cfbb5b9a1 Remove unused dependency (rustc_lint -> rustc_mir) 2018-12-05 14:06:32 +09:00
Vadim Petrochenkov
08f8faedd0 syntax: Rename some keywords
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now
`SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-04 00:30:27 +03:00
Mark Mansi
59ae93daed remove uses of feature gate 2018-11-27 13:13:11 -06:00
scalexm
05995a8522 Introduce TyKind::Placeholder variant 2018-11-24 01:24:40 +01:00
Eduard-Mihai Burtescu
da622a3796 rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns. 2018-11-21 07:27:02 +02:00
varkor
737dec0ec1 Fix change to predicates 2018-11-19 18:54:52 +00:00
varkor
0ab70fab19 Fix typo in #[must_use] message 2018-11-19 17:41:10 +00:00
varkor
9178eb41d3 Handle trait objects 2018-11-19 17:41:10 +00:00
varkor
cb5520bc48 Recognise #[must_use] on traits, affecting impl Trait 2018-11-19 17:41:10 +00:00
varkor
b55717f9b0 Use general uninhabitedness checking 2018-11-19 17:41:10 +00:00
Pietro Albini
66fcb3ceb2
Rollup merge of #55901 - euclio:speling, r=petrochenkov
fix various typos in doc comments
2018-11-15 11:04:42 +01:00
Pietro Albini
3c7acc7878
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint

Fixes https://github.com/rust-lang/rust/issues/51043.
2018-11-15 11:04:40 +01:00
Andy Russell
4e35cbb22e
fix various typos in doc comments 2018-11-13 14:45:31 -05:00
Oliver Scherer
4a9ed3f25a Use type safe VariantIdx instead of usize everywhere 2018-11-12 14:24:45 +01:00
varkor
c63df7c64f Use non-short suggestion for parenthesised ..= 2018-11-10 21:27:40 +00:00
varkor
c148714549 Rewrite ... as ..= as a MachineApplicable 2018 idiom lint 2018-11-10 19:26:49 +00:00
Alexander Regueiro
90a14389d1 Removed DUPLICATE_ASSOCIATED_TYPE_BINDINGS lint.
This has been replaced by the hard error E0719.
2018-11-07 21:57:45 +00:00
kennytm
9d9146ad95
Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwco
refactor: use shorthand fields

refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-07 21:27:00 +08:00
teresy
eca11b99a7 refactor: use shorthand fields 2018-11-06 15:05:44 -05:00
bors
248745ab0c Auto merge of #55569 - durka:must-use-external-macro, r=alexcrichton
enforce unused-must-use lint in macros

Fixes #55516 by turning on the UNUSED_MUST_USE lint within macros.
2018-11-04 22:56:23 +00:00
Eduard-Mihai Burtescu
d00d42d079 rustc_target: pass contexts by reference, not value. 2018-11-04 20:33:57 +02:00
scalexm
1003b7f85e Move BoundTy to ty::TyKind 2018-11-03 11:33:14 +01:00
Alex Burka
9dd2c89066 enforce unused-must-use lint in macros 2018-11-01 03:32:45 +00:00
Andre Bogus
1a37575ade don't lint unused_parens on if (break _) 2018-10-29 12:41:56 +01:00
bors
fa45602b71 Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkov
Suggest to remove prefix `b` in cfg attribute lint string

Closes #54926
r? @estebank
2018-10-26 21:46:13 +00:00
bors
694cf75298 Auto merge of #53821 - oli-obk:sanity_query, r=RalfJung
Report const eval error inside the query

Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized.

r? @RalfJung

fixes #53561
2018-10-26 11:05:00 +00:00
bors
4bd4e4130e Auto merge of #54490 - wesleywiser:rewrite_it_in_mir, r=oli-obk
Rewrite the `UnconditionalRecursion` lint to use MIR

Part of #51002

r? @eddyb
2018-10-25 20:40:31 +00:00
Oliver Schneider
1c5ff292fc Rebase fallout 2018-10-25 17:20:39 +02:00
Ralf Jung
7ed7fc881e add the lint back to the list, and fix tests 2018-10-25 16:48:15 +02:00
Oliver Schneider
7fdf06cdde Report const eval error inside the query 2018-10-25 16:46:19 +02:00
Pietro Albini
6dfeb7602f
Rollup merge of #55138 - zackmdavis:the_paren_trap, r=pnkfelix
in which unused-parens suggestions heed what the user actually wrote

Aaron Hill pointed out that unnecessary parens around a macro call (paradigmatically, `format!`) yielded a suggestion of hideous macro-expanded code. `span_to_snippet` is fallable as far as the type system is concerned, so the pretty-printing can live on in the oft-neglected `else` branch.

Resolves #55109.
2018-10-25 14:31:01 +02:00
Zack M. Davis
1ddbd81c80 pick a reference issue for absolute-paths future incompatibility info
It would be kind of embarrassing to ship with the "issue TBD" message!
2018-10-20 12:40:48 -07:00
bors
94273f4d8e Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakis
Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack
2018-10-20 08:45:55 +00:00
csmoe
30c6698193 handle errors based on parse_sess 2018-10-20 11:11:31 +08:00
bors
42dde960f9 Auto merge of #55162 - nikomatsakis:issue-54902-underscore-bound, r=tmandry
handle underscore bounds in unexpected places

Per the discussion on #54902, I made it a hard error to use lifetime bounds in various places where they used to be permitted:

- `where Foo: Bar<'_>` for example

I also moved error reporting to HIR lowering and added `Error` variants to let us suppress downstream errors that result.

I (imo) improved the error message wording to be clearer, as well.

In the process, I fixed the ICE in #52098.

Fixes #54902
Fixes #52098
2018-10-19 22:54:14 +00:00
Oliver Scherer
ee81739dc1 Deprecate the FxHashMap() and FxHashSet() constructor function hack 2018-10-19 14:34:44 +02:00
kennytm
9d2eb9b752
Rollup merge of #55166 - varkor:ret-parens, r=davidtwco
Don't warn about parentheses on `match (return)`

Fixes #55164.
2018-10-19 16:47:48 +08:00
varkor
0a858dc859 Don't warn about parentheses on match (return) 2018-10-17 23:51:01 +01:00
Niko Matsakis
1f4d100472 move E0637 to lowering and improve output, add more tests 2018-10-17 17:15:24 -04:00
Zack M. Davis
475be10dbd in which unused-parens suggestions heed what the user actually wrote
Aaron Hill pointed out that unnecessary parens around a macro call
(paradigmatically, `format!`) yielded a suggestion of hideous
macro-expanded code. (The slightly unusual choice of using the
pretty-printer to compose suggestions was quite recently commented on
in the commit message for 1081bbbfc ("abolish ICE when pretty-printing
async block"), but without any grounds to condemn it as a 𝘣𝘢𝘥
choice. Hill's report provides the grounds.) `span_to_snippet` is
fallable as far as the type system is concerned (because, who knows,
macros or something), so the pretty-printing can live on in the
oft-neglected `else` branch.

Resolves #55109.
2018-10-16 21:36:02 -07:00
bors
8a7048b72b Auto merge of #54251 - varkor:silence-bad_style, r=Manishearth
Make `bad_style` a silent alias for `nonstandard_style`

Now only `nonstandard_style` is suggested in `rustc -W help`, but `bad_style` will not produce a warning. Closes #41646.

r? @Manishearth
2018-10-16 18:01:41 +00:00
Manish Goregaokar
7ba24e8fcf
Rollup merge of #54820 - kleimkuhler:issue-54538-unused_patterns-lint, r=nikomatsakis
Closes #54538: `unused_patterns` lint

Closes #54538

r? @nikomatsakis
2018-10-15 10:15:11 -07:00
varkor
f5b89062f6 Unused result warning: "X which must" ↦ "X that must" 2018-10-14 18:25:30 +01:00
Zack M. Davis
ab91a6b4df #[must_use] for associated functions is supposed to actually work
In the comments of (closed, defunct) pull request #54884, Mazdak
"Centril" Farrokhzad noted that must-use annotations didn't work on an
associated function (what other communities might call a "static
method"). Subsequent logging revealed that in this case we have a
`Def::Method`, whereas the lint pass was only matching on
`Def::Fn`. (One could argue that those def-names are thereby
misleading—must-use for self-ful methods have always worked—but
documenting or reworking that can be left to another day.)
2018-10-12 22:01:43 -07:00