@@ -357,5 +357,213 @@ error: layout_of(NonZeroU32New) = Layout {
357357LL | struct NonZeroU32New(pattern_type!(u32 is 1..));
358358 | ^^^^^^^^^^^^^^^^^^^^
359359
360- error: aborting due to 5 previous errors
360+ error: layout_of((u32) is 1..=0) = Layout {
361+ size: Size(4 bytes),
362+ align: AbiAndPrefAlign {
363+ abi: Align(4 bytes),
364+ pref: $SOME_ALIGN,
365+ },
366+ backend_repr: Scalar(
367+ Initialized {
368+ value: Int(
369+ I32,
370+ false,
371+ ),
372+ valid_range: (..=0) | (1..),
373+ },
374+ ),
375+ fields: Primitive,
376+ largest_niche: Some(
377+ Niche {
378+ offset: Size(0 bytes),
379+ value: Int(
380+ I32,
381+ false,
382+ ),
383+ valid_range: (..=0) | (1..),
384+ },
385+ ),
386+ uninhabited: false,
387+ variants: Single {
388+ index: 0,
389+ },
390+ max_repr_align: None,
391+ unadjusted_abi_align: Align(4 bytes),
392+ randomization_seed: $SEED,
393+ }
394+ --> $DIR/range_patterns.rs:22:1
395+ |
396+ LL | type EMPTY = pattern_type!(u32 is 1..1);
397+ | ^^^^^^^^^^
398+
399+ error[E0080]: evaluation of constant value failed
400+ --> $DIR/range_patterns.rs:25:37
401+ |
402+ LL | type WRAP = pattern_type!(u32 is 1..0);
403+ | ^ evaluation panicked: exclusive range end at minimum value of type
404+
405+ error: the type has an unknown layout
406+ --> $DIR/range_patterns.rs:25:1
407+ |
408+ LL | type WRAP = pattern_type!(u32 is 1..0);
409+ | ^^^^^^^^^
410+
411+ error: layout_of((u32) is 5..=1) = Layout {
412+ size: Size(4 bytes),
413+ align: AbiAndPrefAlign {
414+ abi: Align(4 bytes),
415+ pref: $SOME_ALIGN,
416+ },
417+ backend_repr: Scalar(
418+ Initialized {
419+ value: Int(
420+ I32,
421+ false,
422+ ),
423+ valid_range: (..=1) | (5..),
424+ },
425+ ),
426+ fields: Primitive,
427+ largest_niche: Some(
428+ Niche {
429+ offset: Size(0 bytes),
430+ value: Int(
431+ I32,
432+ false,
433+ ),
434+ valid_range: (..=1) | (5..),
435+ },
436+ ),
437+ uninhabited: false,
438+ variants: Single {
439+ index: 0,
440+ },
441+ max_repr_align: None,
442+ unadjusted_abi_align: Align(4 bytes),
443+ randomization_seed: $SEED,
444+ }
445+ --> $DIR/range_patterns.rs:29:1
446+ |
447+ LL | type WRAP2 = pattern_type!(u32 is 5..2);
448+ | ^^^^^^^^^^
449+
450+ error: layout_of((i8) is -10..=10) = Layout {
451+ size: Size(1 bytes),
452+ align: AbiAndPrefAlign {
453+ abi: Align(1 bytes),
454+ pref: $SOME_ALIGN,
455+ },
456+ backend_repr: Scalar(
457+ Initialized {
458+ value: Int(
459+ I8,
460+ true,
461+ ),
462+ valid_range: (..=10) | (246..),
463+ },
464+ ),
465+ fields: Primitive,
466+ largest_niche: Some(
467+ Niche {
468+ offset: Size(0 bytes),
469+ value: Int(
470+ I8,
471+ true,
472+ ),
473+ valid_range: (..=10) | (246..),
474+ },
475+ ),
476+ uninhabited: false,
477+ variants: Single {
478+ index: 0,
479+ },
480+ max_repr_align: None,
481+ unadjusted_abi_align: Align(1 bytes),
482+ randomization_seed: $SEED,
483+ }
484+ --> $DIR/range_patterns.rs:32:1
485+ |
486+ LL | type SIGN = pattern_type!(i8 is -10..=10);
487+ | ^^^^^^^^^
488+
489+ error: layout_of((i8) is i8::MIN..=0) = Layout {
490+ size: Size(1 bytes),
491+ align: AbiAndPrefAlign {
492+ abi: Align(1 bytes),
493+ pref: $SOME_ALIGN,
494+ },
495+ backend_repr: Scalar(
496+ Initialized {
497+ value: Int(
498+ I8,
499+ true,
500+ ),
501+ valid_range: (..=0) | (128..),
502+ },
503+ ),
504+ fields: Primitive,
505+ largest_niche: Some(
506+ Niche {
507+ offset: Size(0 bytes),
508+ value: Int(
509+ I8,
510+ true,
511+ ),
512+ valid_range: (..=0) | (128..),
513+ },
514+ ),
515+ uninhabited: false,
516+ variants: Single {
517+ index: 0,
518+ },
519+ max_repr_align: None,
520+ unadjusted_abi_align: Align(1 bytes),
521+ randomization_seed: $SEED,
522+ }
523+ --> $DIR/range_patterns.rs:35:1
524+ |
525+ LL | type MIN = pattern_type!(i8 is -128..=0);
526+ | ^^^^^^^^
527+
528+ error: layout_of((i8) is 120..=-120) = Layout {
529+ size: Size(1 bytes),
530+ align: AbiAndPrefAlign {
531+ abi: Align(1 bytes),
532+ pref: $SOME_ALIGN,
533+ },
534+ backend_repr: Scalar(
535+ Initialized {
536+ value: Int(
537+ I8,
538+ true,
539+ ),
540+ valid_range: 120..=136,
541+ },
542+ ),
543+ fields: Primitive,
544+ largest_niche: Some(
545+ Niche {
546+ offset: Size(0 bytes),
547+ value: Int(
548+ I8,
549+ true,
550+ ),
551+ valid_range: 120..=136,
552+ },
553+ ),
554+ uninhabited: false,
555+ variants: Single {
556+ index: 0,
557+ },
558+ max_repr_align: None,
559+ unadjusted_abi_align: Align(1 bytes),
560+ randomization_seed: $SEED,
561+ }
562+ --> $DIR/range_patterns.rs:38:1
563+ |
564+ LL | type SignedWrap = pattern_type!(i8 is 120..=-120);
565+ | ^^^^^^^^^^^^^^^
566+
567+ error: aborting due to 12 previous errors
361568
569+ For more information about this error, try `rustc --explain E0080`.
0 commit comments