Skip to content

Rollup of 6 pull requests #104790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 125 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
7c56896
Feat: extracted method from trait impl is placed in existing impl
Aug 9, 2022
7402366
Avoid cloning IMPL node if we don't have to
Aug 10, 2022
d5e6aa3
Pre-cast impl nodes to ast::Impl in find_non_trait_impl
Sep 1, 2022
c98fc53
Generalize reborrow hints as adjustment hints
Veykril Nov 4, 2022
95d20fc
Add adjustment hint tests
Veykril Nov 4, 2022
d841ad1
Fix up adjustment hints configurations
Veykril Nov 4, 2022
e468a1a
internal: Optimize `apply_document_changes` a bit
Veykril Nov 4, 2022
28afe57
Add tests for LineEndings::normalize
Veykril Nov 5, 2022
b87a23b
Rename convertor -> converter
lowr Nov 2, 2022
41b0c54
Fix `tt::Punct`'s spacing calculation
lowr Nov 5, 2022
1dcc25a
internal: Use a process group for flycheck
Veykril Nov 5, 2022
7742077
Auto merge of #13552 - Veykril:flycheck-process-group, r=Veykril
bors Nov 7, 2022
f54c313
Auto merge of #13547 - Veykril:line-index, r=Veykril
bors Nov 7, 2022
cff7ab1
Fix typos
lnicola Nov 7, 2022
364820a
Auto merge of #13566 - lnicola:therefor, r=lnicola
bors Nov 7, 2022
f24fbc2
rustfmt
Veykril Nov 7, 2022
8ad4a1d
Update sysroot crates
Veykril Nov 7, 2022
d3d3806
Auto merge of #12991 - TiddoLangerak:extract-method-from-trait-into-i…
bors Nov 7, 2022
180b4ce
Fix the length displayed for byte string literals with escaped newlines
noritada Nov 7, 2022
c0310c1
Auto merge of #13565 - Veykril:sysroot, r=Veykril
bors Nov 7, 2022
ee2dd93
Don't trigger adjustment hints in all inlay hint tests
Veykril Nov 7, 2022
ffd7bf8
Bump Cargo rust-version fields to latest stable
Veykril Nov 7, 2022
bdf8547
Clarify the intent
noritada Nov 7, 2022
3a839ea
Auto merge of #13569 - Veykril:rust-version, r=Veykril
bors Nov 7, 2022
b0e56ef
Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril
bors Nov 7, 2022
2340d70
Add test code for unescaping byte strings
noritada Nov 7, 2022
b169e1e
Remove code duplication
Veykril Nov 7, 2022
8a633fe
Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
bors Nov 7, 2022
d1c9775
Auto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-n…
bors Nov 7, 2022
6a06f6f
Deduplicate reference search results
Veykril Nov 7, 2022
a27e4da
Auto merge of #13571 - Veykril:unique-references, r=Veykril
bors Nov 7, 2022
fa70b0a
internal: Use Cancellable in favor of Result for clarity
Veykril Nov 7, 2022
0aa0da9
Auto merge of #13572 - Veykril:cancellable, r=Veykril
bors Nov 7, 2022
1cb6ab8
internal: error instead of panic on invalid file range
Veykril Nov 7, 2022
b8b1951
Auto merge of #13573 - Veykril:invalid-file-range, r=Veykril
bors Nov 7, 2022
90e2db8
fix: Fix item completions not working properly after unit structs and…
Veykril Nov 8, 2022
236c116
Auto merge of #13581 - Veykril:unit-struct-compl, r=Veykril
bors Nov 8, 2022
4403dde
Nest Cargo.lock under Cargo.toml in Code
lnicola Nov 8, 2022
977a029
Auto merge of #13582 - lnicola:nest-cargo-toml, r=lnicola
bors Nov 8, 2022
9be0615
Don't canonicalize self type when querying FnOnce signature
Nov 8, 2022
392784a
Auto merge of #13584 - jonas-schievink:fix-signature-panic, r=jonas-s…
bors Nov 8, 2022
3c35d44
Add proc-macro dependency to rustc_private crates
Veykril Nov 9, 2022
599142c
Auto merge of #13590 - Veykril:proc-macro-rustc-src, r=Veykril
bors Nov 9, 2022
4f415fc
Ignore outermost non-delimited `Subtree` when reversing fixups
lowr Nov 10, 2022
5b07061
Test `TokenTree`s' equality modulo `Punct`s' spacing
lowr Nov 10, 2022
dea49d0
fix: check visibility of each segment in path resolution
lowr Nov 11, 2022
e75afeb
Resolve invisible defs in `fix_visibility` assist
lowr Nov 11, 2022
19306c0
Fix tests that depended on loose visibility restriction
lowr Nov 11, 2022
e35836e
Send status notification if there are no found workspaces
Veykril Nov 11, 2022
ff78d24
Auto merge of #13603 - Veykril:no-workspaces, r=Veykril
bors Nov 11, 2022
6f313ce
Auto merge of #13548 - lowr:fix/tt-punct-spacing, r=Veykril
bors Nov 11, 2022
57cc2a6
Auto merge of #13602 - lowr:fix/nameres-transitive-visibility, r=Veykril
bors Nov 11, 2022
e50712c
fix: Fix hover in attributed items not preferring similar kinded tokens
Veykril Nov 11, 2022
add8539
Auto merge of #13604 - Veykril:hover-attr, r=Veykril
bors Nov 11, 2022
c6c932d
chore: Align config property
poliorcetics Sep 24, 2022
0d4737a
feat: Support passing multiple targets to cargo (for Rust 1.64.0+)
poliorcetics Sep 24, 2022
a143ff0
fix: Fix r-a eagerly showing no discovered workspace errors
Veykril Nov 11, 2022
d3531e8
Auto merge of #13605 - Veykril:empty-ws-error, r=Veykril
bors Nov 11, 2022
6674bd8
fix: Add trait alias grammar to rust.ungram
Veykril Nov 11, 2022
2656303
Auto merge of #13606 - Veykril:trait-alias, r=Veykril
bors Nov 11, 2022
6b4b7d8
internal: Add version info to unsupported proc macro abi error
Veykril Nov 11, 2022
45ec315
Auto merge of #13607 - Veykril:proc-macro-error, r=Veykril
bors Nov 11, 2022
46417ad
Update several crates to bring support for the new Tier 3 Windows tar…
mati865 Nov 13, 2022
15dfeab
Fix GAT completion not including generic parameters
Nov 15, 2022
a516b90
Auto merge of #13622 - jonas-schievink:fix-gat-completions, r=jonas-s…
bors Nov 15, 2022
6ed649f
Migrate "function cannot return without recursing" diagnostic
lzcunt Aug 20, 2022
65f4533
Migrate "unsafe_op_in_unsafe_fn" lints
lzcunt Aug 20, 2022
9c3f8d1
Migrate "requires unsafe" diagnostics
lzcunt Aug 24, 2022
1696fb2
Migrate "unused unsafe" lint
lzcunt Aug 24, 2022
c9dc023
Migrate "non-exhaustive patterns: type is non-empty" diagnostic
lzcunt Aug 26, 2022
fb90cb3
Migrate pattern inlining error diagnostics
lzcunt Aug 26, 2022
d3bc82b
Migrate unreachable pattern diagnostic
lzcunt Aug 27, 2022
e26482b
Migrate "constant pattern depends on generic parameter" diagnostic
lzcunt Aug 27, 2022
5b581f0
Migrate "could not evaluate const pattern" diagnostic
lzcunt Aug 27, 2022
058b55e
Migrate lower range bound diagnostics
lzcunt Aug 27, 2022
9137e6d
Migrate leading/trailing irrefutable let pattern diagnostics
lzcunt Aug 28, 2022
4ab0831
Migrate pattern bindings with variant name lint
lzcunt Aug 29, 2022
afc9228
Migrate irrefutable let pattern diagnostics
lzcunt Aug 29, 2022
551daa6
Migrate borrow of moved value diagnostic
lzcunt Aug 30, 2022
018be9e
Migrate multiple mut borrows diagnostic
lzcunt Aug 30, 2022
e9425a5
Fix compile errors
Nov 14, 2022
09ea513
tidy
Nov 14, 2022
a14aafa
Fix "mir_build_multiple_mut_borrows"
Nov 15, 2022
139bc67
Fix bad replacement
Nov 15, 2022
7e77d4e
Strip comments and attributes off of all trait item completions
Nov 15, 2022
8292dd8
Auto merge of #13623 - jonas-schievink:strip-trait-item-completions, …
bors Nov 15, 2022
2354697
Fix rebase :(
Nov 15, 2022
0dd0dfb
Auto merge of #13615 - mati865:miow-update, r=jonas-schievink
bors Nov 15, 2022
1ad11b5
fix: resolve inference variable before applying adjustments
lowr Nov 16, 2022
92e393c
Auto merge of #13624 - lowr:fix/unsize-array-inference-variable, r=ln…
bors Nov 16, 2022
7577c44
Update proc-macro-srv tests
lowr Nov 16, 2022
9cf5c22
Auto merge of #13625 - lowr:fix/proc-macro-src-test, r=lnicola
bors Nov 16, 2022
cd6459e
Make "Remove dbg!()" assist work on selections
Nov 17, 2022
e162d58
Auto merge of #13629 - jonas-schievink:remove-dbg-selection, r=jonas-…
bors Nov 17, 2022
656d886
Make it more obvious which SCIP features we do not yet emit in code
Veykril Nov 18, 2022
bee27eb
Auto merge of #13632 - Veykril:scip, r=Veykril
bors Nov 18, 2022
073a63b
feat: Allow viewing the full compiler diagnostic in a readonly textview
Veykril Nov 18, 2022
8452844
Fix tests checking the data value
Veykril Nov 18, 2022
791cb87
Auto merge of #13633 - Veykril:vscode-full-diagnostics, r=Veykril
bors Nov 18, 2022
52bc15f
fix: Fix proc-macro-srv search paths for Arch Linux
Veykril Nov 18, 2022
a3f8fd7
fix: format expression parsing edge-cases
kartva Nov 19, 2022
dc8254c
fix: Fix nested macro diagnostics pointing at macro expansion files
Veykril Nov 19, 2022
ac60077
Auto merge of #13639 - Veykril:macro-diags, r=Veykril
bors Nov 19, 2022
6d4b2b4
run cargo fmt
kartva Nov 19, 2022
a4f071a
fix(assists): remove `item_const` which had default value when implem…
bvanjoi Nov 19, 2022
8050fdb
Auto merge of #13642 - bvanjoi:fix-13292, r=Veykril
bors Nov 19, 2022
2d9ed4f
Auto merge of #13641 - DesmondWillowbrook:fix-move-format-string, r=V…
bors Nov 19, 2022
38fa47f
Auto merge of #13290 - poliorcetics:multiple-targets, r=Veykril
bors Nov 19, 2022
e39d90a
Improve grammar of architecture.md
ZZzzaaKK Nov 20, 2022
ebbc549
Fix typo on 'configuration' anchor
VannTen Nov 20, 2022
75e1de8
Auto merge of #13649 - ZZzzaaKK:master, r=lnicola
bors Nov 20, 2022
2656297
Auto merge of #13653 - VannTen:fix/doc-typo-vim-lsp, r=Veykril
bors Nov 20, 2022
a2da749
codegen-llvm: never combine DSOLocal and DllImport
dvdhrm Nov 21, 2022
46e0b02
test/codegen: test inter-crate linkage with static relocation
dvdhrm Nov 22, 2022
0a756cc
get rid of to_poly_trait_predicate
oli-obk Nov 18, 2022
b19cf14
Simplify a bunch of trait ref obligation creations
oli-obk Nov 18, 2022
409203a
Use ObligationCtxt::normalize
spastorino Nov 23, 2022
37c3521
:arrow_up: rust-analyzer
lnicola Nov 23, 2022
54a6d4e
Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests
thomcc Nov 20, 2022
dd066cd
Rollup merge of #104417 - mejrs:mir_build, r=davidtwco
Manishearth Nov 23, 2022
6b7fa4e
Rollup merge of #104586 - oli-obk:santa-clauses-make-goals, r=jackh726
Manishearth Nov 23, 2022
340fe81
Rollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, …
Manishearth Nov 23, 2022
9c91297
Rollup merge of #104679 - dvdhrm:rw/dso, r=petrochenkov
Manishearth Nov 23, 2022
4f6b775
Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r…
Manishearth Nov 23, 2022
e69c916
Rollup merge of #104778 - lnicola:rust-analyzer-2022-11-23, r=lnicola
Manishearth Nov 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3943,6 +3943,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_serialize",
"rustc_session",
Expand Down
16 changes: 10 additions & 6 deletions compiler/rustc_codegen_llvm/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,18 @@ impl<'ll> CodegenCx<'ll, '_> {
llvm::set_thread_local_mode(g, self.tls_model);
}

