Commit Graph

94179 Commits

Author SHA1 Message Date
Santiago Pastorino
e6aa4b8033 Add comment to explain why we change the layout for Projection 2019-05-25 22:28:15 +02:00
Chris Gregory
f27ec0f05f Add test that impl Seek for BufReader correctly invalidates buffer between seeks 2019-05-25 15:02:35 -05:00
Oliver Scherer
a15df94b69 Turn ICE on type arguments on variables into an error 2019-05-25 21:16:27 +02:00
Esteban Küber
4e68ddca90 review comments: move back some methods and clean up wording 2019-05-25 12:15:06 -07:00
Esteban Küber
d1364d5284 Move some methods to diagnostics.rs away from parser.rs
Move a bunch of error recovery methods to `diagnostics.rs` away from
`parser.rs`.
2019-05-25 12:11:41 -07:00
Esteban Küber
976541884f Tweak self arg not as first argument of a method diagnostic
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```
2019-05-25 12:05:18 -07:00
Esteban Küber
609ffa1a89 Reword malformed attribute input diagnostics
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser
2019-05-25 11:55:50 -07:00
Esteban Küber
1cc42ea675 Add support for suggesting as_ref to Result accesses 2019-05-25 11:12:41 -07:00
bors
f492693982 Auto merge of #59276 - oli-obk:cleanups, r=eddyb
Cleanup (pretty) printing of `ty::Const`

r? @eddyb

addresses 5cd2806621 (r266243236) and 5cd2806621 (r266243336)
2019-05-25 16:08:11 +00:00
Oliver Scherer
0b732aa607 Update nll ui tests 2019-05-25 17:21:29 +02:00
Wesley Wiser
9bfbbd2a78 Add additional trace statements to the const propagator
This makes it easier to figure out when const propagation fails.
2019-05-25 11:02:59 -04:00
ljedrz
2f3533b758 Add clippy and fix commands to x.py 2019-05-25 15:30:16 +02:00
Fabian Drinck
a5e9d8240e Auto-derive Encode and Decode implementations 2019-05-25 11:40:06 +02:00
bors
02f5786a32 Auto merge of #61151 - Centril:rollup-5rpyhfo, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #61092 (Make sanitize_place iterate instead of recurse)
 - #61093 (Make borrow_of_local_data iterate instead of recurse)
 - #61094 (Make find_local iterate instead of recurse)
 - #61099 (Make ignore_borrow iterate instead of recurse)
 - #61103 (Make find iterate instead of recurse)
 - #61104 (Make eval_place_to_op iterate instead of recurse)

Failed merges:

r? @ghost
2019-05-25 09:30:02 +00:00
Ralf Jung
428ab7e1bd shadow as_ptr as as_mut_ptr in Vec to avoid going through Deref 2019-05-25 10:36:07 +02:00
Ralf Jung
9d82826e55 add test checking that Vec push/pop does not invalidate pointers 2019-05-25 10:11:00 +02:00
varkor
e694807650 Fix missing tcx 2019-05-25 10:07:02 +02:00
Oliver Scherer
a0275e3bf3 Only print integers in symbol path's constants 2019-05-25 10:07:02 +02:00
Oliver Scherer
dd327951eb Update ui tests 2019-05-25 10:07:02 +02:00
Oliver Scherer
825cfdbadc Print types for unevaluated constants 2019-05-25 10:07:02 +02:00
Oliver Scherer
fa459a08e1 Fix rebase fallout 2019-05-25 10:07:02 +02:00
Oliver Scherer
52fa900d62 Break cycle during array length printing 2019-05-25 10:07:02 +02:00
Eduard-Mihai Burtescu
89b2fb631a rustc: integrate ty::Const into ty::print as print_const. 2019-05-25 10:07:02 +02:00
Oliver Scherer
28198bb3be Update ui tests 2019-05-25 10:07:02 +02:00
Oliver Scherer
b816ec1eb4 Print unevaluted constants as _ or as their source representation 2019-05-25 10:07:02 +02:00
Oliver Scherer
ecee75d114 Use write_char to skip the formatting infrastructure 2019-05-25 10:07:02 +02:00
Oliver Scherer
90bb861b2e Fix tidy 2019-05-25 10:07:01 +02:00
Oliver Scherer
fec79d3552 Print generic args in function calls in MIR 2019-05-25 10:07:01 +02:00
Oliver Scherer
0528954c80 Group common printing code during constant pretty printing 2019-05-25 10:07:01 +02:00
Oliver Scherer
db652fcde4 Render unresolved anon consts like closures 2019-05-25 10:07:01 +02:00
Oliver Scherer
669bc77886 u8 is printed as a number, not a character 2019-05-25 10:07:01 +02:00
Oliver Scherer
9b5896ade3 Render const byte slices in MIR 2019-05-25 10:07:01 +02:00
Oliver Scherer
fa17654f79 Make ConstValue::Slice solely take [u8] and str 2019-05-25 10:07:01 +02:00
Oliver Scherer
af6ac1fa14 Refactor string constant printing to prep for byte string printing 2019-05-25 10:07:01 +02:00
Oliver Scherer
264c149c89 Add test showing how byte slices are printed in MIR 2019-05-25 10:07:01 +02:00
Oliver Scherer
e694b63cd1 Don't use ty::Const without immediately interning 2019-05-25 10:07:01 +02:00
Oliver Scherer
9d82107f16 Print const chars escaped with surrounding quotes 2019-05-25 10:07:01 +02:00
Oliver Scherer
5713677862 Merge the string printing paths of ty::Const 2019-05-25 10:07:01 +02:00
Oliver Scherer
a92d97ee70 There's a tcx in scope, don't use the tls one 2019-05-25 10:07:01 +02:00
Oliver Scherer
8d4f4cdada Reuse the pretty printing architecture for printing of constants 2019-05-25 10:07:01 +02:00
Oliver Scherer
d85e866c0d Ignore .vscode even if it is a symlink 2019-05-25 10:07:01 +02:00
Oliver Scherer
86d65d8ec8 Remove unnecessary secondary recursion 2019-05-25 10:07:00 +02:00
Ralf Jung
72145ea2fe MaybeUninit doctest: remove unnecessary type ascription 2019-05-25 09:11:20 +02:00
Ralf Jung
c2e7eb6ff0 split core::ptr module into multiple files 2019-05-25 09:03:45 +02:00
bors
315ab95a9c Auto merge of #61150 - Centril:rollup-wmm7qga, r=Centril
Rollup of 13 pull requests

Successful merges:

 - #61026 (Tweak macro parse errors when reaching EOF during macro call parse)
 - #61095 (Update cargo)
 - #61096 (tidy: don't short-circuit on license error)
 - #61107 (Fix a couple docs typos)
 - #61110 (Revert edition-guide toolstate override)
 - #61111 (Fixed type-alias-bounds lint doc)
 - #61113 (Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since 1.35)
 - #61116 (Remove the incorrect warning from README.md)
 - #61118 (Dont ICE on an attempt to use GAT without feature gate)
 - #61121 (improve debug-printing of scalars)
 - #61125 (Updated my mailmap entry)
 - #61134 (Annotate each `reverse_bits` with `#[must_use]`)
 - #61138 (Move async/await tests to their own folder)

