Commit Graph

91 Commits

Author SHA1 Message Date
Mazdak Farrokhzad 2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Camille GILLOT 700ac84eae Rename traits::drop -> traits::misc. 2020-01-07 19:36:50 +01:00
Camille GILLOT f629baf96c Move magic traits queries to rustc::traits::drop. 2020-01-07 18:14:32 +01:00
Camille GILLOT 787cd5493a Make traits::util::* free functions. 2020-01-07 17:48:41 +01:00
Mazdak Farrokhzad ebfd8673a7 Remove rustc_hir reexports in rustc::hir. 2020-01-05 12:49:22 +01:00
Andy Russell e9990bc65f
clarify that `Drop` can be implemented for enums and unions too 2020-01-03 17:57:24 -05:00
Mark Rousskov a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad a7aec3f207 1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
2. mir::Mutability -> ast::Mutability.
2019-12-20 22:22:44 +01:00
Guillaume Gomez 798e389e57 Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
Camille GILLOT ed640c6a27 Merge hir::Mutability into ast::Mutability. 2019-11-10 12:21:05 +01:00
Mark Rousskov 0a4d55ddb8 Remove stray uses of gcx name 2019-09-27 13:34:14 -04:00
varkor 7bc94cc3c2 Rename `Item.node` to `Item.kind` 2019-09-26 18:21:48 +01:00
varkor e2e0f9af85 Rename `sty` to `kind` 2019-09-25 15:50:04 +01:00
ljedrz 37d7e1f22a rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-04 12:53:12 +02:00
Jeremy Stucki d50a3a7b86
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
ljedrz f05cbc98f8 HIR: rename find_by_hir_id to find 2019-06-24 09:58:49 +02:00
ljedrz d996c4d5a3 remove _by_hir_id if there is no NodeId counterpart 2019-06-17 18:57:21 +02:00
Eduard-Mihai Burtescu f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu fff08cb043 Run `rustfmt --file-lines ...` for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu 17cdd356da rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu 2441253508 Fix fallout from `deny(unused_lifetimes)`. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu 37799a5552 rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`. 2019-06-12 13:38:27 +03:00
Tim Diekmann 1b679e74f0
Only allow ZSTs with 1 byte alignment 2019-04-30 14:38:17 +02:00
Tim Diekmann abf73a6aeb
Support ZSTs in DispatchFromDyn 2019-04-29 14:03:40 +02:00
bors 0633c55d20 Auto merge of #59068 - ljedrz:kill_off_NodeId_stragglers, r=Zoxc
HirIdification: kill off NodeId stragglers

The final stages of HirIdification (#57578).

This PR, along with https://github.com/rust-lang/rust/pull/59042, should finalize the HirIdification process (at least the more straightforward bits).

- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)

I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel`  and `hir::ItemId`, but I don't know if this is feasible.

I'll be happy to do more if I've missed anything.
2019-03-23 17:34:18 +00:00
Eduard-Mihai Burtescu e0c75ff40d rustc: rename item_path to def_path (except the module in ty). 2019-03-15 13:25:10 +02:00
ljedrz 7e1914f75b hir: replace NodeId with HirId in trait_impls 2019-03-10 13:07:16 +01:00
ljedrz cd06038b54 HirIdification: replace NodeId method calls 2019-03-07 09:22:43 +01:00
ljedrz eac43ccda4 HirId-ify hir::BodyId 2019-02-13 09:54:58 +01:00
ljedrz 6da9129b36 typeck: partially HirIdify 2019-02-05 20:34:06 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07: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
scalexm d0447550da Shift both late bound regions and bound types 2018-11-03 11:41:51 +01:00
Michael Hewson a468da9cfb Add a check for reprs that could change the ABI
disallow `#[repr(C)] and `#[repr(packed)]` on structs implementing DispatchFromDyn because they will change the ABI from Scalar/ScalarPair to Aggregrate, resulting in an ICE during object-safety checks or codegen
2018-11-01 18:16:59 -04:00
Michael Hewson b5b25f8196 Put backticks around field names, types and paths in error messages
Added to `DispatchFromDyn` and `CoerceUnsized` error messages
2018-11-01 18:16:59 -04:00
Michael Hewson f12c250e40 Replace CoerceSized trait with DispatchFromDyn
Rename `CoerceSized` to `DispatchFromDyn`, and reverse the direction so that, for example, you write

```
impl<T: Unsize<U>, U> DispatchFromDyn<*const U> for *const T {}
```

instead of

```
impl<T: Unsize<U>, U> DispatchFromDyn<*const T> for *const U {}
```

this way the trait is really just a subset of `CoerceUnsized`.

The checks in object_safety.rs are updated for the new trait, and some documentation and method names in there are updated for the new trait name — e.g. `receiver_is_coercible` is now called `receiver_is_dispatchable`. Since the trait now works in the opposite direction, some code had to updated here for that too.

I did not update the error messages for invalid `CoerceSized` (now `DispatchFromDyn`) implementations, except to find/replace `CoerceSized` with `DispatchFromDyn`. Will ask for suggestions in the PR thread.
2018-11-01 18:16:59 -04:00
Michael Hewson 9f59da2864 Implement object-safety for arbitrary_self_types: part 2
For now, all of the receivers that we care about are just a newtyped
pointer — i.e. `Box<Self>`, `Rc<Self>`, `Pin<Box<Self>>`, `Pin<&mut
Self>`. This is much simpler to implement in codeine than the more
general case, because the ABI is the same as a pointer. So we add some
checks in typeck/coherence/builtin.rs to make sure that implementors of
CoerceSized are just newtyped pointers. In this commit, we also
implement the codegen bits.
2018-11-01 18:15:20 -04:00
Matthias Krüger 4972beaf65 fix typos in various places 2018-10-23 15:56:25 +02:00
ljedrz 608c395818 A few cleanups and minor improvements to typeck 2018-09-29 11:13:00 +02:00
Niko Matsakis a13c9f6bfd convert from an `UnlessNll` flag to a `SuppressRegionErrors` flag
Hopefully this will help clarify the behavior in the various borrowck
modes
2018-09-26 09:38:26 -04:00
Niko Matsakis 1830c9e8f9 use a `UnlessNll` flag to consolidate error reporting paths 2018-09-26 09:30:54 -04: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
Mark Rousskov 4897820a16 Remove unused arguments 2018-07-30 17:00:14 -06:00
csmoe 5b0cf56f32 ItemKind 2018-07-16 15:09:17 +02:00
ljedrz f29ac5a680 Deny bare trait objects in librustc_typeck 2018-07-12 10:57:04 +02:00
Vadim Petrochenkov 189c0a1297 Use `Ident`s for fields in HIR 2018-05-26 14:41:58 +03:00