let dso_local = unsafe { self.should_assume_dso_local(g, true) };
if dso_local {
unsafe {
llvm::LLVMRustSetDSOLocal(g, true);
}
}

if !def_id.is_local() {
let needs_dll_storage_attr = self.use_dll_storage_attrs && !self.tcx.is_foreign_item(def_id) &&
// Local definitions can never be imported, so we must not apply
// the DLLImport annotation.
!dso_local &&
// ThinLTO can't handle this workaround in all cases, so we don't
// emit the attrs. Instead we make them unnecessary by disallowing
// dynamic linking when linker plugin based LTO is enabled.
Expand Down Expand Up @@ -340,12 +350,6 @@ impl<'ll> CodegenCx<'ll, '_> {
}
}

unsafe {
if self.should_assume_dso_local(g, true) {
llvm::LLVMRustSetDSOLocal(g, true);
}
}

self.instances.borrow_mut().insert(instance, g);
g
}
Expand Down
13 changes: 4 additions & 9 deletions compiler/rustc_const_eval/src/transform/check_consts/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceC
use rustc_middle::mir::*;
use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts};
use rustc_middle::ty::{self, adjustment::PointerCast, Instance, InstanceDef, Ty, TyCtxt};
use rustc_middle::ty::{Binder, TraitPredicate, TraitRef, TypeVisitable};
use rustc_middle::ty::{Binder, TraitRef, TypeVisitable};
use rustc_mir_dataflow::{self, Analysis};
use rustc_span::{sym, Span, Symbol};
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
Expand Down Expand Up @@ -726,11 +726,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
}

