Commit Graph

55 Commits

Author SHA1 Message Date
Mazdak Farrokhzad 8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
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
Mazdak Farrokhzad ebfd8673a7 Remove rustc_hir reexports in rustc::hir. 2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad 7901c7f707 canonicalize FxHash{Map,Set} imports 2020-01-04 18:57:22 +01:00
Mazdak Farrokhzad 4ff12ce4c1 Normalize `syntax::symbol` imports. 2020-01-02 13:57:04 +01:00
Mazdak Farrokhzad 75e4783f63 Normalize `syntax::source_map` imports. 2020-01-02 13:57:04 +01:00
Vadim Petrochenkov 70f1d57048 Rename `syntax_pos` to `rustc_span` in source code 2020-01-01 09:15:18 +03:00
Mark Rousskov a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Camille GILLOT 5fec1ca0ff Use Arena inside hir::ImplItem. 2019-12-21 23:31:47 +01:00
Camille GILLOT 0f7d77363b Use Arena inside hir::TraitItem. 2019-12-21 23:30:52 +01:00
Camille GILLOT 084e6722f9 Use Arena inside hir::Item. 2019-12-21 23:17:29 +01:00
Mazdak Farrokhzad 79077f13ff move GateIssue to rustc_feature & simplify emit_feature_err 2019-11-30 07:40:28 +01:00
Guillaume Gomez 798e389e57 Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
Nicholas Nethercote b9cef6984b Simplify various `Symbol` use points.
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch
of unnecessary sigils.
2019-11-02 09:01:02 +11:00
Shotaro Yamada ac2f906a59 Make use of the return value of `HashSet::insert` 2019-10-16 13:48:20 +09:00
Vadim Petrochenkov e8c28e24b9 rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
Charles Lew eb492455f2 Address review comments. 2019-10-07 12:01:56 +08:00
Charles Lew e70ffed9cd Add feature gate for raw_dylib. 2019-10-07 12:01:54 +08:00
varkor 7bc94cc3c2 Rename `Item.node` to `Item.kind` 2019-09-26 18:21:48 +01:00
bors f71826e8f2 Auto merge of #64303 - nnethercote:avoid-more-Symbol-to-string-operations, r=petrochenkov
Avoid more `Symbol`-to-string operations

These commits avoid various `Symbol`-to-string conversions, by doing more operations directly on `Symbol`s. This requires adding a few more static `Symbol`s to the binary.

r? @petrochenkov
2019-09-12 04:15:27 +00:00
Nicholas Nethercote 8138efae16 Avoid two `Symbol::as_str()` calls. 2019-09-11 13:30:21 +10:00
Charles Lew 8acab6bc56 Improve wording. 2019-09-08 09:41:59 +08:00
Samy Kacimi 19a848d2ea
normalize use of backticks in compiler messages for librustc_metadata
https://github.com/rust-lang/rust/issues/60532
2019-07-19 22:24:56 +02: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 ec711767a7
Remove needless lifetimes 2019-07-03 10:01:02 +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
Nicholas Nethercote 999c1fc281 Remove the equality operation between `Symbol` and strings.
And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.
2019-05-13 09:31:30 +10:00
Nicholas Nethercote fb084a48e2 Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions. 2019-05-13 09:29:22 +10:00
Esteban Küber 81394ce9ae Fix rebase 2019-03-23 13:05:30 -07:00
Esteban Küber e1be8b0318 Swap primary/secondary spans for E0458 2019-03-23 13:05:30 -07:00
bors 9c499ccfcd Auto merge of #57018 - dcreager:redundant-linker, r=alexcrichton
Keep last redundant linker flag, not first

When a library (L1) is passed to the linker multiple times, this is sometimes purposeful: there might be several other libraries in the linker command (L2 and L3) that all depend on L1.  You'd end up with a (simplified) linker command that looks like:

```
-l2 -l1 -l3 -l1
```

With the previous behavior, when rustc encountered a redundant library, it would keep the first instance, and remove the later ones, resulting in:

```
-l2 -l1 -l3
```

This can cause a linker error, because on some platforms (e.g. Linux), the linker will only include symbols from L1 that are needed *at the point it's referenced in the command line*.  So if L3 depends on additional symbols from L1, which aren't needed by L2, the linker won't know to include them, and you'll end up with "undefined symbols" errors.

A better behavior is to keep the *last* instance of the library:

```
-l2 -l3 -l1
```

This ensures that all "downstream" libraries have been included in the linker command before the "upstream" library is referenced.

Fixes rust-lang#47989
2019-03-20 14:42:47 +00:00
Vadim Petrochenkov 0cf96131f4 Refactor away `NestedMetaItemKind`
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16 23:14:42 +03:00
ljedrz 77fa041fc1 hir: remove NodeId from Item 2019-03-02 07:48:52 +01:00
Taiki Endo 7267bc2d4a librustc_metadata => 2018 2019-02-08 20:50:17 +09:00
AB1908 e5e9867f60 Pass a default value when unwrapping a span
Fixes #57323
2019-01-15 08:26:29 +00:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Douglas Creager c56f128338 Fix typo in comment 2018-12-20 16:19:55 -05:00
Douglas Creager d445e1ccaa Keep last redundant linker flag, not first
When a library (L1) is passed to the linker multiple times, this is
sometimes purposeful: there might be several other libraries in the
linker command (L2 and L3) that all depend on L1.  You'd end up with a
(simplified) linker command that looks like:

    -l2 -l1 -l3 -l1

With the previous behavior, when rustc encountered a redundant library,
it would keep the first instance, and remove the later ones, resulting
in:

    -l2 -l1 -l3

This can cause a linker error, because on some platforms (e.g. Linux),
the linker will only include symbols from L1 that are needed *at the
point it's referenced in the command line*.  So if L3 depends on
additional symbols from L1, which aren't needed by L2, the linker won't
know to include them, and you'll end up with "undefined symbols" errors.

A better behavior is to keep the *last* instance of the library:

    -l2 -l3 -l1

This ensures that all "downstream" libraries have been included in the
linker command before the "upstream" library is referenced.

Fixes rust-lang#47989
2018-12-20 16:01:32 -05: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 ee81739dc1 Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack 2018-10-19 14:34:44 +02:00
kennytm b5519db323
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
Fix typos found by codespell.
2018-08-21 17:51:49 +08:00
Donato Sciarra 82607d2cf3 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
Matthias Krüger 71120ef1e5 Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
Alex Crichton b9024f8a75 rustc: Stabilize #[wasm_import_module] as #[link(...)]
This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.

Closes #52090
2018-07-18 07:50:08 -07:00
csmoe 5b0cf56f32 ItemKind 2018-07-16 15:09:17 +02:00
Irina Popa 04fa0e7bb3 rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00