about summary refs log tree commit diff
path: root/compiler/rustc_privacy
AgeCommit message (Collapse)AuthorLines
2021-10-02Auto merge of #89405 - GuillaumeGomez:fix-clippy-lints, r=cjgillotbors-16/+16
Fix clippy lints I'm currently working on allowing clippy to run on librustdoc after a discussion I had with `@Mark-Simulacrum.` So in the meantime, I fixed a few lints on the compiler crates.
2021-10-01Fix clippy lintsGuillaume Gomez-16/+16
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-3/+1
2021-09-21Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebankbors-1/+1
Migrate in-tree crates to 2021 This replaces #89075 (cherry picking some of the commits from there), and closes #88637 and fixes #89074. It excludes a migration of the library crates for now (see tidy diff) because we have some pending bugs around macro spans to fix there. I instrumented bootstrap during the migration to make sure all crates moved from 2018 to 2021 had the compatibility warnings applied first. Originally, the intent was to support cargo fix --edition within bootstrap, but this proved fairly difficult to pull off. We'd need to architect the check functionality to support running cargo check and cargo fix within the same x.py invocation, and only resetting sysroots on check. Further, it was found that cargo fix doesn't behave too well with "not quite workspaces", such as Clippy which has several crates. Bootstrap runs with --manifest-path ... for all the tools, and this makes cargo fix only attempt migration for that crate. We can't use e.g. --workspace due to needing to maintain sysroots for different phases of compilation appropriately. It is recommended to skip the mass migration of Cargo.toml's to 2021 for review purposes; you can also use `git diff d6cd2c6c877110748296760aefddc21a0ea1d316 -I'^edition = .20...$'` to ignore the edition = 2018/21 lines in the diff.
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-20Do not store visibility in *ItemRef.Camille GILLOT-3/+8
2021-09-09add a `CastKind` to `Node::Cast`Ellen-1/+1
2021-09-09rename mir -> thir around abstract constsEllen-1/+1
2021-09-09tidyEllen-3/+3
2021-09-09dont support blocksEllen-2/+1
2021-09-09as casts and block exprsEllen-1/+1
2021-09-09WIP stateEllen-3/+4
2021-09-02Rename walk_crate.Camille GILLOT-3/+3
2021-09-02Stop using walk_crate.Camille GILLOT-3/+3
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-2/+2
:sparkles:
2021-08-28Treat macros as HIR itemsinquisitivecrystal-47/+68
2021-08-26use `ty::Unevaluated` instead of def substs pairlcnr-2/+2
2021-08-26make unevaluated const substs optionallcnr-2/+2
2021-08-26require a `tcx` for `TypeVisitor`lcnr-0/+4
2021-08-24Auto merge of #87739 - Aaron1011:remove-used-attrs, r=wesleywiserbors-3/+1
Remove `Session.used_attrs` and move logic to `CheckAttrVisitor` Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-21Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`Aaron Hill-3/+1
Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-08-19rustc_privacy: Replace `HirId`s and `DefId`s with `LocalDefId`s where possibleVadim Petrochenkov-63/+76
2021-08-13move Constness into TraitPredicateDeadbeef-1/+1
2021-08-04Auto merge of #87568 - petrochenkov:localevel, r=cjgillotbors-81/+80
rustc: Replace `HirId`s with `LocalDefId`s in `AccessLevels` tables and passes using those tables - primarily privacy checking, stability checking and dead code checking. All these passes work with definitions rather than with arbitrary HIR nodes. r? `@cjgillot` cc `@lambinoo` (#87487)
2021-07-31rustc: Replace `HirId`s with `LocalDefId`s in `AccessLevels` tablesVadim Petrochenkov-81/+80
and passes using them - primarily privacy checking, stability checking and dead code checking. WIP
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-26Actually infer args in visitorskadmin-0/+7
2021-07-25Add inferred args to typeckkadmin-10/+18
2021-07-25Add generic arg inferkadmin-0/+25
2021-07-06Make resolutions a query.Camille GILLOT-1/+1
2021-06-09Add more tests + visit_ty in some placesEllen-4/+4
2021-06-08Support as casts in abstract constsEllen-3/+4
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-1/+1
2021-05-30Make resolutions a query.Camille GILLOT-1/+1
2021-05-24remove cfg(bootstrap)Pietro Albini-1/+0
2021-05-12Use () for privacy.Camille GILLOT-8/+4
2021-04-19fix few typosklensy-1/+1
2021-03-23Update with commentskadmin-4/+2
A bunch of nits fixed, and a new test for pretty printing the AST.
2021-03-23Some refactoringvarkor-0/+1
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-2/+7
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-19stabilize or_patternsmark-1/+1
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-2/+2
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2021-03-09Remove hir::MacroDef::attrs.Camille GILLOT-1/+2
2021-02-18Rollup merge of #82066 - matthewjasper:trait-ref-fix, r=jackh726Dylan DPC-4/+23
Ensure valid TraitRefs are created for GATs This fixes `ProjectionTy::trait_ref` to use the correct substs. Places that need all of the substs have been updated to not use `trait_ref`. r? ````@jackh726````
2021-02-18Auto merge of #81574 - tmiasko:p, r=oli-obkbors-33/+21
Precompute ancestors when checking privacy Precompute ancestors of the old error node set so that check for private types and traits in public interfaces can in constant time determine if the current item has any descendants in the old error set. This removes disparity in compilation time between public and private type aliases reported in #50614 (from 30 s to 5 s, in an example making extensive use of private type aliases). No functional changes intended.
2021-02-15Only store a LocalDefId in hir::MacroDef.Camille GILLOT-5/+3
2021-02-15Only store a LocalDefId in hir::ForeignItem.Camille GILLOT-6/+6
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-13/+11
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-4/+4