let trait_ref = TraitRef::from_method(tcx, trait_id, substs);
let poly_trait_pred = Binder::dummy(TraitPredicate {
trait_ref,
constness: ty::BoundConstness::ConstIfConst,
polarity: ty::ImplPolarity::Positive,
});
let poly_trait_pred =
Binder::dummy(trait_ref).with_constness(ty::BoundConstness::ConstIfConst);
let obligation =
Obligation::new(tcx, ObligationCause::dummy(), param_env, poly_trait_pred);

Expand Down Expand Up @@ -819,9 +816,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
tcx,
ObligationCause::dummy_with_span(*fn_span),
param_env,
tcx.mk_predicate(
poly_trait_pred.map_bound(ty::PredicateKind::Trait),
),
poly_trait_pred,
);

// improve diagnostics by showing what failed. Our requirements are stricter this time
Expand Down
11 changes: 3 additions & 8 deletions compiler/rustc_const_eval/src/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ use rustc_middle::mir;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
use rustc_middle::ty::{
suggest_constraining_type_param, Adt, Closure, DefIdTree, FnDef, FnPtr, Param, TraitPredicate,
Ty,
suggest_constraining_type_param, Adt, Closure, DefIdTree, FnDef, FnPtr, Param, Ty,
};
use rustc_middle::ty::{Binder, BoundConstness, ImplPolarity, TraitRef};
use rustc_middle::ty::{Binder, TraitRef};
use rustc_session::parse::feature_err;
use rustc_span::symbol::sym;
use rustc_span::{BytePos, Pos, Span, Symbol};
Expand Down Expand Up @@ -150,11 +149,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
tcx,
ObligationCause::dummy(),
param_env,
Binder::dummy(TraitPredicate {
trait_ref,
constness: BoundConstness::NotConst,
polarity: ImplPolarity::Positive,
}),
Binder::dummy(trait_ref),
);

let infcx = tcx.infer_ctxt().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@ impl Qualif for NeedsNonConstDrop {
cx.tcx,
ObligationCause::dummy_with_span(cx.body.span),
cx.param_env,
ty::Binder::dummy(ty::TraitPredicate {
trait_ref: cx.tcx.at(cx.body.span).mk_trait_ref(LangItem::Destruct, [ty]),
constness: ty::BoundConstness::ConstIfConst,
polarity: ty::ImplPolarity::Positive,
}),
ty::Binder::dummy(cx.tcx.at(cx.body.span).mk_trait_ref(LangItem::Destruct, [ty]))
.with_constness(ty::BoundConstness::ConstIfConst),
);

let infcx = cx.tcx.infer_ctxt().build();
Expand Down
Loading