Alexander Regueiro
c3e182cf43
rustc: doc comments
2019-02-10 23:42:32 +00:00
Taiki Endo
725af30809
librustc_mir => 2018
2019-02-08 06:28:15 +09:00
Oliver Scherer
aedc3a51df
Declare some unconst operations as unsafe in const fn
2019-01-21 16:01:57 +01:00
Niko Matsakis
8e89184a7b
rename type_moves_by_default
to type_is_copy_modulo_regions
2019-01-02 17:35:06 -05:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Mazdak Farrokhzad
b42a3acaec
stabilize min_const_unsafe_fn in 1.33.
2018-12-23 10:29:38 +01:00
Ralf Jung
c1160a8f86
treat ref-to-raw cast like a reborrow: do a special kind of retag
2018-12-18 09:56:31 +01:00
Oliver Scherer
8d0b64f16d
Make const unsafe fn
bodies unsafe
2018-12-11 10:27:00 +01: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
Oliver Scherer
f4115765c5
Intrinsic checks are just needed for qualify_min_const_fn
2018-12-04 10:17:37 +01:00
Oliver Scherer
b77969466c
Clear up some code
2018-12-04 10:17:37 +01:00
Oliver Scherer
4497ff3762
Emit feature gate suggestion
2018-12-04 10:17:36 +01:00
Oliver Scherer
e5d90652e2
Comment on the unsafety code for layout constrained fields
2018-12-04 10:17:36 +01:00
Oliver Scherer
55abc0bc90
Also prevent mutation fields directly
2018-12-04 10:17:36 +01:00
Oliver Scherer
1894a5fe2c
Also make immutable references to non-freeze restricted value range types unsafe
2018-12-04 10:17:36 +01:00
Oliver Scherer
081c49783f
generalize the message about the creation of layout restricted types
2018-12-04 10:17:36 +01:00
Oliver Scherer
8bdb11c4d9
Forbid the creation of mutable borrows to fields of layout constrained types
2018-12-04 10:17:36 +01:00
Oliver Scherer
693c55372e
Move ref to packed struct field check into projection arm
2018-12-04 10:17:36 +01:00
Oliver Scherer
02b22323f1
Make sure the initialization of constrained int range newtypes is unsafe
2018-12-04 10:17:36 +01:00
Oliver Scherer
906a49eef2
Document unsafe rules with comments and bug!
calls
2018-12-04 10:17:36 +01:00
Oliver Scherer
f2ae7b78d6
Allow calling const unsafe fn
in const fn
behind a feature gate
2018-12-04 10:17:36 +01:00
Matthew Jasper
b16985a354
Remove mir::StatementKind::EndRegion
...
Since lexical MIR borrow check is gone, and validation no longer uses
these, they can be removed.
2018-11-18 11:05:19 +00:00
Ralf Jung
f27cd60ae1
no more action on ref or cast, but add new MIR statement for escaping a ptr to raw
2018-11-07 16:54:31 +01:00
Ralf Jung
aafcf2c942
Emit Retag statements, kill Validate statements
...
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-29 09:05:18 +01:00
David Wood
6208bd8e03
Refactor and add PlaceContext::AscribeUserTy
.
...
This commit refactors `PlaceContext` to split it into four different
smaller enums based on if the context represents a mutating use,
non-mutating use, maybe-mutating use or a non-use (this is based on the
recommendation from @oli-obk on Zulip[1]).
This commit then introduces a `PlaceContext::AscribeUserTy` variant.
`StatementKind::AscribeUserTy` is now correctly mapped to
`PlaceContext::AscribeUserTy` instead of `PlaceContext::Validate`.
`PlaceContext::AscribeUserTy` can also now be correctly categorized as a
non-use which fixes an issue with constant promotion in statics after a
cast introduces a `AscribeUserTy` statement.
[1]: https://rust-lang.zulipchat.com/#narrow/stream/122657-wg-nll/subject/.2355288.20cast.20fails.20to.20promote.20to.20'static/near/136536949
2018-10-27 12:11:37 +02:00
Oliver Scherer
3c9258e604
Prefer Default::default
over FxHash*::default
in struct constructors
2018-10-19 14:34:44 +02:00
Oliver Scherer
ee81739dc1
Deprecate the FxHashMap()
and FxHashSet()
constructor function hack
2018-10-19 14:34:44 +02:00
Remy Rakic
f5e310530a
Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake read
2018-09-18 14:36:37 +02:00
Niko Matsakis
dd3cc9669a
add the AscribeUserType
statement kind
...
Make it have the semantics of subtype.
2018-09-10 08:22:31 -04:00
Oliver Schneider
472ca71598
Implement the min_const_fn
feature gate
2018-08-31 08:39:59 +02:00
varkor
e2a1cce9c5
Rename hir::map::NodeKind to hir::Node
2018-08-27 21:46:23 +01:00
varkor
11665ca45a
Remove path prefixes from NodeKind
2018-08-27 21:46:13 +01:00
varkor
befc4b1100
Rename hir::map::Node to hir::map::NodeKind
2018-08-27 21:45:46 +01:00
varkor
6f637da50c
Remove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-22 16:07:44 +01:00
Donato Sciarra
d3fe97f3d3
mv codemap() source_map()
2018-08-19 23:01:01 +02:00
ljedrz
421b2ba347
Don't format!() string literals
2018-07-28 17:58:52 +02:00
Oliver Schneider
de511438cd
Promoteds are statics and statics have a place, not just a value
2018-07-23 09:51:30 +02:00
csmoe
5b0cf56f32
ItemKind
2018-07-16 15:09:17 +02:00
Ralf Jung
f68323b28a
fix typo
2018-07-11 12:00:05 +02:00
Ralf Jung
f511c5ea4a
improve error message shown for unsafe operations: explain why undefined behavior could arise
...
Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
2018-07-10 11:01:44 +02:00
Without Boats
18ff7d091a
Parse async fn header.
...
This is gated on edition 2018 & the `async_await` feature gate.
The parser will accept `async fn` and `async unsafe fn` as fn
items. Along the same lines as `const fn`, only `async unsafe fn`
is permitted, not `unsafe async fn`.The parser will not accept
`async` functions as trait methods.
To do a little code clean up, four fields of the function type
struct have been merged into the new `FnHeader` struct: constness,
asyncness, unsafety, and ABI.
Also, a small bug in HIR printing is fixed: it previously printed
`const unsafe fn` as `unsafe const fn`, which is grammatically
incorrect.
2018-06-21 22:29:47 -07:00
Eduard-Mihai Burtescu
5a5c7ded0d
rustc: rename ty::maps to ty::query.
2018-06-14 18:05:12 +03:00
Mark Simulacrum
5c374739b6
Specify that packed types must derive, not implement, Copy
2018-06-02 07:24:34 -06:00
Eduard-Mihai Burtescu
06d88cda08
rustc: rename mir::LocalDecl's syntactic_source_info to source_info.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
3da186b67f
rustc: use syntactic (instead of visibility) source info where appropriate.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
0895590c53
rustc: rename mir::LocalDecl's source_info to visibility_source_info.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
ca1ac6b6fb
rustc: rename mir::SourceScopeInfo to mir::SourceScopeLocalData.
2018-05-30 20:30:09 +03:00
Eduard-Mihai Burtescu
85d44c4276
rustc: rename mir::VisibilityScope to mir::SourceScope.
2018-05-30 20:30:09 +03:00
Felix S. Klock II
24abe6f363
rust-lang/rust#27282 : Add StatementKind::ReadForMatch
to MIR.
...
(This is just the data structure changes and some boilerplate match
code that followed from it; the actual emission of these statements
comes in a follow-up commit.)
2018-05-29 23:01:36 +02:00