Skip to content

Commit 2bd2be9

Browse files
trvswgnrdoguearjunindialleytonstandardpointer
authored andcommitted
sync with upstream (#109)
* Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * use our crabgo repo as the submodule * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * Renamed style-guide docs * accidentally removed cargo.md * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * Renamed style-guide docs * add fail function * ci: automatically update `upstream` branch from rustlang * submodules not needed for now * checkout upstream * rename step * branch -b is not nessecary * force push * update git submodules to use crablang repos * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * use our crabgo repo as the submodule * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * Renamed style-guide docs * accidentally removed cargo.md * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * Renamed style-guide docs * add fail function * ci: automatically update `upstream` branch from rustlang * submodules not needed for now * checkout upstream * rename step * branch -b is not nessecary * force push * update git submodules to use crablang repos * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * use our crabgo repo as the submodule * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * replace readme with crablang * start the process of clablang -> crab * Update README.md * update references from crablang/crablang to crablang/crab * update references from crablangc to crabc * update references from cargo to crabgo * update readme with community link * Changed old link and content inside "Getting Help" Section https://www.crablang.org/community seems to have been changed to https://community.crablang.org pointing to the discord server. * add install script to readme * add script to sync from upstream * update script with affected files from master * rename * rename * add this script to checked out files from master * add remote if it doesn't exist * check if the "current" branch exists locally * add force push * fix: rename non-code references in ftl locales we specifically rename instances of r**tc, c**go, r**tdoc, and r**tup I was intensionally conservative with the renaming, to not break things * fix: normalize test stderr * update to use rebase * update script to use rebase * sync with remote origin master instead of local master, which may be out of date adds origin with crab master if it doesnt exist remove extraneous check for current branch * add fail function * ci: automatically update `upstream` branch from rustlang * submodules not needed for now * checkout upstream * rename step * branch -b is not nessecary * force push * update git submodules to use crablang repos --------- Co-authored-by: Dogue <[email protected]> Co-authored-by: Arjun S <[email protected]> Co-authored-by: Lleyton Gray <[email protected]> Co-authored-by: standard-robot <[email protected]> Co-authored-by: Jonathan Dickinson <[email protected]>
1 parent 9cbf862 commit 2bd2be9

File tree

85 files changed

+3442
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3442
-411
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defaults:
3131
run:
3232
shell: bash
3333
concurrency:
34-
group: "${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
34+
group: "${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
3535
cancel-in-progress: true
3636
jobs:
3737
pr:

Cargo.lock

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,9 @@ dependencies = [
448448

449449
[[package]]
450450
name = "clap"
451-
version = "4.3.10"
451+
version = "4.2.1"
452452
source = "registry+https://github.com/rust-lang/crates.io-index"
453-
checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a"
453+
checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3"
454454
dependencies = [
455455
"clap_builder",
456456
"clap_derive",
@@ -465,6 +465,7 @@ checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d"
465465
dependencies = [
466466
"anstream",
467467
"anstyle",
468+
"bitflags",
468469
"clap_lex",
469470
"once_cell",
470471
"strsim",
@@ -482,9 +483,9 @@ dependencies = [
482483

483484
[[package]]
484485
name = "clap_derive"
485-
version = "4.3.2"
486+
version = "4.2.0"
486487
source = "registry+https://github.com/rust-lang/crates.io-index"
487-
checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f"
488+
checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4"
488489
dependencies = [
489490
"heck",
490491
"proc-macro2",
@@ -494,14 +495,15 @@ dependencies = [
494495

495496
[[package]]
496497
name = "clap_lex"
497-
version = "0.5.0"
498+
version = "0.4.1"
498499
source = "registry+https://github.com/rust-lang/crates.io-index"
499-
checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
500+
checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
500501

501502
[[package]]
502503
name = "clippy"
503504
version = "0.1.72"
504505
dependencies = [
506+
"clap",
505507
"clippy_lints",
506508
"filetime",
507509
"itertools",
@@ -519,7 +521,7 @@ dependencies = [
519521
name = "clippy_dev"
520522
version = "0.0.1"
521523
dependencies = [
522-
"aho-corasick 0.7.20",
524+
"aho-corasick",
523525
"clap",
524526
"indoc",
525527
"itertools",
@@ -637,9 +639,9 @@ dependencies = [
637639

638640
[[package]]
639641
name = "compiler_builtins"
640-
version = "0.1.95"
642+
version = "0.1.93"
641643
source = "registry+https://github.com/rust-lang/crates.io-index"
642-
checksum = "6866e0f3638013234db3c89ead7a14d278354338e7237257407500009012b23f"
644+
checksum = "76630810d973ecea3dbf611e1b7aecfb1012751ef1ff8de3998f89014a166781"
643645
dependencies = [
644646
"cc",
645647
"rustc-std-workspace-core",
@@ -2258,12 +2260,6 @@ dependencies = [
22582260
"vcpkg",
22592261
]
22602262

2261-
[[package]]
2262-
name = "overload"
2263-
version = "0.1.1"
2264-
source = "registry+https://github.com/rust-lang/crates.io-index"
2265-
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
2266-
22672263
[[package]]
22682264
name = "owo-colors"
22692265
version = "3.5.0"
@@ -2503,9 +2499,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
25032499

25042500
[[package]]
25052501
name = "proc-macro2"
2506-
version = "1.0.63"
2502+
version = "1.0.60"
25072503
source = "registry+https://github.com/rust-lang/crates.io-index"
2508-
checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb"
2504+
checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
25092505
dependencies = [
25102506
"unicode-ident",
25112507
]
@@ -3995,8 +3991,8 @@ dependencies = [
39953991
name = "rustc_target"
39963992
version = "0.0.0"
39973993
dependencies = [
3998-
"bitflags 1.3.2",
3999-
"object",
3994+
"bitflags",
3995+
"object 0.31.1",
40003996
"rustc_abi",
40013997
"rustc_data_structures",
40023998
"rustc_feature",

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,73 +1284,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12841284
}
12851285
}
12861286

1287-
/// Suggest using `while let` for call `next` on an iterator in a for loop.
1288-
///
1289-
/// For example:
1290-
/// ```ignore (illustrative)
1291-
///
1292-
/// for x in iter {
1293-
/// ...
1294-
/// iter.next()
1295-
/// }
1296-
/// ```
1297-
pub(crate) fn explain_iterator_advancement_in_for_loop_if_applicable(
1298-
&self,
1299-
err: &mut Diagnostic,
1300-
span: Span,
1301-
issued_spans: &UseSpans<'tcx>,
1302-
) {
1303-
let issue_span = issued_spans.args_or_use();
1304-
let tcx = self.infcx.tcx;
1305-
let hir = tcx.hir();
1306-
1307-
let Some(body_id) = hir.get(self.mir_hir_id()).body_id() else { return };
1308-
let typeck_results = tcx.typeck(self.mir_def_id());
1309-
1310-
struct ExprFinder<'hir> {
1311-
issue_span: Span,
1312-
expr_span: Span,
1313-
body_expr: Option<&'hir hir::Expr<'hir>>,
1314-
loop_bind: Option<Symbol>,
1315-
}
1316-
impl<'hir> Visitor<'hir> for ExprFinder<'hir> {
1317-
fn visit_expr(&mut self, ex: &'hir hir::Expr<'hir>) {
1318-
if let hir::ExprKind::Loop(hir::Block{ stmts: [stmt, ..], ..}, _, hir::LoopSource::ForLoop, _) = ex.kind &&
1319-
let hir::StmtKind::Expr(hir::Expr{ kind: hir::ExprKind::Match(call, [_, bind, ..], _), ..}) = stmt.kind &&
1320-
let hir::ExprKind::Call(path, _args) = call.kind &&
1321-
let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IteratorNext, _, _, )) = path.kind &&
1322-
let hir::PatKind::Struct(path, [field, ..], _) = bind.pat.kind &&
1323-
let hir::QPath::LangItem(LangItem::OptionSome, _, _) = path &&
1324-
let PatField { pat: hir::Pat{ kind: hir::PatKind::Binding(_, _, ident, ..), .. }, ..} = field &&
1325-
self.issue_span.source_equal(call.span) {
1326-
self.loop_bind = Some(ident.name);
1327-
}
1328-
1329-
if let hir::ExprKind::MethodCall(body_call, _recv, ..) = ex.kind &&
1330-
body_call.ident.name == sym::next && ex.span.source_equal(self.expr_span) {
1331-
self.body_expr = Some(ex);
1332-
}
1333-
1334-
hir::intravisit::walk_expr(self, ex);
1335-
}
1336-
}
1337-
let mut finder =
1338-
ExprFinder { expr_span: span, issue_span, loop_bind: None, body_expr: None };
1339-
finder.visit_expr(hir.body(body_id).value);
1340-
1341-
if let Some(loop_bind) = finder.loop_bind &&
1342-
let Some(body_expr) = finder.body_expr &&
1343-
let Some(def_id) = typeck_results.type_dependent_def_id(body_expr.hir_id) &&
1344-
let Some(trait_did) = tcx.trait_of_item(def_id) &&
1345-
tcx.is_diagnostic_item(sym::Iterator, trait_did) {
1346-
err.note(format!(
1347-
"a for loop advances the iterator for you, the result is stored in `{}`.",
1348-
loop_bind
1349-
));
1350-
err.help("if you want to call `next` on a iterator within the loop, consider using `while let`.");
1351-
}
1352-
}
1353-
13541287
/// Suggest using closure argument instead of capture.
13551288
///
13561289
/// For example:

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -936,11 +936,11 @@ unsafe fn embed_bitcode(
936936
llvm::LLVMSetInitializer(llglobal, llconst);
937937

938938
let section = if is_apple {
939-
"__LLVM,__bitcode\0"
939+
c"__LLVM,__bitcode"
940940
} else if is_aix {
941-
".ipa\0"
941+
c".ipa"
942942
} else {
943-
".llvmbc\0"
943+
c".llvmbc"
944944
};
945945
llvm::LLVMSetSection(llglobal, section.as_ptr().cast());
946946
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
@@ -954,11 +954,11 @@ unsafe fn embed_bitcode(
954954
);
955955
llvm::LLVMSetInitializer(llglobal, llconst);
956956
let section = if is_apple {
957-
"__LLVM,__cmdline\0"
957+
c"__LLVM,__cmdline"
958958
} else if is_aix {
959-
".info\0"
959+
c".info"
960960
} else {
961-
".llvmcmd\0"
961+
c".llvmcmd"
962962
};
963963
llvm::LLVMSetSection(llglobal, section.as_ptr().cast());
964964
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::llvm_util;
88
use crate::type_::Type;
99
use crate::value::Value;
1010

11-
use cstr::cstr;
1211
use rustc_codegen_ssa::base::{wants_msvc_seh, wants_wasm_eh};
1312
use rustc_codegen_ssa::traits::*;
1413
use rustc_data_structures::base_n;

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
303303
// the appropriate EF_AVR_ARCH flag.
304304
ef_avr_arch(&sess.target.options.cpu)
305305
}
306+
Architecture::Avr => {
307+
// Resolve the ISA revision and set
308+
// the appropriate EF_AVR_ARCH flag.
309+
ef_avr_arch(&sess.target.options.cpu)
310+
}
306311
_ => 0,
307312
};
308313
// adapted from LLVM's `MCELFObjectTargetWriter::getOSABI`

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ pub(crate) fn eval_to_valtree<'tcx>(
8787
#[instrument(skip(tcx), level = "debug")]
8888
pub(crate) fn try_destructure_mir_constant_for_diagnostics<'tcx>(
8989
tcx: TyCtxt<'tcx>,
90-
val: ConstValue<'tcx>,
91-
ty: Ty<'tcx>,
92-
) -> Option<mir::DestructuredConstant<'tcx>> {
93-
let param_env = ty::ParamEnv::reveal_all();
90+
param_env: ty::ParamEnv<'tcx>,
91+
val: mir::ConstantKind<'tcx>,
92+
) -> InterpResult<'tcx, mir::DestructuredConstant<'tcx>> {
93+
trace!("destructure_mir_constant: {:?}", val);
9494
let ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, CanAccessStatics::No);
95-
let op = ecx.const_val_to_op(val, ty, None).ok()?;
95+
let op = ecx.eval_mir_constant(&val, None, None)?;
9696

9797
// We go to `usize` as we cannot allocate anything bigger anyway.
9898
let (field_count, variant, down) = match ty.kind() {

compiler/rustc_const_eval/src/util/check_validity_requirement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn might_permit_raw_init_strict<'tcx>(
4343
ty: TyAndLayout<'tcx>,
4444
tcx: TyCtxt<'tcx>,
4545
kind: ValidityRequirement,
46-
) -> Result<bool, &'tcx LayoutError<'tcx>> {
46+
) -> Result<bool, LayoutError<'tcx>> {
4747
let machine = CompileTimeInterpreter::new(CanAccessStatics::No, CheckAlignment::Error);
4848

4949
let mut cx = InterpCx::new(tcx, rustc_span::DUMMY_SP, ParamEnv::reveal_all(), machine);

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn run_compiler(
283283
interface::set_thread_safe_mode(&sopts.unstable_opts);
284284

285285
if let Some(ref code) = matches.opt_str("explain") {
286-
handle_explain(&early_error_handler, diagnostics_registry(), code, sopts.color);
286+
handle_explain(&early_error_handler, diagnostics_registry(), code);
287287
return Ok(());
288288
}
289289

@@ -541,7 +541,7 @@ impl Compilation {
541541
}
542542
}
543543

544-
fn handle_explain(handler: &EarlyErrorHandler, registry: Registry, code: &str, color: ColorConfig) {
544+
fn handle_explain(handler: &EarlyErrorHandler, registry: Registry, code: &str) {
545545
let upper_cased_code = code.to_ascii_uppercase();
546546
let normalised =
547547
if upper_cased_code.starts_with('E') { upper_cased_code } else { format!("E{code:0>4}") };

0 commit comments

Comments
 (0)