about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2020-02-02Avoid exponential behaviour when relating typesMatthew Jasper-2/+19
2020-02-01remove rustc_ast_pretty dep from rustcMazdak Farrokhzad-2/+0
2020-02-01pacify the parallel compilerMazdak Farrokhzad-2/+2
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-0/+2
2020-02-011. move node_id to syntaxMazdak Farrokhzad-24/+25
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-11/+12
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-2/+0
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-4/+4
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-29Move upvars query to librustc_passes.Camille GILLOT-2/+0
2020-01-29Move upvars.rs to librustc_passes.Camille GILLOT-110/+0
2020-01-29Move check_mod_attr query in librustc_passes.Camille GILLOT-1/+125
2020-01-29Move check_attr.rs to librustc_passes.Camille GILLOT-587/+0
2020-01-29Rollup merge of #68586 - Centril:repr-deny, r=pnkfelixYuki Okushi-9/+12
Make conflicting_repr_hints a deny-by-default c-future-compat lint Closes https://github.com/rust-lang/rust/issues/68428. cc https://github.com/rust-lang/rust/issues/68585. r? @petrochenkov @pnkfelix
2020-01-29Auto merge of #68512 - spastorino:local-is-copy, r=oli-obkbors-11/+11
Local is copy r? @oli-obk
2020-01-29Rollup merge of #68619 - gorilskij:master, r=varkorYuki Okushi-2/+2
Fix a few spelling mistakes
2020-01-29Rollup merge of #68289 - ↵Yuki Okushi-9/+30
pnkfelix:issue-62649-dont-ice-on-path-collision-in-dep-graph, r=michaelwoerister Don't ICE on path-collision in dep-graph Collisions in the dep-graph due to path-reuse are rare but can occur. So, instead of ICE'ing, just fail to mark green in such cases (for `DepKind::{Hir, HirBody, CrateMetadata}`). Fix #62649.
2020-01-28Fix a few spelling mistakesgorilskij-2/+2
2020-01-28Add an early-exit to `QueryNormalizer::fold_ty`Jonas Schievink-0/+4
2020-01-28Remove unneeded & on match patternSantiago Pastorino-2/+2
2020-01-28Place::ty_from takes local by valueSantiago Pastorino-3/+3
2020-01-28Local field on PlaceRef and RootPlace is not a reference anymoreSantiago Pastorino-7/+7
2020-01-28lintify conflicting_repr_hintsMazdak Farrokhzad-9/+12
2020-01-27Collisions in the dep-graph due to path-reuse are rare but can occur.Felix S. Klock II-9/+30
So, instead of ICE'ing, just fail to mark green in such cases (for `DepKind::{Hir, HirBody, CrateMetadata}`). Fix #62649.
2020-01-27make matches exhaustiveMatthias Krüger-6/+14
2020-01-27don't clone types that are copy, round two.Matthias Krüger-37/+30
2020-01-26Auto merge of #68545 - estebank:verbose-bound-display, r=petrochenkovbors-3/+7
Use better bound names in `-Zverbose` mode r? @petrochenkov as per https://github.com/rust-lang/rust/pull/67951/files#r365524015
2020-01-26Auto merge of #68522 - estebank:impl-trait-sugg-2, r=oli-obkbors-17/+52
Further improve `impl Trait`/`dyn Trait` suggestions After reading [_Returning Trait Objects_ by Bryce Fisher-Fleig](https://bryce.fisher-fleig.org/blog/returning-trait-objects/), [I noticed that](https://www.reddit.com/r/rust/comments/esueur/returning_trait_objects/ffczl4k/) #68195 had a few bugs due to not ignoring `ty::Error`. - Account for `ty::Error`. - Account for `if`/`else` and `match` blocks when pointing at return types and referencing their types. - Increase the multiline suggestion output from 6 lines to 20.
2020-01-26Auto merge of #68517 - oli-obk:spaces2, r=nagisabors-3/+3
Don't use spaces before type ascription like colons Split out of #67133 to make that PR simpler r? @eddyb
2020-01-26Auto merge of #68031 - Marwes:fold_list, r=estebankbors-17/+35
perf: Avoid creating a SmallVec if nothing changes during a fold Not sure if this helps but in theory it should be less work than what the current micro optimization does for `ty::Predicate` lists. (It would explain the overhead I am seeing from `perf`.)
2020-01-25Use better bound names in `-Zverbose` modeEsteban Küber-3/+7
2020-01-25Auto merge of #68516 - oli-obk:spaces, r=eddybbors-3/+9
Render const pointers in MIR more compactly Split out from #67133 to make that PR simpler cc @RalfJung r? @eddyb
2020-01-25Don't use spaces before type ascription like colonsOliver Scherer-3/+3
2020-01-25Auto merge of #68269 - csmoe:temp, r=estebankbors-5/+32
Suggest to shorten temporary borrow from raw pointer Closes https://github.com/rust-lang/rust/issues/65436 r? @estebank cc @tmandry
2020-01-25Rollup merge of #68111 - varkor:const-generics-type_name, r=oli-obkYuki Okushi-8/+30
Print constants in `type_name` for const generics Fixes https://github.com/rust-lang/rust/issues/65372. r? @oli-obk as there may have been a deliberate decision not to in https://github.com/rust-lang/rust/commit/5b9848912a85e28d000602fc2e81bad9c2f2a981#diff-4ed1a72c0bfdf17be769ed520932cd02R80.
2020-01-24review commentsEsteban Küber-10/+8
2020-01-24Apply `resolve_vars_if_possible` to returned types for more accurate suggestionsEsteban Küber-2/+6
2020-01-24Use more accurate return path spansEsteban Küber-11/+42
No longer suggest `Box::new(if foo { Type1 } else { Type2 })`, instead suggesting `if foo { Box::new(Type1) } else { Box::new(Type2) }`.
2020-01-24Normalise notes with the/isvarkor-4/+4
2020-01-24Print constants in `type_name` for const genericsvarkor-8/+30
2020-01-24Render const pointers in MIR more compactlyOliver Scherer-3/+9
2020-01-24Auto merge of #68414 - michaelwoerister:share-drop-glue, r=alexcrichtonbors-68/+103
Also share drop-glue when compiling with -Zshare-generics (i.e. at opt-level=0) This PR adds drop-glue to the set of monomorphizations that can be shared across crates via `-Zshare-generics`. This version of the PR might have detrimental effects on performance as it makes lots of stuff dependent on a single query results (`upstream_monomorphizations_for(def_id_of_drop_in_place)`). That should be fixable but let's do a perf run first. Potentially fixes issue https://github.com/rust-lang/rust/issues/64140. (cc @alexcrichton) The changes here are related to @matthewjasper's https://github.com/rust-lang/rust/pull/67332 but should be mostly orthogonal. r? @ghost
2020-01-23Account for `ty::Error` when suggesting `impl Trait` or `Box<dyn Trait>`Esteban Küber-6/+8
2020-01-23Add projection query for upstream drop-glue instances.Michael Woerister-24/+85
This reduces the amount of invalidated data when new types are add to upstream crates.
2020-01-23Always just use symbol name for sorting exported symbols.Michael Woerister-38/+0
2020-01-23Clarify some methods around instance instantiation via comments and clearer ↵Michael Woerister-6/+18
names.
2020-01-23unused-parens: implement for block return valuesTyler Lanphear-2/+2
2020-01-22Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest`Aaron Hill-3/+6
Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.
2020-01-22Rollup merge of #68425 - phi-gamma:try-method, r=varkorTyler Mandry-20/+34
Fix try-op diagnostic in E0277 for methods For methods the try-op diagnostic displays the empty string where it has more descriptive strings like “a function” otherwise: error[E0277]: the `?` operator can only be used in that returns `Result` or `Option` (or another type that implements `std::ops::Try`) ^^ | | ^^ cannot use the `?` operator in that returns `()` ^^ I’m seeing this on nightly (rustc 1.42.0-nightly (b5a3341f1 2020-01-20)) and [on the playpen](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0e7ce7792c2aceb8056941710d539124). The changeset add strings for impl methods and trait provided methods and test cases for the option type.
2020-01-22Rollup merge of #68388 - varkor:toogeneric-wf, r=eddybTyler Mandry-11/+23
Make `TooGeneric` error in WF checking a proper error `TooGeneric` is encountered during WF checking when we cannot determine that a constant involving a generic parameter will always be evaluated successfully (rather than resulting in an error). In these cases, the burden of proof should be with the caller, so that we can avoid post-monomorphisation tim errors (which was the previous previous behaviour). This commit ensures that this situation produces a proper compiler error, rather than silently ignoring it or ICEing. Fixes https://github.com/rust-lang/rust/issues/66962. r? @eddyb
2020-01-23Add `-Z no-link` flagVictor Ding-3/+4
Adds a compiler option to allow rustc compile a crate without linking. With this flag, rustc serializes codegen_results into a .rlink file.