Failed merges:

r? @ghost
2019-05-25 04:10:07 +00:00
Mazdak Farrokhzad
1cd3dddc94
Rollup merge of #61104 - spastorino:eval-place-to-op-iterate, r=oli-obk
Make eval_place_to_op iterate instead of recurse

r? @oli-obk
2019-05-25 04:57:38 +02:00
Mazdak Farrokhzad
dd33e8a84a
Rollup merge of #61103 - spastorino:find-iterate, r=oli-obk
Make find iterate instead of recurse

r? @oli-obk
2019-05-25 04:57:37 +02:00
Mazdak Farrokhzad
e30300d6e8
Rollup merge of #61099 - spastorino:ignore-borrow-iterate, r=oli-obk
Make ignore_borrow iterate instead of recurse

r? @oli-obk
2019-05-25 04:57:36 +02:00
Mazdak Farrokhzad
af015527aa
Rollup merge of #61094 - spastorino:find-local-iterate, r=oli-obk
Make find_local iterate instead of recurse

r? @oli-obk
2019-05-25 04:57:34 +02:00
Mazdak Farrokhzad
b4f6e5baeb
Rollup merge of #61093 - spastorino:borrow-of-local-data-iterate, r=oli-obk
Make borrow_of_local_data iterate instead of recurse

r? @oli-obk
2019-05-25 04:57:33 +02:00